String propertiesFile = System.getProperty("org.apache.oodt.cas.catalog.properties.file");
if (propertiesFile != null)
System.getProperties().load(new FileInputStream(propertiesFile));
String configFile = PathUtils.doDynamicReplacement(System.getProperty("org.apache.oodt.cas.catalog.server.config.file", "classpath:/org/apache/oodt/cas/catalog/config/catserv-server-config.xml"));
FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[] { configFile }, false);
appContext.setClassLoader(new Serializer().getClassLoader());
appContext.refresh();
List<CmdLineOptionInstance> optionInstances = CmdLineOptionUtils.loadValidateAndHandleInstances(appContext, args);
CmdLineOptionInstance instance = CmdLineOptionUtils.getOptionInstanceByName("serverFactoryBeanId", optionInstances);
CommunicationChannelServerFactory serverFactory = (CommunicationChannelServerFactory) appContext.getBean(instance.getValues().get(0), CommunicationChannelServerFactory.class);
CommunicationChannelServer communicationChannelServer = serverFactory.createCommunicationChannelServer();