379015 Use factored jetty xml config files for defaults

This commit is contained in:
Jan Bartel 2012-05-10 11:27:58 +02:00
parent 9aa5f49df5
commit b281b037dd
7 changed files with 6 additions and 5 deletions

View File

@ -81,7 +81,7 @@ public class DefaultJettyAtJettyHomeHelper
/**
* Set of config files to apply to a jetty Server instance if none are supplied by SYS_PROP_JETTY_ETC_FILES
*/
public static final String DEFAULT_JETTY_ETC_FILES = "jetty-osgi-default.xml,jetty-osgi-selector-default.xml,jetty-osgi-deployer-default.xml";
public static final String DEFAULT_JETTY_ETC_FILES = "jetty.xml,jetty-selector.xml,jetty-deployer.xml";
/**
* Default location within bundle of a jetty home dir.
@ -227,7 +227,7 @@ public class DefaultJettyAtJettyHomeHelper
private static String getJettyConfigurationURLs(Bundle configurationBundle)
{
String files = System.getProperty(SYS_PROP_JETTY_ETC_FILES, DEFAULT_JETTY_ETC_FILES);
StringTokenizer tokenizer = new StringTokenizer(files, ";,", false);
StringBuilder res = new StringBuilder();
@ -248,7 +248,7 @@ public class DefaultJettyAtJettyHomeHelper
// jettyhome for the default embedded configuration.
// default inside jettyhome. this way fragments to the bundle
// can define their own configuration.
if ((enUrls == null || !enUrls.hasMoreElements()) && etcFile.endsWith("-default.xml"))
if ((enUrls == null || !enUrls.hasMoreElements()))
{
String tmp = DEFAULT_JETTYHOME+"/etc/"+etcFile;
enUrls = BundleFileLocatorHelper.DEFAULT.findEntries(configurationBundle, tmp);

View File

@ -21,6 +21,7 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -292,9 +292,9 @@ public class FrameworkLauncherExtended extends FrameworkLauncher
if (etcJettyXml == null)
{
etcJettyXml = "etc/jetty.xml";
if (new File(jettyHome, "etc/jetty-osgi-nested.xml").exists())
if (new File(jettyHome, "etc/jetty-nested.xml").exists())
{
etcJettyXml += ",etc/jetty-osgi-nested.xml";
etcJettyXml += ",etc/jetty-nested.xml";
}
System.setProperty("jetty.etc.config.urls", etcJettyXml);
props.setProperty("jetty.etc.config.urls", etcJettyXml);