org.objectweb.petals.tools.rmi.server.remote.implementations
Class RemoteComponentContextImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.objectweb.petals.tools.rmi.server.remote.implementations.RemoteComponentContextImpl
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, RemoteComponentContext

public class RemoteComponentContextImpl
extends java.rmi.server.UnicastRemoteObject
implements RemoteComponentContext

The RMI implementation of component context.

Author:
nsalatge
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RemoteComponentContextImpl(javax.jbi.component.ComponentContext c, RemoteDeliveryChannel dl)
          the constructor.
 
Method Summary
 javax.jbi.servicedesc.ServiceEndpoint activateEndpoint(javax.xml.namespace.QName interfaceName, javax.xml.namespace.QName serviceName, java.lang.String endpointName)
          Activates the named endpoint with the NMR.
 void deactivateEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
          Deactivates the given endpoint with the NMR.
 void deregisterExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
          Deregisters the given external endpoint with the NMR.
 java.lang.String getComponentName()
          Get the unique component name of this component, as assigned by the identification section of this component's installation descriptor.
 RemoteDeliveryChannel getDeliveryChannel()
          Get a channel for this component to use to communicate with the Normalized Message Router.
 javax.jbi.servicedesc.ServiceEndpoint getEndpoint(javax.xml.namespace.QName service, java.lang.String name)
          Get the service endpoint for the named activated endpoint, if any.
 org.w3c.dom.Document getEndpointDescriptor(javax.jbi.servicedesc.ServiceEndpoint endpoint)
          TODO getEndpointDescriptor works only with implementation InternalEndpoint Retrieve the service description metadata for the specified endpoint.
 javax.jbi.servicedesc.ServiceEndpoint[] getEndpoints(javax.xml.namespace.QName interfaceName)
          Queries the NMR for active endpoints that implement the given interface.
 javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForService(javax.xml.namespace.QName serviceName)
          Queries the NMR for active endpoints belonging to the given service.
 javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpoints(javax.xml.namespace.QName interfaceName)
          Queries the NMR for external endpoints that implement the given interface name.
 javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForService(javax.xml.namespace.QName serviceName)
          Queries the NMR for external endpoints that are part of the given service.
 java.lang.String getInstallRoot()
          Get the installation root directory path for this component.
 java.util.logging.Logger getLogger(java.lang.String suffix, java.lang.String resourceBundleName)
          TODO getLogger return a simple Logger, not integrated to the platform Get a logger instance from JBI.
 javax.jbi.management.MBeanNames getMBeanNames()
          Get a reference to the MBeanNames creator for use in creating custom MBean names.
 javax.management.MBeanServer getMBeanServer()
          Get the JMX MBean server used to register all MBeans in the JBI environment.
 javax.naming.InitialContext getNamingContext()
          TODO getNamingContext not integrated Get the JNDI naming context for this component.
 org.w3c.dom.Document getOwnedEndpointDescriptor(java.lang.String endpointName)
          Get the generated WSDL matching the endpoint activated from the component.
 java.lang.Object getTransactionManager()
          TODO getTransactionManager not integrated Get the TransactionManager for this implementation.
 java.lang.String getWorkspaceRoot()
          Get the root directory path for this component's private workspace.
 void registerExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
          Registers the given external endpoint with the NMR.
 javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(org.w3c.dom.DocumentFragment epr)
          Resolve the given endpoint reference into a service endpoint.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteComponentContextImpl

public RemoteComponentContextImpl(javax.jbi.component.ComponentContext c,
                                  RemoteDeliveryChannel dl)
                           throws java.rmi.RemoteException
the constructor.

Parameters:
c - the component context
dl - the rmi delivery channel
Throws:
java.rmi.RemoteException - impossbile to realize a rmi access
Method Detail

activateEndpoint

public javax.jbi.servicedesc.ServiceEndpoint activateEndpoint(javax.xml.namespace.QName interfaceName,
                                                              javax.xml.namespace.QName serviceName,
                                                              java.lang.String endpointName)
                                                       throws javax.jbi.JBIException,
                                                              java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Activates the named endpoint with the NMR. Activation indicates to the NMR that this component is ready to process requests sent to the named endpoint.

Note that the JBI implementation may call this component's Component#getServiceDescription(ServiceEndpoint) method before returning from this method call; the component's implementation must be ready to supply service description metadata before the result of this activation call (a ServiceEndpoint) is known.

Specified by:
activateEndpoint in interface RemoteComponentContext
Parameters:
interfaceName - qualified name of the interface the endpoint exposes; must be non-null.
serviceName - qualified name of the service the endpoint exposes; must be non-null.
endpointName - the name of the endpoint to be activated; must be non-null and non-empty.
Returns:
a reference to the activated endpoint; must be non-null.
Throws:
javax.jbi.JBIException - if the endpoint cannot be activated.
java.rmi.RemoteException - impossible to realize a remote access

deactivateEndpoint

public void deactivateEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
                        throws javax.jbi.JBIException,
                               java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Deactivates the given endpoint with the NMR. Deactivation indicates to the NMR that this component will no longer process requests sent to the named endpoint.

Specified by:
deactivateEndpoint in interface RemoteComponentContext
Parameters:
endpoint - reference to the endpoint to be deactivated; must be non-null.
Throws:
javax.jbi.JBIException - if the endpoint cannot be deactivated.
java.rmi.RemoteException - impossible to realize a remote access

deregisterExternalEndpoint

public void deregisterExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
                                throws javax.jbi.JBIException,
                                       java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
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.

Specified by:
deregisterExternalEndpoint in interface RemoteComponentContext
Parameters:
externalEndpoint - the external endpoint to be deregistered; must be non-null.
Throws:
javax.jbi.JBIException - if the given external endpoint was not previously registered.
java.rmi.RemoteException - impossible to realize a remote access

getComponentName

public java.lang.String getComponentName()
                                  throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Get the unique component name of this component, as assigned by the identification section of this component's installation descriptor.

Specified by:
getComponentName in interface RemoteComponentContext
Returns:
the component name; must be non-null and non-empty.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getDeliveryChannel

public RemoteDeliveryChannel getDeliveryChannel()
                                         throws javax.jbi.messaging.MessagingException,
                                                java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Get a channel for this component to use to communicate with the Normalized Message Router. This channel must be used by the component to send and receive message exchanges.

Specified by:
getDeliveryChannel in interface RemoteComponentContext
Returns:
the delivery channel for this component; must be non-null.
Throws:
javax.jbi.messaging.MessagingException - if a channel has already been opened, but not yet closed.
java.rmi.RemoteException - impossible to realize a remote access

getEndpoint

public javax.jbi.servicedesc.ServiceEndpoint getEndpoint(javax.xml.namespace.QName service,
                                                         java.lang.String name)
                                                  throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Get the service endpoint for the named activated endpoint, if any.

Specified by:
getEndpoint in interface RemoteComponentContext
Parameters:
service - qualified-name of the endpoint's service; must be non-null.
name - name of the endpoint; must be non-null.
Returns:
the named endpoint, or null if the named endpoint is not activated.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getEndpointDescriptor

public org.w3c.dom.Document getEndpointDescriptor(javax.jbi.servicedesc.ServiceEndpoint endpoint)
                                           throws javax.jbi.JBIException,
                                                  java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
TODO getEndpointDescriptor works only with implementation InternalEndpoint Retrieve the service description metadata for the specified endpoint.

Note that the result can use either the WSDL 1.1 or WSDL 2.0 description language.

Specified by:
getEndpointDescriptor in interface RemoteComponentContext
Parameters:
endpoint - endpoint reference; must be non-null.
Returns:
metadata describing endpoint, or null if metadata is unavailable.
Throws:
javax.jbi.JBIException - invalid endpoint reference.
java.rmi.RemoteException - impossible to realize a remote access

getEndpoints

public javax.jbi.servicedesc.ServiceEndpoint[] getEndpoints(javax.xml.namespace.QName interfaceName)
                                                     throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Queries the NMR for active endpoints that implement the given interface. 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 (those registered using RemoteComponentContext.registerExternalEndpoint(ServiceEndpoint).

Specified by:
getEndpoints in interface RemoteComponentContext
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:
ServiceEndpoint[] an array of available endpoints for the specified interface name; must be non-null; may be empty.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getEndpointsForService

public javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForService(javax.xml.namespace.QName serviceName)
                                                               throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Queries the NMR for active endpoints belonging to the given service. This method does NOT include external endpoints (those registered using RemoteComponentContext.registerExternalEndpoint(ServiceEndpoint).

Specified by:
getEndpointsForService in interface RemoteComponentContext
Parameters:
serviceName - qualified name of the service that the endpoints are part of; must be non-null.
Returns:
ServiceEndpoint[] array of available endpoints for the specified an array of available endpoints for the specified service name; must be non-null; may be empty.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getExternalEndpoints

public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpoints(javax.xml.namespace.QName interfaceName)
                                                             throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Queries the NMR for external endpoints that implement the given interface name. This methods returns only registered external endpoints (see RemoteComponentContext.registerExternalEndpoint(ServiceEndpoint).

Specified by:
getExternalEndpoints in interface RemoteComponentContext
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.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getExternalEndpointsForService

public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForService(javax.xml.namespace.QName serviceName)
                                                                       throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Queries the NMR for external endpoints that are part of the given service.

Specified by:
getExternalEndpointsForService in interface RemoteComponentContext
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.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getInstallRoot

public java.lang.String getInstallRoot()
                                throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Get the installation root directory path for this component.

This method MUST return the file path formatted for the underlying platform.

Specified by:
getInstallRoot in interface RemoteComponentContext
Returns:
the installation root directory path, in platform-specific form; must be non-null and non-empty.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getLogger

public java.util.logging.Logger getLogger(java.lang.String suffix,
                                          java.lang.String resourceBundleName)
                                   throws javax.jbi.JBIException,
                                          java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
TODO getLogger return a simple Logger, not integrated to the platform Get a logger instance from JBI. Loggers supplied by JBI are guaranteed to have unique names such that they avoid name collisions with loggers from other components created using this method. The suffix parameter allows for the creation of subloggers as needed. The JBI specification says nothing about the exact names to be used, only that they must be unique across components and the JBI implementation itself.

Specified by:
getLogger in interface RemoteComponentContext
Parameters:
suffix - for creating subloggers; use an empty string for the base component logger; must be non-null.
resourceBundleName - name of ResourceBundle to be used for localizing messages for the logger. May be null if none of the messages require localization. The resource, if non-null, must be loadable using the component's class loader as the initiating loader.
Returns:
a standard logger, named uniquely for this component (plus the given suffix, if applicable); must be non-null.
Throws:
javax.jbi.JBIException - if the resourceBundleName has changed from a previous invocation by this component of this method with the same suffix.
java.rmi.RemoteException - impossible to realize a remote access

getMBeanNames

public javax.jbi.management.MBeanNames getMBeanNames()
                                              throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Get a reference to the MBeanNames creator for use in creating custom MBean names.

Specified by:
getMBeanNames in interface RemoteComponentContext
Returns:
reference to the MBeanNames creator; must be non-null.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getMBeanServer

public javax.management.MBeanServer getMBeanServer()
                                            throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Get the JMX MBean server used to register all MBeans in the JBI environment.

Specified by:
getMBeanServer in interface RemoteComponentContext
Returns:
a reference to the MBean server; must be non-null.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getNamingContext

public javax.naming.InitialContext getNamingContext()
                                             throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
TODO getNamingContext not integrated Get the JNDI naming context for this component. This context is a standard JNDI InitialContext but its content will vary based on the environment in which the JBI implementation is running.

Specified by:
getNamingContext in interface RemoteComponentContext
Returns:
the JNDI naming context; must be non-null.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getTransactionManager

public java.lang.Object getTransactionManager()
                                       throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
TODO getTransactionManager not integrated Get the TransactionManager for this implementation. The instance returned is an implementation of the standard JTA interface. If none is available, this method returns null.

The object returned by this method is untyped, to allow this interface to be compiled in environments that do not support JTA. If not null, the object returned must be of type javax.transaction.TransactionManager.

This downcast is necessary because JBI is used in environments that do not support JTA (i.e., J2SE). Explicit use of JTA types would cause compilation failures in such environments.

Specified by:
getTransactionManager in interface RemoteComponentContext
Returns:
A TransactionManager instance, or null if none is available in the execution environment.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getWorkspaceRoot

public java.lang.String getWorkspaceRoot()
                                  throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Get the root directory path for this component's private workspace.

This method MUST return the file path formatted for the underlying platform.

The returned value must indicate a valid file path that the component may use to write files to, and read files from.

Specified by:
getWorkspaceRoot in interface RemoteComponentContext
Returns:
the private workspace root path, in platform-specific form; must be non-null and non-empty.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

registerExternalEndpoint

public void registerExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
                              throws javax.jbi.JBIException,
                                     java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
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).

Specified by:
registerExternalEndpoint in interface RemoteComponentContext
Parameters:
externalEndpoint - the external endpoint to be registered, must be non-null.
Throws:
javax.jbi.JBIException - if an external endpoint with the same name is already registered, by this or another component.
java.rmi.RemoteException - impossible to realize a remote access

resolveEndpointReference

public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(org.w3c.dom.DocumentFragment epr)
                                                               throws java.rmi.RemoteException
Description copied from interface: RemoteComponentContext
Resolve the given endpoint reference into a service endpoint. This is called by the component when it has an EPR that it wants to resolve into a service endpoint.

Note that the service endpoint returned refers to a dynamic endpoint; the endpoint will exist only as long as this component retains a strong reference to the object returned by this method. The endpoint may not be included in the list of "activated" endpoints.

Specified by:
resolveEndpointReference in interface RemoteComponentContext
Parameters:
epr - endpoint reference as an XML fragment; must be non-null.
Returns:
the service endpoint corresponding to the given endpoint reference; null if the reference cannot be resolved.
Throws:
java.rmi.RemoteException - impossible to realize a remote access

getOwnedEndpointDescriptor

public org.w3c.dom.Document getOwnedEndpointDescriptor(java.lang.String endpointName)
Get the generated WSDL matching the endpoint activated from the component.

Parameters:
endpointName -


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.