Search in sources :

Example 6 with UnifiedEndpoint

use of org.wso2.carbon.unifiedendpoint.core.UnifiedEndpoint 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 7 with UnifiedEndpoint

use of org.wso2.carbon.unifiedendpoint.core.UnifiedEndpoint 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

UnifiedEndpoint (org.wso2.carbon.unifiedendpoint.core.UnifiedEndpoint)6 OMElement (org.apache.axiom.om.OMElement)4 EndpointConfiguration (org.wso2.carbon.bpel.common.config.EndpointConfiguration)3 UnifiedEndpointFactory (org.wso2.carbon.unifiedendpoint.core.UnifiedEndpointFactory)3 QName (javax.xml.namespace.QName)2 XMLStreamException (javax.xml.stream.XMLStreamException)2 AxisFault (org.apache.axis2.AxisFault)2 WSDL11Endpoint (org.apache.ode.bpel.epr.WSDL11Endpoint)2 ProcessConfigurationImpl (org.wso2.carbon.bpel.core.ode.integration.store.ProcessConfigurationImpl)2 Registry (org.wso2.carbon.registry.api.Registry)2 RegistryException (org.wso2.carbon.registry.api.RegistryException)2 Resource (org.wso2.carbon.registry.api.Resource)2 IOException (java.io.IOException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 EndpointReference (org.apache.axis2.addressing.EndpointReference)1