}
}
private WsmgConfigurationContext initConfigurations(ConfigurationContext configContext, AxisService axisService) {
WsmgConfigurationContext wsmgConfig = new WsmgConfigurationContext();
configContext.setProperty(WsmgCommonConstants.BROKER_WSMGCONFIG, wsmgConfig);
ConfigurationManager configMan = new ConfigurationManager("conf" + File.separator
+ WsmgCommonConstants.BROKER_CONFIGURATION_FILE_NAME);
wsmgConfig.setConfigurationManager(configMan);
String type = configMan.getConfig(WsmgCommonConstants.CONFIG_STORAGE_TYPE,
WsmgCommonConstants.STORAGE_TYPE_PERSISTANT);
/*
* Determine Storage
*/
if (WsmgCommonConstants.STORAGE_TYPE_IN_MEMORY.equalsIgnoreCase(type)) {
WsmgInMemoryStorage inmem = new WsmgInMemoryStorage();
wsmgConfig.setStorage(inmem);
wsmgConfig.setQueue(inmem);
wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, inmem));
} else {
String jdbcUrl = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_URL);
String jdbcDriver = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_DRIVER);
WsmgPersistantStorage persis = new WsmgPersistantStorage(jdbcUrl, jdbcDriver);
wsmgConfig.setStorage(persis);
wsmgConfig.setQueue(persis);
wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, persis));
}
NotificationProcessor notificatonProcessor = new NotificationProcessor(wsmgConfig);
wsmgConfig.setNotificationProcessor(notificatonProcessor);
return wsmgConfig;
}