use of org.wso2.carbon.bpel.common.config.EndpointConfiguration 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.common.config.EndpointConfiguration in project carbon-business-process by wso2.
the class TaskConfiguration method initEndpointConfigs.
private void initEndpointConfigs() throws HumanTaskDeploymentException {
if (taskDeploymentConfiguration == null) {
throw new HumanTaskDeploymentException("Cannot find task deployment configuration.");
}
if (taskDeploymentConfiguration.getPublish() == null || taskDeploymentConfiguration.getPublish().getService() == null) {
throw new HumanTaskDeploymentException("Cannot find publish element in the htconfig.xml file.");
}
TPublish.Service service = taskDeploymentConfiguration.getPublish().getService();
OMElement serviceEle;
serviceEle = HumanTaskStoreUtils.getOMElement(service.toString());
EndpointConfiguration endpointConfig = HumanTaskStoreUtils.getEndpointConfig(serviceEle);
if (endpointConfig != null) {
endpointConfig.setServiceName(service.getName().getLocalPart());
endpointConfig.setServicePort(service.getPort());
endpointConfig.setServiceNS(service.getName().getNamespaceURI());
endpointConfig.setBasePath(getHumanTaskDefinitionFile().getParentFile().getAbsolutePath());
endpointConfig.setServiceDescriptionLocation(service.getServiceDescriptionReference());
addEndpointConfiguration(endpointConfig);
}
if (taskDeploymentConfiguration.getCallback() == null || taskDeploymentConfiguration.getCallback().getService() == null) {
throw new HumanTaskDeploymentException("Cannot find callback element in the htconfig.xml file.");
}
TCallback.Service cbService = taskDeploymentConfiguration.getCallback().getService();
serviceEle = HumanTaskStoreUtils.getOMElement(cbService.toString());
endpointConfig = HumanTaskStoreUtils.getEndpointConfig(serviceEle);
if (endpointConfig != null) {
endpointConfig.setServiceName(cbService.getName().getLocalPart());
endpointConfig.setServicePort(cbService.getPort());
endpointConfig.setServiceNS(cbService.getName().getNamespaceURI());
endpointConfig.setBasePath(getHumanTaskDefinitionFile().getParentFile().getAbsolutePath());
endpointConfig.setServiceDescriptionLocation(cbService.getServiceDescriptionReference());
addEndpointConfiguration(endpointConfig);
}
}
use of org.wso2.carbon.bpel.common.config.EndpointConfiguration in project carbon-business-process by wso2.
the class ProcessConfigurationImpl method getEndpointConfiguration.
public EndpointConfiguration getEndpointConfiguration(EndpointReference endpointReference) {
/**
* Previously ode used getEndpointProperties method to access endpoint properties.
* With new config mechanism, I changed the way that integration layer access endpoint
* configuration. But BPEL engine is using old method even now.
*/
final Map map = eprContext.getConfigLookup(endpointReference);
final QName service = (QName) map.get("service");
final String port = (String) map.get("port");
EndpointConfiguration endpointConfig = null;
if (bpelPackageConfiguration != null) {
MultiKeyMap endpointConfigs = bpelPackageConfiguration.getEndpoints();
if (endpointConfigs.size() > 0) {
endpointConfig = (EndpointConfiguration) endpointConfigs.get(service.getLocalPart(), service.getNamespaceURI(), port);
if (endpointConfig == null) {
endpointConfig = (EndpointConfiguration) endpointConfigs.get(service.getLocalPart(), service.getNamespaceURI(), null);
}
}
}
if (endpointConfig == null) {
endpointConfig = new EndpointConfiguration();
endpointConfig.setServiceName(service.getLocalPart());
endpointConfig.setServicePort(port);
endpointConfig.setServiceNS(service.getNamespaceURI());
UnifiedEndpoint uep = new UnifiedEndpoint();
uep.setUepId(service.getLocalPart());
uep.setAddressingEnabled(true);
uep.setAddressingVersion(UnifiedEndpointConstants.ADDRESSING_VERSION_FINAL);
bpelPackageConfiguration.addEndpoint(endpointConfig);
}
return endpointConfig;
}
use of org.wso2.carbon.bpel.common.config.EndpointConfiguration in project carbon-business-process by wso2.
the class ProcessConfigurationImpl method getEndpointProperties.
public Map<String, String> getEndpointProperties(EndpointReference endpointReference) {
/**
* This method is only there to use by ODEProcess#getTimeout method. Because we can't change
* internals of ODE we have to make our configuration mechanism transparent to ODE.
* Therefore I only added mex.timeout property to map and returned it here. If there are
* more properties like this which use by BPEL engine we have to make our configuration
* mechanism transparent and add that property to this map.
*/
EndpointConfiguration epConf = null;
final Map map = eprContext.getConfigLookup(endpointReference);
final QName service = (QName) map.get("service");
final String port = (String) map.get("port");
if (log.isDebugEnabled()) {
log.debug("Looking Endpoint configuration properties for service: " + service + " and port: " + port);
}
if (bpelPackageConfiguration != null) {
epConf = (EndpointConfiguration) bpelPackageConfiguration.getEndpoints().get(service.getLocalPart(), service.getNamespaceURI(), port);
}
HashMap<String, String> props = new HashMap<String, String>();
if (epConf != null) {
props.put(BPELConstants.ODE_MEX_TIMEOUT, epConf.getMexTimeout());
}
return props;
}
use of org.wso2.carbon.bpel.common.config.EndpointConfiguration in project carbon-business-process by wso2.
the class PartnerService method initUEP.
private void initUEP() throws AxisFault {
EndpointConfiguration endpointConf = ((ProcessConfigurationImpl) processConfiguration).getEndpointConfiguration(new WSDL11Endpoint(this.serviceName, portName));
if (endpointConf == null) {
uep = new UnifiedEndpoint();
uep.setUepId(this.serviceName.getLocalPart());
uep.setAddressingEnabled(true);
uep.setAddressingVersion(UnifiedEndpointConstants.ADDRESSING_VERSION_FINAL);
} else {
uep = endpointConf.getUnifiedEndpoint();
}
}
Aggregations