public void applyJettyXml() throws Exception
{
if (getJettyXmlFiles() == null)
return;
XmlConfiguration last = null;
for ( File xmlFile : getJettyXmlFiles() )
{
getLog().info( "Configuring Jetty from xml configuration file = " + xmlFile.getCanonicalPath() );
XmlConfiguration xmlConfiguration = new XmlConfiguration(Resource.toURL(xmlFile));
//chain ids from one config file to another
if (last == null)
xmlConfiguration.getIdMap().put("Server", this.server);
else
xmlConfiguration.getIdMap().putAll(last.getIdMap());
//Set the system properties each time in case the config file set a new one
Enumeration<?> ensysprop = System.getProperties().propertyNames();
while (ensysprop.hasMoreElements())
{
String name = (String)ensysprop.nextElement();
xmlConfiguration.getProperties().put(name,System.getProperty(name));
}
last = xmlConfiguration;
xmlConfiguration.configure();
}
}