System.out.println();
ApplicationContext context = null;
if (args.length <= 0) {
System.out.println("Loading ServiceMix from servicemix.xml on the CLASSPATH");
context = new ClassPathXmlApplicationContext("servicemix.xml");
}
else {
String file = args[0];
if (file.equals("-?") || file.equals("?") || file.equals("--help") || file.equals("-h")) {
System.out.println("Usage: Main [-v1] [xmlConfigFile]");
System.out.println("If an XML config file is not specified then servicemix.xml is used from the CLASSPATH");
return;
}
if (file.equals("-v1")) {
List processors = Arrays.asList(new Object[] { new XBeanProcessor() });
if (args.length <= 1) {
System.out.println("Loading ServiceMix (compatible 1.x) from servicemix.xml on the CLASSPATH");
context = new ClassPathXmlApplicationContext("servicemix.xml", processors);
}
else {
file = args[1];
System.out.println("Loading ServiceMix (compatible 1.x) from file: " + file);
context = new FileSystemXmlApplicationContext(file, processors);