FileDocCategorySizeDatePackage
EndpointRegistry.javaAPI DocGlassfish v2 API6611Wed Jul 18 03:45:44 BST 2007com.sun.enterprise.jbi.serviceengine.core

EndpointRegistry

public class EndpointRegistry extends Object
Registry of all ServiceEndpoints, provides mapping between EndPointName and ServiceEngineEndpoint.
author
Manisha Umbarje

Fields Summary
private ConcurrentHashMap
endpoints
Service QName to table of endpoints The key being the service name and value being table of ServiceEngineEndpoints
private ConcurrentHashMap
jbiProviders
private ConcurrentHashMap
jbiConsumers
private ConcurrentHashMap
wsdlEndpts
private ConcurrentHashMap
jbiEndpts
private Set
compApps
private Map
ws_endpoints
private static EndpointRegistry
store
Constructors Summary
private EndpointRegistry()
Creates a new instance of ServiceEndPointRegistry

    
           
      
        endpoints = new ConcurrentHashMap(11,0.75f,4);
        jbiProviders = new ConcurrentHashMap<String,DescriptorEndpointInfo>(11,0.75f,4);
        jbiConsumers = new ConcurrentHashMap<String, DescriptorEndpointInfo>(11,0.75f,4);
        wsdlEndpts = new ConcurrentHashMap<String, DescriptorEndpointInfo>(11,0.75f,4);
        jbiEndpts = new ConcurrentHashMap<String, DescriptorEndpointInfo>(11,0.75f,4);
        compApps = new HashSet<String>();
        ws_endpoints = new HashMap<String, List<WebServiceEndpoint>>();
    
Methods Summary
public voiddelete(javax.xml.namespace.QName service, java.lang.String endpointName)
Removes ServiceEndpoint from the store

        
        Map map=  (Map)endpoints.get(service);
        map.remove(endpointName);
        
    
public ServiceEngineEndpointget(javax.xml.namespace.QName service, java.lang.String endpointName)

        
        Map map=  (Map)endpoints.get(service);
        if(map != null)
        return (ServiceEngineEndpoint)map.get(endpointName);
        else
            return null;
        
    
java.util.SetgetCompApps()

        return compApps;
    
java.util.concurrent.ConcurrentHashMapgetConsumers()

        return jbiConsumers;
    
public static com.sun.enterprise.jbi.serviceengine.core.EndpointRegistrygetInstance()

        return store;
    
public java.util.concurrent.ConcurrentHashMapgetJBIEndpts()

        return jbiEndpts;
    
java.util.concurrent.ConcurrentHashMapgetProviders()
The APIs below are used by JBIEndpointManager.RegistryManager to populate the entries

        return jbiProviders;
    
public java.util.concurrent.ConcurrentHashMapgetWSDLEndpts()

        return wsdlEndpts;
    
public java.util.MapgetWSEndpoints()
The endpoints are populated by ApplicationLoaderEventListenerImpl

        return ws_endpoints;
    
public booleanhasConsumerEP(javax.xml.namespace.QName service, java.lang.String endpointName)

        DescriptorEndpointInfo ep = 
                jbiConsumers.get(service.getLocalPart() + endpointName);
        return ep !=null && ep.isStarted();
    
public booleanhasProviderEP(ServiceEngineEndpoint seEndpoint)
Check whether this endpoint is provided by any composite application.

        //if the javaee app is not deployed as part of comp app then return false
        if(!compApps.contains(seEndpoint.getApplicationName()))
            return false;
        
        QName service = seEndpoint.getServiceName();
        String endpointName = seEndpoint.getEndpointName();
        DescriptorEndpointInfo ep = 
                jbiProviders.get(service.getLocalPart() + endpointName);
        return ep !=null && ep.isStarted();
    
public java.util.Listlist()

        List<ServiceEngineEndpoint> list = new LinkedList<ServiceEngineEndpoint>();
        for (Iterator itr = endpoints.values().iterator();itr.hasNext();) {
            Hashtable table = (Hashtable) itr.next();
            list.addAll(table.values());
        }
        return list;
    
public voidput(javax.xml.namespace.QName service, java.lang.String endpointName, ServiceEngineEndpoint endpoint)
Adds a ServiceEndpoint to the store

        Map map=  (Map)endpoints.get(service);
        if(map == null) {
            map = new Hashtable();
            endpoints.put(service, map);
        }
        map.put(endpointName, endpoint);