1 package org.openehealth.ipf.tutorials.config.base;
2
3 import org.apache.camel.spring.Main;
4 import org.slf4j.Logger;
5 import org.slf4j.LoggerFactory;
6
7
8
9
10
11
12 public class Base {
13
14 private static Logger LOG = LoggerFactory.getLogger(Base.class);
15
16 private static String descriptorList = "base-context.xml;extender-context.xml";
17
18 public static void main(String... args) {
19 String customContextFiles = "";
20 for (String customContext : args) {
21 if (Base.class.getClassLoader().getResource(customContext) != null) {
22 customContextFiles += customContext + ";";
23 } else {
24 LOG.warn("Did not find {} on the classpath.", customContext);
25 }
26 }
27 descriptorList = customContextFiles + descriptorList;
28
29 try {
30 LOG.info("Starting base application with descriptor list:\n{}", descriptorList);
31 Main.main("-ac", descriptorList);
32 } catch (Exception e) {
33 LOG.error("An error occurred", e);
34 } finally {
35 LOG.info("Shutdown");
36 }
37 }
38 }