org.apache.servicemix.jbi.framework
Class EndpointRegistry

java.lang.Object
  extended by org.apache.servicemix.jbi.framework.EndpointRegistry

public class EndpointRegistry
extends Object

Registry for Components

Version:
$Revision: 564900 $

Constructor Summary
EndpointRegistry(Registry registry)
          Constructor
 
Method Summary
protected  javax.jbi.servicedesc.ServiceEndpoint[] asEndpointArray(Collection<javax.jbi.servicedesc.ServiceEndpoint> collection)
          Helper method to convert the given collection into an array of endpoints
protected  void fireEvent(javax.jbi.servicedesc.ServiceEndpoint ep, int type)
           
 javax.jbi.servicedesc.ServiceEndpoint[] getAllEndpointsForComponent(ComponentNameSpace cns)
           
 javax.jbi.servicedesc.ServiceEndpoint getEndpoint(QName service, String name)
          Get the named ServiceEndpoint, if activated
 Collection<Endpoint> getEndpointMBeans()
          Returns a collection of Endpoint objects
protected  Collection<javax.jbi.servicedesc.ServiceEndpoint> getEndpointsByInterface(QName interfaceName, Collection<javax.jbi.servicedesc.ServiceEndpoint> endpoints)
          Filters the given endpoints and returns those implementing the given interface name.
protected  Collection<javax.jbi.servicedesc.ServiceEndpoint> getEndpointsByService(QName serviceName, Collection<javax.jbi.servicedesc.ServiceEndpoint> endpoints)
          return a collection of endpoints
 javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForComponent(ComponentNameSpace cns)
           
 javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForInterface(QName interfaceName)
          This will return the endpoints for all services and endpoints that implement the named interface (portType in WSDL 1.1).
 javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForService(QName serviceName)
          Get all endpoints for a given service
protected  Collection<javax.jbi.servicedesc.ServiceEndpoint> getExternalEndpoints()
           
 javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForInterface(QName interfaceName)
          This methods returns only registered external endpoints
 javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForService(QName serviceName)
          Get external endpoints for the service
 javax.jbi.servicedesc.ServiceEndpoint getInternalEndpoint(QName service, String name)
           
protected  Collection<javax.jbi.servicedesc.ServiceEndpoint> getInternalEndpoints()
           
 void registerEndpointConnection(QName fromSvc, String fromEp, QName toSvc, String toEp, String link)
          Registers an endpoint connection.
 void registerExternalEndpoint(ComponentNameSpace cns, javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
          Registers the given external endpoint with the NMR.
 void registerInterfaceConnection(QName fromItf, QName toSvc, String toEp)
          Registers an interface connection.
 InternalEndpoint registerInternalEndpoint(ComponentContextImpl provider, QName serviceName, String endpointName)
          Activate an endpoint
 void registerRemoteEndpoint(InternalEndpoint remote)
          Registers a remote endpoint
 void unregisterEndpointConnection(QName fromSvc, String fromEp)
          Unregister an endpoint connection.
 void unregisterExternalEndpoint(ComponentNameSpace cns, javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
          Deregisters the given external endpoint with the NMR.
 void unregisterInterfaceConnection(QName fromItf)
          Unregisters an interface connection.
 void unregisterInternalEndpoint(javax.jbi.component.ComponentContext provider, InternalEndpoint serviceEndpoint)
          Called by component context when endpoints are being deactivated.
 void unregisterRemoteEndpoint(InternalEndpoint remote)
          Unregisters a remote endpoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndpointRegistry

public EndpointRegistry(Registry registry)
Constructor

Parameters:
cr -
Method Detail

getEndpointsForComponent

public javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForComponent(ComponentNameSpace cns)

getAllEndpointsForComponent

public javax.jbi.servicedesc.ServiceEndpoint[] getAllEndpointsForComponent(ComponentNameSpace cns)

getEndpointMBeans

public Collection<Endpoint> getEndpointMBeans()
Returns a collection of Endpoint objects


getEndpointsForService

public javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForService(QName serviceName)
Get all endpoints for a given service

Parameters:
serviceName -
Returns:
array of endpoints

getEndpointsForInterface

public javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForInterface(QName interfaceName)
This will return the endpoints for all services and endpoints that implement the named interface (portType in WSDL 1.1). This method does NOT include external endpoints.

Parameters:
interfaceName - qualified name of interface/portType that is implemented by the endpoint; if null then all activated endpoints in the JBI environment must be returned.
Returns:
an array of available endpoints for the specified interface name; must be non-null; may be empty.

registerInternalEndpoint

public InternalEndpoint registerInternalEndpoint(ComponentContextImpl provider,
                                                 QName serviceName,
                                                 String endpointName)
                                          throws javax.jbi.JBIException
Activate an endpoint

Parameters:
provider -
serviceName -
endpointName -
Returns:
the endpoint
Throws:
javax.jbi.JBIException

unregisterInternalEndpoint

public void unregisterInternalEndpoint(javax.jbi.component.ComponentContext provider,
                                       InternalEndpoint serviceEndpoint)
Called by component context when endpoints are being deactivated.

Parameters:
provider -
serviceEndpoint -

registerRemoteEndpoint

public void registerRemoteEndpoint(InternalEndpoint remote)
Registers a remote endpoint

Parameters:
remote -

unregisterRemoteEndpoint

public void unregisterRemoteEndpoint(InternalEndpoint remote)
Unregisters a remote endpoint

Parameters:
remote -

getEndpoint

public javax.jbi.servicedesc.ServiceEndpoint getEndpoint(QName service,
                                                         String name)
Get the named ServiceEndpoint, if activated

Parameters:
service -
name -
Returns:
the activated ServiceEndpoint or null

getInternalEndpoint

public javax.jbi.servicedesc.ServiceEndpoint getInternalEndpoint(QName service,
                                                                 String name)

registerExternalEndpoint

public void registerExternalEndpoint(ComponentNameSpace cns,
                                     javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
                              throws javax.jbi.JBIException
Registers the given external endpoint with the NMR. This indicates to the NMR that the given endpoint is used as a proxy for external service consumers to access an internal service of the same service name (but a different endpoint name).

Parameters:
provider -
externalEndpoint - the external endpoint to be registered, must be non-null.
Throws:
javax.jbi.JBIException

unregisterExternalEndpoint

public void unregisterExternalEndpoint(ComponentNameSpace cns,
                                       javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
Deregisters the given external endpoint with the NMR. This indicates to the NMR that the given external endpoint can no longer be used as a proxy for external service consumers to access an internal service of the same service name.

Parameters:
provider -
externalEndpoint - the external endpoint to be deregistered; must be non-null.

getExternalEndpointsForInterface

public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForInterface(QName interfaceName)
This methods returns only registered external endpoints

Parameters:
interfaceName - qualified name of interface implemented by the endpoints; must be non-null.
Returns:
an array of available external endpoints for the specified interface name; must be non-null; may be empty.

getExternalEndpointsForService

public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForService(QName serviceName)
Get external endpoints for the service

Parameters:
serviceName - qualified name of service that contains the endpoints; must be non-null.
Returns:
an array of available external endpoints for the specified service name; must be non-null; may be empty.

asEndpointArray

protected javax.jbi.servicedesc.ServiceEndpoint[] asEndpointArray(Collection<javax.jbi.servicedesc.ServiceEndpoint> collection)
Helper method to convert the given collection into an array of endpoints

Parameters:
collection -
Returns:
array of endpoints

getEndpointsByService

protected Collection<javax.jbi.servicedesc.ServiceEndpoint> getEndpointsByService(QName serviceName,
                                                                                  Collection<javax.jbi.servicedesc.ServiceEndpoint> endpoints)
return a collection of endpoints

Parameters:
serviceName -
endpoints -
Returns:
collection of endpoints

getEndpointsByInterface

protected Collection<javax.jbi.servicedesc.ServiceEndpoint> getEndpointsByInterface(QName interfaceName,
                                                                                    Collection<javax.jbi.servicedesc.ServiceEndpoint> endpoints)
Filters the given endpoints and returns those implementing the given interface name. If interfaceName is null, then no filter is applied.


getInternalEndpoints

protected Collection<javax.jbi.servicedesc.ServiceEndpoint> getInternalEndpoints()
Returns:
all default endpoints

getExternalEndpoints

protected Collection<javax.jbi.servicedesc.ServiceEndpoint> getExternalEndpoints()
Returns:
all external endpoints

registerEndpointConnection

public void registerEndpointConnection(QName fromSvc,
                                       String fromEp,
                                       QName toSvc,
                                       String toEp,
                                       String link)
                                throws javax.jbi.JBIException
Registers an endpoint connection.

Parameters:
fromSvc -
fromEp -
toSvc -
toEp -
link -
Throws:
javax.jbi.JBIException

unregisterEndpointConnection

public void unregisterEndpointConnection(QName fromSvc,
                                         String fromEp)
Unregister an endpoint connection.

Parameters:
fromSvc -
fromEp -

registerInterfaceConnection

public void registerInterfaceConnection(QName fromItf,
                                        QName toSvc,
                                        String toEp)
                                 throws javax.jbi.JBIException
Registers an interface connection.

Parameters:
fromItf -
toSvc -
toEp -
Throws:
javax.jbi.JBIException

unregisterInterfaceConnection

public void unregisterInterfaceConnection(QName fromItf)
Unregisters an interface connection.

Parameters:
fromItf -

fireEvent

protected void fireEvent(javax.jbi.servicedesc.ServiceEndpoint ep,
                         int type)


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.