org.apache.servicemix.jbi.runtime.impl
Class AbstractComponentContext

java.lang.Object
  extended by org.apache.servicemix.jbi.runtime.impl.AbstractComponentContext
All Implemented Interfaces:
javax.jbi.component.ComponentContext, javax.jbi.management.MBeanNames
Direct Known Subclasses:
ClientComponentContext, ComponentContextImpl

public abstract class AbstractComponentContext
extends Object
implements javax.jbi.component.ComponentContext, javax.jbi.management.MBeanNames


Field Summary
protected  ComponentRegistryImpl componentRegistry
           
protected  javax.jbi.messaging.DeliveryChannel dc
           
static String EXTERNAL_ENDPOINT
           
static String INTERNAL_ENDPOINT
           
 
Fields inherited from interface javax.jbi.management.MBeanNames
BOOTSTRAP_EXTENSION, COMPONENT_LIFE_CYCLE_EXTENSION
 
Constructor Summary
AbstractComponentContext(ComponentRegistryImpl componentRegistry)
           
 
Method Summary
 ObjectName createCustomComponentMBeanName(String customName)
           
protected  List<Endpoint> doQueryEndpoints(Map<String,Object> props, boolean external)
           
protected  javax.jbi.servicedesc.ServiceEndpoint[] doQueryServiceEndpoints(Map<String,Object> props, boolean external)
           
 javax.jbi.messaging.DeliveryChannel getDeliveryChannel()
           
 javax.jbi.servicedesc.ServiceEndpoint getEndpoint(QName serviceName, String endpointName)
           
 Document getEndpointDescriptor(javax.jbi.servicedesc.ServiceEndpoint endpoint)
           
 javax.jbi.servicedesc.ServiceEndpoint[] getEndpoints(QName interfaceName)
           
 javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForService(QName serviceName)
           
 javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpoints(QName interfaceName)
           
 javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForService(QName serviceName)
           
 String getJmxDomainName()
           
 Logger getLogger(String suffix, String resourceBundleName)
           
 javax.jbi.management.MBeanNames getMBeanNames()
           
 MBeanServer getMBeanServer()
           
 InitialContext getNamingContext()
           
 NMR getNmr()
           
protected  javax.jbi.servicedesc.ServiceEndpoint getServiceEndpoint(Endpoint endpoint)
           
protected  QName getServiceQNameFromProperties(Map<String,?> epProps)
           
 Object getTransactionManager()
           
protected  javax.jbi.servicedesc.ServiceEndpoint[] queryExternalEndpoints(Map<String,Object> props)
           
protected  javax.jbi.servicedesc.ServiceEndpoint[] queryInternalEndpoints(Map<String,Object> props)
           
 javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(DocumentFragment epr)
           
 javax.jbi.servicedesc.ServiceEndpoint resolveInternalEPR(DocumentFragment epr)
           Resolve an internal JBI EPR conforming to the format defined in the JBI specification.
 javax.jbi.servicedesc.ServiceEndpoint resolveStandardEPR(DocumentFragment epr)
          Resolve a standard EPR understood by ServiceMix container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jbi.component.ComponentContext
activateEndpoint, deactivateEndpoint, deregisterExternalEndpoint, getComponentName, getInstallRoot, getWorkspaceRoot, registerExternalEndpoint
 

Field Detail

INTERNAL_ENDPOINT

public static final String INTERNAL_ENDPOINT
See Also:
Constant Field Values

EXTERNAL_ENDPOINT

public static final String EXTERNAL_ENDPOINT
See Also:
Constant Field Values

dc

protected javax.jbi.messaging.DeliveryChannel dc

componentRegistry

protected ComponentRegistryImpl componentRegistry
Constructor Detail

AbstractComponentContext

public AbstractComponentContext(ComponentRegistryImpl componentRegistry)
Method Detail

getNmr

public NMR getNmr()

getEndpoint

public javax.jbi.servicedesc.ServiceEndpoint getEndpoint(QName serviceName,
                                                         String endpointName)
Specified by:
getEndpoint in interface javax.jbi.component.ComponentContext

getEndpointDescriptor

public Document getEndpointDescriptor(javax.jbi.servicedesc.ServiceEndpoint endpoint)
                               throws javax.jbi.JBIException
Specified by:
getEndpointDescriptor in interface javax.jbi.component.ComponentContext
Throws:
javax.jbi.JBIException

getEndpoints

public javax.jbi.servicedesc.ServiceEndpoint[] getEndpoints(QName interfaceName)
Specified by:
getEndpoints in interface javax.jbi.component.ComponentContext

queryInternalEndpoints

protected javax.jbi.servicedesc.ServiceEndpoint[] queryInternalEndpoints(Map<String,Object> props)

queryExternalEndpoints

protected javax.jbi.servicedesc.ServiceEndpoint[] queryExternalEndpoints(Map<String,Object> props)

doQueryServiceEndpoints

protected javax.jbi.servicedesc.ServiceEndpoint[] doQueryServiceEndpoints(Map<String,Object> props,
                                                                          boolean external)

doQueryEndpoints

protected List<Endpoint> doQueryEndpoints(Map<String,Object> props,
                                          boolean external)

getServiceEndpoint

protected javax.jbi.servicedesc.ServiceEndpoint getServiceEndpoint(Endpoint endpoint)

getServiceQNameFromProperties

protected QName getServiceQNameFromProperties(Map<String,?> epProps)

getEndpointsForService

public javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForService(QName serviceName)
Specified by:
getEndpointsForService in interface javax.jbi.component.ComponentContext

getExternalEndpoints

public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpoints(QName interfaceName)
Specified by:
getExternalEndpoints in interface javax.jbi.component.ComponentContext

getExternalEndpointsForService

public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForService(QName serviceName)
Specified by:
getExternalEndpointsForService in interface javax.jbi.component.ComponentContext

getDeliveryChannel

public javax.jbi.messaging.DeliveryChannel getDeliveryChannel()
                                                       throws javax.jbi.messaging.MessagingException
Specified by:
getDeliveryChannel in interface javax.jbi.component.ComponentContext
Throws:
javax.jbi.messaging.MessagingException

getLogger

public Logger getLogger(String suffix,
                        String resourceBundleName)
                 throws MissingResourceException,
                        javax.jbi.JBIException
Specified by:
getLogger in interface javax.jbi.component.ComponentContext
Throws:
MissingResourceException
javax.jbi.JBIException

getMBeanNames

public javax.jbi.management.MBeanNames getMBeanNames()
Specified by:
getMBeanNames in interface javax.jbi.component.ComponentContext

getMBeanServer

public MBeanServer getMBeanServer()
Specified by:
getMBeanServer in interface javax.jbi.component.ComponentContext

getNamingContext

public InitialContext getNamingContext()
Specified by:
getNamingContext in interface javax.jbi.component.ComponentContext

getTransactionManager

public Object getTransactionManager()
Specified by:
getTransactionManager in interface javax.jbi.component.ComponentContext

createCustomComponentMBeanName

public ObjectName createCustomComponentMBeanName(String customName)
Specified by:
createCustomComponentMBeanName in interface javax.jbi.management.MBeanNames

getJmxDomainName

public String getJmxDomainName()
Specified by:
getJmxDomainName in interface javax.jbi.management.MBeanNames

resolveEndpointReference

public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(DocumentFragment epr)
Specified by:
resolveEndpointReference in interface javax.jbi.component.ComponentContext

resolveInternalEPR

public javax.jbi.servicedesc.ServiceEndpoint resolveInternalEPR(DocumentFragment epr)

Resolve an internal JBI EPR conforming to the format defined in the JBI specification.

The EPR would look like:

 
 

Parameters:
epr - EPR fragment
Returns:
internal service endpoint corresponding to the EPR, or null if the EPR is not an internal EPR or if the EPR cannot be resolved

resolveStandardEPR

public javax.jbi.servicedesc.ServiceEndpoint resolveStandardEPR(DocumentFragment epr)
Resolve a standard EPR understood by ServiceMix container. Currently, the supported syntax is the WSA one, the address uri being parsed with the following possiblities: jbi:endpoint:service-namespace/service-name/endpoint jbi:endpoint:service-namespace:service-name:endpoint The full EPR will look like: jbi:endpoint:http://foo.bar.com/service/endpoint BCs should also be able to resolve such EPR but using their own URI parsing, for example: http://foo.bar.com/myService?http.soap=true or jms://activemq/queue/FOO.BAR?persistent=true Note that the separator should be same as the one used in the namespace depending on the namespace: http://foo.bar.com => '/' urn:foo:bar => ':' The syntax is the same as the one that can be used to specifiy a target for a JBI exchange with the restriction that it only allows the endpoint subprotocol to be used.

Parameters:
epr - the xml fragment to resolve
Returns:
the resolved endpoint or null


Copyright © 2005-2012 FuseSource. All Rights Reserved.