use of org.wso2.carbon.bpel.core.ode.integration.BPELServer in project carbon-business-process by wso2.
the class BPELPackageManagementServiceSkeleton method getTenantProcessStore.
private TenantProcessStoreImpl getTenantProcessStore() {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
BPELServerImpl bpelServer = BPELServerImpl.getInstance();
return (TenantProcessStoreImpl) bpelServer.getMultiTenantProcessStore().getTenantsProcessStore(tenantId);
}
use of org.wso2.carbon.bpel.core.ode.integration.BPELServer in project carbon-business-process by wso2.
the class BPELDeployer method init.
public void init(ConfigurationContext configurationContext) {
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
log.info("Initializing BPEL Deployer for tenant " + tenantId + ".");
File bpelRepo = null;
try {
BPELDeployerServiceComponent.getTenantRegistryLoader().loadTenantRegistry(tenantId);
bpelRepo = createBPELRepository(configurationContext);
} catch (DeploymentException e) {
log.warn("BPEL repository creation failed.", e);
} catch (RegistryException e) {
log.warn("Initialization of tenant process store failed for tenant: " + tenantId + " This can cause issues in deployment of BPEL packages.", e);
}
BPELServer bpsServer = BPELDeployerServiceComponent.getBPELServer();
tenantProcessStore = bpsServer.getMultiTenantProcessStore().createProcessStoreForTenant(configurationContext);
tenantProcessStore.setBpelArchiveRepo(bpelRepo);
configurationContext.setProperty(HTTPConstants.MULTITHREAD_HTTP_CONNECTION_MANAGER, bpsServer.getHttpConnectionManager());
try {
tenantProcessStore.init();
} catch (Exception re) {
log.warn("Initialization of tenant process store failed for tenant: " + tenantId + " This can cause issues in deployment of BPEL packages.", re);
}
}
use of org.wso2.carbon.bpel.core.ode.integration.BPELServer in project carbon-business-process by wso2.
the class BPELBindingContextImpl method publishAxisService.
private BPELProcessProxy publishAxisService(ProcessConf processConfiguration, QName serviceName, String portName) throws AxisFault {
// TODO: Need to fix this to suite multi-tenant environment
// TODO: There is a problem in this, in this manner we can't have two axis services with
// same QName
BPELProcessProxy processProxy = new BPELProcessProxy(processConfiguration, bpelServer, serviceName, portName);
ConfigurationContext tenantConfigCtx = getConfigurationContextFromProcessConfiguration(processConfiguration);
AxisService axisService;
try {
axisService = AxisServiceUtils.createAxisService(tenantConfigCtx.getAxisConfiguration(), processProxy);
EndpointConfiguration endpointConfig = ((ProcessConfigurationImpl) processConfiguration).getEndpointConfiguration(new WSDL11Endpoint(serviceName, portName));
ServiceConfigurationUtil.configureService(axisService, endpointConfig, tenantConfigCtx);
} catch (AxisFault e) {
log.error("Error occurred creating the axis service " + serviceName.toString());
throw new DeploymentException("BPEL Package deployment failed.", e);
}
processProxy.setAxisService(axisService);
removeBPELProcessProxyAndAxisService(processConfiguration.getDeployer(), serviceName, portName);
services.put(processConfiguration.getDeployer(), serviceName, portName, processProxy);
ArrayList<AxisService> serviceList = new ArrayList<AxisService>();
serviceList.add(axisService);
DeploymentEngine.addServiceGroup(createServiceGroupForService(axisService), serviceList, null, null, tenantConfigCtx.getAxisConfiguration());
//
if (log.isDebugEnabled()) {
log.debug("BPELProcessProxy created for process " + processConfiguration.getProcessId());
log.debug("AxisService " + serviceName + " created for BPEL process " + processConfiguration.getProcessId());
}
return processProxy;
}
use of org.wso2.carbon.bpel.core.ode.integration.BPELServer in project carbon-business-process by wso2.
the class Processes method getProcessStates.
public String[] getProcessStates() {
BPELServer bpelServer = BPELServiceComponent.getBPELServer();
processStore = bpelServer.getMultiTenantProcessStore();
int processCount = ((ProcessStoreImpl) processStore).getProcesses().size();
String[] processStates = new String[processCount];
if (processCount != 0) {
for (int i = 0; i < processCount; i++) {
StringBuffer buffer = new StringBuffer();
buffer.append(((ProcessStoreImpl) processStore).getProcesses().get(i).getLocalPart().toString());
buffer.append(" State-");
buffer.append(((ProcessStoreImpl) processStore).getProcessConfiguration(((ProcessStoreImpl) processStore).getProcesses().get(i)).getState().toString());
processStates[i] = buffer.toString();
}
}
return processStates;
}
use of org.wso2.carbon.bpel.core.ode.integration.BPELServer in project carbon-business-process by wso2.
the class Utils method dbexec.
/**
* Execute a database transaction, unwrapping nested
* {@link org.apache.ode.bpel.pmapi.ManagementException}s.
*
* @param callable action to run
* @return object of type T
* @throws org.apache.ode.bpel.pmapi.ManagementException if exception occurred during transaction
*/
private static <T> T dbexec(BpelDatabase.Callable<T> callable) throws ManagementException {
try {
BPELServerImpl bpelServer = (BPELServerImpl) BPELServiceComponent.getBPELServer();
BpelDatabase bpelDb = bpelServer.getODEBPELServer().getBpelDb();
return bpelDb.exec(callable);
} catch (ManagementException me) {
// Passthrough.
throw me;
} catch (Exception ex) {
log.error("Exception during database operation", ex);
throw new ManagementException("Exception during database operation", ex);
}
}
Aggregations