Search in sources :

Example 6 with EndpointConfiguration

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;
}
Also used : WSDL11Endpoint(org.apache.ode.bpel.epr.WSDL11Endpoint) AxisFault(org.apache.axis2.AxisFault) ConfigurationContext(org.apache.axis2.context.ConfigurationContext) AxisService(org.apache.axis2.description.AxisService) ArrayList(java.util.ArrayList) DeploymentException(org.apache.axis2.deployment.DeploymentException) EndpointConfiguration(org.wso2.carbon.bpel.common.config.EndpointConfiguration) ProcessConfigurationImpl(org.wso2.carbon.bpel.core.ode.integration.store.ProcessConfigurationImpl)

Example 7 with EndpointConfiguration

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);
    }
}
Also used : TCallback(org.wso2.carbon.humantask.core.deployment.config.TCallback) TPublish(org.wso2.carbon.humantask.core.deployment.config.TPublish) OMElement(org.apache.axiom.om.OMElement) EndpointConfiguration(org.wso2.carbon.bpel.common.config.EndpointConfiguration) HumanTaskDeploymentException(org.wso2.carbon.humantask.core.deployment.HumanTaskDeploymentException)

Example 8 with EndpointConfiguration

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;
}
Also used : MultiKeyMap(org.apache.commons.collections.map.MultiKeyMap) QName(javax.xml.namespace.QName) UnifiedEndpoint(org.wso2.carbon.unifiedendpoint.core.UnifiedEndpoint) EndpointConfiguration(org.wso2.carbon.bpel.common.config.EndpointConfiguration) Map(java.util.Map) HashMap(java.util.HashMap) MultiKeyMap(org.apache.commons.collections.map.MultiKeyMap)

Example 9 with EndpointConfiguration

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;
}
Also used : HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) EndpointConfiguration(org.wso2.carbon.bpel.common.config.EndpointConfiguration) Map(java.util.Map) HashMap(java.util.HashMap) MultiKeyMap(org.apache.commons.collections.map.MultiKeyMap)

Example 10 with EndpointConfiguration

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();
    }
}
Also used : WSDL11Endpoint(org.apache.ode.bpel.epr.WSDL11Endpoint) UnifiedEndpoint(org.wso2.carbon.unifiedendpoint.core.UnifiedEndpoint) EndpointConfiguration(org.wso2.carbon.bpel.common.config.EndpointConfiguration) ProcessConfigurationImpl(org.wso2.carbon.bpel.core.ode.integration.store.ProcessConfigurationImpl)

Aggregations

EndpointConfiguration (org.wso2.carbon.bpel.common.config.EndpointConfiguration)11 QName (javax.xml.namespace.QName)5 OMElement (org.apache.axiom.om.OMElement)3 WSDL11Endpoint (org.apache.ode.bpel.epr.WSDL11Endpoint)3 ProcessConfigurationImpl (org.wso2.carbon.bpel.core.ode.integration.store.ProcessConfigurationImpl)3 UnifiedEndpoint (org.wso2.carbon.unifiedendpoint.core.UnifiedEndpoint)3 HashMap (java.util.HashMap)2 Map (java.util.Map)2 AxisFault (org.apache.axis2.AxisFault)2 MultiKeyMap (org.apache.commons.collections.map.MultiKeyMap)2 TPublish (org.wso2.carbon.humantask.core.deployment.config.TPublish)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)1 DeploymentException (org.apache.axis2.deployment.DeploymentException)1 AxisService (org.apache.axis2.description.AxisService)1 FaultException (org.apache.ode.bpel.common.FaultException)1 TDeployment (org.apache.ode.bpel.dd.TDeployment)1 TInvoke (org.apache.ode.bpel.dd.TInvoke)1