use of org.wso2.carbon.humantask.core.engine.commands.Activate 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);
}
}
use of org.wso2.carbon.humantask.core.engine.commands.Activate in project carbon-business-process by wso2.
the class BPMNAppDeployerDSComponent method activate.
protected void activate(ComponentContext ctxt) {
try {
// register bpmn deployer as an OSGi Service
BPMNAppDeployer BPMNAppDeployer = new BPMNAppDeployer();
appHandlerRegistration = ctxt.getBundleContext().registerService(AppDeploymentHandler.class.getName(), BPMNAppDeployer, null);
// read required-features.xml
URL reqFeaturesResource = ctxt.getBundleContext().getBundle().getResource(AppDeployerConstants.REQ_FEATURES_XML);
if (reqFeaturesResource != null) {
InputStream xmlStream = reqFeaturesResource.openStream();
requiredFeatures = AppDeployerUtils.readRequiredFeaturs(new StAXOMBuilder(xmlStream).getDocumentElement());
}
} catch (Throwable e) {
log.error("Failed to activate BPMN Application Deployer", e);
}
}
use of org.wso2.carbon.humantask.core.engine.commands.Activate in project carbon-business-process by wso2.
the class HumanTaskAppDeployerDSComponent method activate.
protected void activate(ComponentContext ctxt) {
try {
// register humantask deployer as an OSGi Service
HumanTaskAppDeployer humanTaskAppDeployer = new HumanTaskAppDeployer();
appHandlerRegistration = ctxt.getBundleContext().registerService(AppDeploymentHandler.class.getName(), humanTaskAppDeployer, null);
// read required-features.xml
URL reqFeaturesResource = ctxt.getBundleContext().getBundle().getResource(AppDeployerConstants.REQ_FEATURES_XML);
if (reqFeaturesResource != null) {
InputStream xmlStream = reqFeaturesResource.openStream();
requiredFeatures = AppDeployerUtils.readRequiredFeaturs(new StAXOMBuilder(xmlStream).getDocumentElement());
}
} catch (Throwable e) {
log.error("Failed to activate HumanTask Application Deployer", e);
}
}
use of org.wso2.carbon.humantask.core.engine.commands.Activate in project carbon-business-process by wso2.
the class BPELBindingContextImpl method activateMyRoleEndpoint.
public EndpointReference activateMyRoleEndpoint(QName processId, Endpoint myRoleEndpoint) {
try {
if (log.isDebugEnabled()) {
log.debug("Activating MyRole endpoint for process: " + processId + " endpoint: " + myRoleEndpoint);
}
ProcessConf processConfiguration = ((ProcessStore) bpelServer.getMultiTenantProcessStore()).getProcessConfiguration(processId);
BPELProcessProxy processProxy = publishAxisService(processConfiguration, myRoleEndpoint.serviceName, myRoleEndpoint.portName);
serviceEprMap.put(processProxy, processProxy.getServiceReference());
updateServiceList(getTenantId(processId), myRoleEndpoint, STATE.ADD);
return processProxy.getServiceReference();
} catch (AxisFault af) {
final String errMsg = "Could not activate endpoint for service " + myRoleEndpoint.serviceName + " and port " + myRoleEndpoint.portName;
log.error(errMsg, af);
throw new ContextException(errMsg, af);
}
}
use of org.wso2.carbon.humantask.core.engine.commands.Activate in project carbon-business-process by wso2.
the class BPMNExtensionsComponent method activate.
protected void activate(ComponentContext ctxt) {
BundleContext bundleContext = ctxt.getBundleContext();
RESTInvoker restInvoker = new RESTInvoker();
BPMNRestExtensionHolder.getInstance().setRestInvoker(restInvoker);
if (log.isDebugEnabled()) {
log.debug("Activated bpmn extensions component and configured rest invoker");
}
bundleContext.registerService(WaitBeforeShutdownObserver.class, new RESTClientShutdownObserver(), null);
}
Aggregations