log.info("Starting");
List<LifeCycle> components = new ArrayList<>();
PropertyMap props = new PropertyMap();
props.putAll(JettyServer.this.properties);
// For all arguments, load properties or parse XMLs
XmlConfiguration last = null;
for (String arg : args) {
URL url = Resource.newResource(arg).getURL();
if (url.getFile().toLowerCase(Locale.ENGLISH).endsWith(".properties")) {
log.info("Loading properties: {}", url);
props.load(url);
}
else {
log.info("Applying configuration: {}", url);
XmlConfiguration configuration = new XmlConfiguration(url);
if (last != null) {
configuration.getIdMap().putAll(last.getIdMap());
}
if (!props.isEmpty()) {
configuration.getProperties().putAll(props);
}
Object component = configuration.configure();
if (component instanceof LifeCycle) {
components.add((LifeCycle) component);