|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.servicemix.jbi.framework.ComponentContextImpl
public class ComponentContextImpl
This context provides access to data needed by all JBI components running in the JBI environment.
| Field Summary |
|---|
| Fields inherited from interface javax.jbi.management.MBeanNames |
|---|
BOOTSTRAP_EXTENSION, COMPONENT_LIFE_CYCLE_EXTENSION |
| Constructor Summary | |
|---|---|
ComponentContextImpl(JBIContainer container,
ComponentNameSpace componentName)
Constructor |
|
| Method Summary | |
|---|---|
void |
activate(javax.jbi.component.Component comp,
ComponentEnvironment env,
ActivationSpec spec)
Activate the ComponentContext |
javax.jbi.servicedesc.ServiceEndpoint |
activateEndpoint(QName serviceName,
String endpointName)
|
javax.jbi.servicedesc.ServiceEndpoint[] |
availableEndpoints(QName serviceName)
|
ObjectName |
createCustomComponentMBeanName(String customName)
Formulate and return the MBean ObjectName of a custom control MBean for a JBI component. |
void |
deactivateEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
Deregister the endpoint with the NMR |
void |
deregisterExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
Deregisters the given external endpoint with the NMR. |
InternalEndpoint |
deregisterSubscription(ComponentContextImpl context,
SubscriptionSpec subscription)
|
void |
deregisterSubscriptions(ComponentContextImpl context,
ActivationSpec as)
Deregister All subscriptions |
ActivationSpec |
getActivationSpec()
|
javax.jbi.component.Component |
getComponent()
|
String |
getComponentName()
|
ComponentNameSpace |
getComponentNameSpace()
get the id of the ComponentConnector |
JBIContainer |
getContainer()
|
javax.jbi.messaging.DeliveryChannel |
getDeliveryChannel()
|
javax.jbi.servicedesc.ServiceEndpoint |
getEndpoint(QName service,
String name)
Get the service endpoint for the named activated endpoint, if any. |
Document |
getEndpointDescriptor(javax.jbi.servicedesc.ServiceEndpoint endpoint)
Retrieve the service description metadata for the specified endpoint. |
javax.jbi.servicedesc.ServiceEndpoint[] |
getEndpoints(QName interfaceName)
Queries the NMR for active endpoints that implement the given interface. |
javax.jbi.servicedesc.ServiceEndpoint[] |
getEndpointsForService(QName serviceName)
Queries the NMR for active endpoints belonging to the given service. |
ComponentEnvironment |
getEnvironment()
|
javax.jbi.servicedesc.ServiceEndpoint[] |
getExternalEndpoints(QName interfaceName)
Queries the NMR for external endpoints that implement the given interface name. |
javax.jbi.servicedesc.ServiceEndpoint[] |
getExternalEndpointsForService(QName serviceName)
Queries the NMR for external endpoints that are part of the given service. |
String |
getInstallRoot()
Get the installation root directory path for this component. |
String |
getJmxDomainName()
Retrieve the default JMX Domain Name for MBeans registered in this instance of the JBI implementation. |
Logger |
getLogger(String suffix,
String resourceBundleName)
Get a logger instance from JBI. |
javax.jbi.management.MBeanNames |
getMBeanNames()
|
MBeanServer |
getMBeanServer()
|
InitialContext |
getNamingContext()
|
Object |
getTransactionManager()
Get the TransactionManager for this implementation. |
String |
getWorkspaceRoot()
|
void |
registerExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
Registers the given external endpoint with the NMR. |
void |
registerSubscription(ComponentContextImpl context,
SubscriptionSpec subscription,
javax.jbi.servicedesc.ServiceEndpoint endpoint)
|
void |
registerSubscriptions(ComponentContextImpl context,
ActivationSpec as)
Register All subscriptions |
javax.jbi.servicedesc.ServiceEndpoint |
resolveEndpointReference(DocumentFragment epr)
Resolve the given endpoint reference into a service endpoint. |
void |
setContainer(JBIContainer container)
|
void |
setDeliveryChannel(javax.jbi.messaging.DeliveryChannel deliveryChannel)
|
void |
setEnvironment(ComponentEnvironment ce)
Set the ComponentEnvironment |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ComponentContextImpl(JBIContainer container,
ComponentNameSpace componentName)
container - componentName - | Method Detail |
|---|
public void activate(javax.jbi.component.Component comp,
ComponentEnvironment env,
ActivationSpec spec)
comp - channel - env - spec - installRoot - public ComponentNameSpace getComponentNameSpace()
public String getComponentName()
getComponentName in interface javax.jbi.component.ComponentContextpublic javax.jbi.component.Component getComponent()
public javax.jbi.servicedesc.ServiceEndpoint activateEndpoint(QName serviceName,
String endpointName)
throws javax.jbi.JBIException
activateEndpoint in interface javax.jbi.component.ComponentContextserviceName - endpointName -
javax.jbi.JBIException
public javax.jbi.servicedesc.ServiceEndpoint[] availableEndpoints(QName serviceName)
throws javax.jbi.JBIException
serviceName -
javax.jbi.JBIException
public void deactivateEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
throws javax.jbi.JBIException
deactivateEndpoint in interface javax.jbi.component.ComponentContextendpoint -
javax.jbi.JBIException
public void registerSubscriptions(ComponentContextImpl context,
ActivationSpec as)
context - as -
public void deregisterSubscriptions(ComponentContextImpl context,
ActivationSpec as)
context - as -
public void registerSubscription(ComponentContextImpl context,
SubscriptionSpec subscription,
javax.jbi.servicedesc.ServiceEndpoint endpoint)
context - subscription - endpoint -
public InternalEndpoint deregisterSubscription(ComponentContextImpl context,
SubscriptionSpec subscription)
context - subscription -
public javax.jbi.messaging.DeliveryChannel getDeliveryChannel()
getDeliveryChannel in interface javax.jbi.component.ComponentContextMessagingExceptionpublic String getJmxDomainName()
getJmxDomainName in interface javax.jbi.management.MBeanNamespublic ObjectName createCustomComponentMBeanName(String customName)
createCustomComponentMBeanName in interface javax.jbi.management.MBeanNamescustomName - the name of the custom control.
null if customName is invalid.public javax.jbi.management.MBeanNames getMBeanNames()
getMBeanNames in interface javax.jbi.component.ComponentContextpublic MBeanServer getMBeanServer()
getMBeanServer in interface javax.jbi.component.ComponentContextpublic InitialContext getNamingContext()
getNamingContext in interface javax.jbi.component.ComponentContextpublic Object getTransactionManager()
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.
getTransactionManager in interface javax.jbi.component.ComponentContextnull if none is available in the execution environment.public String getWorkspaceRoot()
getWorkspaceRoot in interface javax.jbi.component.ComponentContextpublic JBIContainer getContainer()
public ComponentEnvironment getEnvironment()
public void setEnvironment(ComponentEnvironment ce)
ce - public void setContainer(JBIContainer container)
container - The container to set.public void setDeliveryChannel(javax.jbi.messaging.DeliveryChannel deliveryChannel)
deliveryChannel - The deliveryChannel to set.
public void registerExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
throws javax.jbi.JBIException
registerExternalEndpoint in interface javax.jbi.component.ComponentContextexternalEndpoint - the external endpoint to be registered, must be non-null.
javax.jbi.JBIException - if an external endpoint with the same name is already registered, by this or another
component.
public void deregisterExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
throws javax.jbi.JBIException
deregisterExternalEndpoint in interface javax.jbi.component.ComponentContextexternalEndpoint - the external endpoint to be deregistered; must be non-null.
javax.jbi.JBIException - if the given external endpoint was not previously registered.public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(DocumentFragment epr)
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.
resolveEndpointReference in interface javax.jbi.component.ComponentContextepr - endpoint reference as an XML fragment; must be non-null.
null if the reference
cannot be resolved.
public javax.jbi.servicedesc.ServiceEndpoint getEndpoint(QName service,
String name)
getEndpoint in interface javax.jbi.component.ComponentContextservice - qualified-name of the endpoint's service; must be non-null.name - name of the endpoint; must be non-null.
null if the named endpoint is not activated.
public Document getEndpointDescriptor(javax.jbi.servicedesc.ServiceEndpoint endpoint)
throws javax.jbi.JBIException
Note that the result can use either the WSDL 1.1 or WSDL 2.0 description language.
getEndpointDescriptor in interface javax.jbi.component.ComponentContextendpoint - endpoint reference; must be non-null.
null if metadata is unavailable.
javax.jbi.JBIException - invalid endpoint reference.public javax.jbi.servicedesc.ServiceEndpoint[] getEndpoints(QName interfaceName)
registerExternalEndpoint(ServiceEndpoint).
getEndpoints in interface javax.jbi.component.ComponentContextinterfaceName - qualified name of interface/portType that is implemented by the endpoint; if
null then all activated endpoints in the JBI environment must be returned.
public javax.jbi.servicedesc.ServiceEndpoint[] getEndpointsForService(QName serviceName)
registerExternalEndpoint(ServiceEndpoint).
getEndpointsForService in interface javax.jbi.component.ComponentContextserviceName - qualified name of the service that the endpoints are part of; must be non-null.
public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpoints(QName interfaceName)
registerExternalEndpoint(ServiceEndpoint).
getExternalEndpoints in interface javax.jbi.component.ComponentContextinterfaceName - qualified name of interface implemented by the endpoints; must be non-null.
public javax.jbi.servicedesc.ServiceEndpoint[] getExternalEndpointsForService(QName serviceName)
getExternalEndpointsForService in interface javax.jbi.component.ComponentContextserviceName - qualified name of service that contains the endpoints; must be non-null.
public String getInstallRoot()
This method MUST return the file path formatted for the underlying platform.
getInstallRoot in interface javax.jbi.component.ComponentContext
public Logger getLogger(String suffix,
String resourceBundleName)
throws MissingResourceException,
javax.jbi.JBIException
getLogger in interface javax.jbi.component.ComponentContextsuffix - 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.
MissingResourceException - if the ResourceBundleName is non-null and no corresponding resource can be
found.
javax.jbi.JBIException - if the resourceBundleName has changed from a previous invocation by this component of
this method with the same suffix.public ActivationSpec getActivationSpec()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||