use of com.predic8.membrane.core.MembraneCommandLine in project service-proxy by membrane.
the class CoreActivator method start.
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
if (new File("configuration/log4j.properties").exists())
PropertyConfigurator.configure("configuration/log4j.properties");
Platform.addLogListener(logListener);
final MembraneCommandLine cl = new MembraneCommandLine();
cl.parse(fixArguments(Platform.getCommandLineArgs()));
if (cl.hasConfiguration()) {
log.info("loading monitor beans from command line argument: " + getConfigurationFileName(cl));
router = Router.init(getConfigurationFileName(cl), this.getClass().getClassLoader());
} else {
try {
if (ClassloaderUtil.fileExists(getConfigurationFileName())) {
log.info("Eclipse framework found config file: " + getConfigurationFileName());
readBeanConfigWhenStartedAsProduct();
} else {
readBeanConfigWhenStartedInEclipse();
}
} catch (Exception e1) {
log.error("Unable to read bean configuration file: " + e1.getMessage());
log.error("Unable to read bean configuration file: " + e1.getStackTrace());
e1.printStackTrace();
}
}
sr = context.registerService(router.getClass().getName(), router, null);
}
Aggregations