Example usage for org.apache.commons.collections.map MultiKeyMap size

List of usage examples for org.apache.commons.collections.map MultiKeyMap size

Introduction

In this page you can find the example usage for org.apache.commons.collections.map MultiKeyMap size.

Prototype

public int size() 

Source Link

Usage

From source file:org.wso2.carbon.bpel.core.ode.integration.store.ProcessConfigurationImpl.java

public EndpointConfiguration getEndpointConfiguration(EndpointReference endpointReference) {
    /**/*from   w  w w . j  a  va2  s.c  om*/
     * 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;
}