use of org.wso2.carbon.bpmn.core.integration.BPMNEngineWaitBeforeShutdownObserver in project carbon-business-process by wso2.
the class BPMNServiceComponent method activate.
protected void activate(ComponentContext ctxt) {
log.info("Initializing the BPMN core component...");
try {
BundleContext bundleContext = ctxt.getBundleContext();
BPMNServerHolder holder = BPMNServerHolder.getInstance();
ActivitiEngineBuilder activitiEngineBuilder = new ActivitiEngineBuilder();
holder.setEngine(activitiEngineBuilder.buildEngine());
holder.setTenantManager(new TenantManager());
/*BPMNRestExtensionHolder restHolder = BPMNRestExtensionHolder.getInstance();
restHolder.setRestInvoker(new RESTInvoker());*/
BPMNEngineServiceImpl bpmnEngineService = new BPMNEngineServiceImpl();
bpmnEngineService.setProcessEngine(ActivitiEngineBuilder.getProcessEngine());
bundleContext.registerService(BPMNEngineService.class, bpmnEngineService, null);
bundleContext.registerService(ServerStartupObserver.class.getName(), new BPMNEngineServerStartupObserver(), null);
bundleContext.registerService(WaitBeforeShutdownObserver.class, new BPMNEngineWaitBeforeShutdownObserver(), null);
// DataSourceHandler dataSourceHandler = new DataSourceHandler();
// dataSourceHandler.initDataSource(activitiEngineBuilder.getDataSourceJndiName());
// dataSourceHandler.closeDataSource();
// } catch (BPMNMetaDataTableCreationException e) {
// log.error("Could not create BPMN checksum table", e);
// } catch (DatabaseConfigurationException e) {
// log.error("Could not create BPMN checksum table", e);
} catch (Throwable e) {
log.error("Failed to initialize the BPMN core component.", e);
}
}
Aggregations