public abstract class ModelBindingComponent extends Object implements Component, ControllerMBean, ComponentLifeCycle, ServiceUnitManager, NotificationEmitter
| Modifier and Type | Field and Description |
|---|---|
protected ObjectName |
mControllerMBeanName |
protected ObjectName |
mDeployerMBeanName
JMX object names for component-only mbeans:
|
protected String |
mDisplayName
User-friendly display name to be used by ModelBindingComponent methods:
|
protected ComponentContext |
mEnv |
protected MBeanSet |
mInitialMBeans |
protected JbiNameInfo |
mJbiNameInfo
handle to jbi schemaorg_apache_xmlbeans.system or installed component identification:
|
protected ObjectName |
mLifeCycleMBeanName
JMX object names for standard mbeans:
|
protected Logger |
mLogger
Logger to be used by ModelBindingComponent methods:
|
protected ObjectName |
mLoggerMBeanName |
protected MBeanNames |
mMBeanNames
handle to our MBean Namer:
|
protected MBeanServer |
mMBeanServer
handle to our MBean Server:
|
protected String |
mModelName |
protected MBeanSet |
mStartMBeans |
protected StringTranslator |
mTranslator
Handle to StringTranslator for message translation:
|
| Constructor and Description |
|---|
ModelBindingComponent() |
| Modifier and Type | Method and Description |
|---|---|
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
Adds a listener to this MBean.
|
protected void |
bootstrap()
perform one-time startup tasks for this model
|
String |
deploy(String serviceUnitName,
String serviceUnitRootPath)
Deploy a Service Unit to the component.
|
String |
getComponentInfo()
Return current version and other info about this component.
|
String |
getcomponentName()
Return the componentName
|
ObjectName |
getDefaultLoggerMBean()
Return the ObjectName of the default LoggerMBean for this component.
|
ObjectName |
getDeployerMBean()
Return the JMX ObjectName for this component's DeployerMBean or null.
|
ObjectName |
getExtensionMBeanName()
Get the JMX object name for the extension MBean for this component; if
there is none, return
null. |
String |
getHelp()
Return help text about this component.
|
ComponentLifeCycle |
getLifeCycle()
Get the life cycle control interface for this component.
|
ObjectName |
getLifeCycleMBean()
Return the JMX ObjectName for this component's LifeCycleMBean
or null.
|
ObjectName |
getLoggerMBeanByName(String aLoggerName)
Return the ObjectName for LoggerMBean named
aLoggerName,
or null, if the named logger does not exist in this component. |
ObjectName[] |
getLoggerMBeans()
Return the ObjectNames for all of the LoggerMBean's for this component.
|
NotificationBroadcasterSupport |
getNotificationBroadcaster()
Getter for local NotificationBroadcaster.
|
MBeanNotificationInfo[] |
getNotificationInfo()
Returns an array indicating, for each notification this
MBean may send, the name of the Java class of the notification
and the notification type.
|
Document |
getServiceDescription(ServiceEndpoint endpoint)
Retrieves a DOM representation containing metadata which describes the
service provided by this component, through the given endpoint.
|
ServiceUnitManager |
getServiceUnitManager()
Get the Service Unit manager for this component.
|
void |
init(ComponentContext context)
Initialize the component.
|
void |
init(String serviceUnitName,
String serviceUnitRootPath)
Initialize the given deployed service unit.
|
protected void |
initModelBindingComponent(ComponentContext anEnv,
JbiNameInfo aJbiName)
allocate a logger, and then initialize the ModelBindingComponent.
|
protected void |
initModelBindingComponent(ComponentContext anEnv,
Logger aLogger,
JbiNameInfo aJbiName)
Initialize the ModelBindingComponent.
|
boolean |
isExchangeWithConsumerOkay(ServiceEndpoint endpoint,
MessageExchange exchange)
This method is called by JBI to check if this component, in the role of
provider of the service indicated by the given exchange, can actually
perform the operation desired.
|
boolean |
isExchangeWithProviderOkay(ServiceEndpoint endpoint,
MessageExchange exchange)
This method is called by JBI to check if this component, in the role of
consumer of the service indicated by the given exchange, can actually
interact with the provider properly.
|
String |
messageDeployOkay() |
String |
messageUnDeployOkay() |
void |
removeNotificationListener(NotificationListener listener)
Removes a listener from this MBean.
|
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
Removes a listener from this MBean.
|
ServiceEndpoint |
resolveEndpointReference(DocumentFragment epr)
Resolve the given endpoint reference.
|
void |
shutDown()
Shut down the component.
|
void |
shutDown(String serviceUnitName)
Shut down the deployment.
|
void |
start()
Start the component.
|
void |
start(String serviceUnitName)
Start the deployed service unit.
|
void |
stop()
Stop the component.
|
void |
stop(String serviceUnitName)
Stop the deployed service unit.
|
String |
undeploy(String serviceUnitName,
String serviceUnitRootPath)
Undeploy a service unit from the component.
|
protected ComponentContext mEnv
protected MBeanSet mInitialMBeans
protected MBeanSet mStartMBeans
protected Logger mLogger
protected MBeanServer mMBeanServer
protected MBeanNames mMBeanNames
protected JbiNameInfo mJbiNameInfo
protected String mDisplayName
protected ObjectName mLifeCycleMBeanName
protected ObjectName mLoggerMBeanName
protected final String mModelName
protected StringTranslator mTranslator
protected ObjectName mDeployerMBeanName
protected ObjectName mControllerMBeanName
protected void initModelBindingComponent(ComponentContext anEnv, JbiNameInfo aJbiName)
protected void initModelBindingComponent(ComponentContext anEnv, Logger aLogger, JbiNameInfo aJbiName)
protected void bootstrap()
public ComponentLifeCycle getLifeCycle()
This method must be called before any other methods of this interface are called. In addition, the JBI implementation must call the init() method of the component life cycle returned by this method before calling any other methods on this interface, or the component life cycle interface.
getLifeCycle in interface Componentpublic ServiceUnitManager getServiceUnitManager()
null.getServiceUnitManager in interface ComponentServiceUnitManager for this component, or
null if there is none.public Document getServiceDescription(ServiceEndpoint endpoint)
getServiceDescription in interface Componentendpoint - the service endpoint.public boolean isExchangeWithConsumerOkay(ServiceEndpoint endpoint, MessageExchange exchange)
isExchangeWithConsumerOkay in interface Componentendpoint - the endpoint to be used by the consumer; must be
non-null.exchange - the proposed message exchange to be performed; must be
non-null.true if this provider component can perform the
given exchange with the described consumer.public boolean isExchangeWithProviderOkay(ServiceEndpoint endpoint, MessageExchange exchange)
isExchangeWithProviderOkay in interface Componentendpoint - the endpoint to be used by the provider; must be
non-null.exchange - the proposed message exchange to be performed; must be
non-null.true if this consumer component can interact with
the described provider to perform the given exchange.public ServiceEndpoint resolveEndpointReference(DocumentFragment epr)
If this component returns a non-null result, it must conform to the following:
ServiceEndpoint returned.
ComponentContext.activateEndpoint(QName,
String)), nor registered (see ComponentContext) by components.
They can only be used to address message exchanges; the JBI
implementation must deliver such exchanges to the component that resolved
the endpoint reference (see ComponentContext.resolveEndpointReference(DocumentFragment)).resolveEndpointReference in interface Componentepr - the endpoint reference, in some XML dialect understood by
the appropriate component (usually a binding); must be non-null.null if the
EPR cannot be resolved by this component.public ObjectName getExtensionMBeanName()
null.getExtensionMBeanName in interface ComponentLifeCyclenull
if there is no additional MBean.public void init(ComponentContext context) throws JBIException
If the component needs to register an additional MBean to extend its life cycle, or provide other component management tasks, it should be registered during this call.
init in interface ComponentLifeCyclecontext - the component's context, providing access to component
data provided by the JBI environment; must be non-null.JBIException - if the component is unable to initialize.public void shutDown()
throws JBIException
init(ComponentContext) must be called before the component can
be started again with a call to start().shutDown in interface ComponentLifeCycleJBIException - if the component is unable to shut down.public void start()
throws JBIException
init(ComponentContext), both when
the component is being started for the first time and when the component
is being restarted after a previous call to shutDown().
If stop() was called previously but shutDown() was not,
start() can be called again without another call to
init(ComponentContext).start in interface ComponentLifeCycleJBIException - if the component is unable to start.public void stop()
throws JBIException
start() may be called
again without first calling init(ComponentContext).stop in interface ComponentLifeCycleJBIException - if the component is unable to stop.public String deploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException
Upon successful deployment, a non-empty result string must be returned, that starts with the JBI-defined component-task-result element. For example:
<component-task-result>
<component-name>BC1</component-name>
<component-task-result-details
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<task-result-details>
<task-id>deploy</task-id>
<task-result>SUCCESS</task-result>
</task-result-details>
</component-task-result-details>
</component-task-result>
A failed deployment of the service unit must be reported using the
component-task-result element as well; the
task-result must be set to FAILED.deploy in interface ServiceUnitManagerserviceUnitName - name of the service unit being deployed; must be
non-null and non-empty and unique among service units already
deployed to the component.serviceUnitRootPath - path of the service unit artifact root, in
platform specific format; must be non-null and non-empty.DeploymentException - if the deployment operation is
unsuccessful.public void init(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException
The serviceUnitRootPath parameter is provided to facilitate restart of the component. This allows simple components to rely entirely on JBI's ability to persist deployment information, avoiding the need for the component to provide its own persistence mechanism.
init in interface ServiceUnitManagerserviceUnitName - name of the service unit being initialized; must
be non-null, non-empty, and match the name of a previously
deployed (but not yet undeployed) service unit.serviceUnitRootPath - path of the service unit artifact root, in
platform specific format; must be non-null and non-empty.DeploymentException - if the service unit is not deployed, or
if it is in an incorrect state.public void start(String serviceUnitName) throws DeploymentException
start in interface ServiceUnitManagerserviceUnitName - the name of the service unit being started; must
be non-null, non-empty, and match the name of a previously
deployed (but not yet undeployed) service unit.DeploymentException - if the service unit is not deployed, or
if it is in an incorrect state.public void stop(String serviceUnitName) throws DeploymentException
init(String, String) was called.stop in interface ServiceUnitManagerserviceUnitName - name of the service unit being stopped; must
be non-null, non-empty, and match the name of a previously
deployed (but not yet undeployed) service unit.DeploymentException - if the service unit is not deployed, or
if it is in an incorrect state.public void shutDown(String serviceUnitName) throws DeploymentException
deploy(String, String), and before
init(String, String).shutDown in interface ServiceUnitManagerserviceUnitName - name of the service unit being shut down; must
be non-null, non-empty, and match the name of a previously
deployed (but not yet undeployed) service unit.DeploymentException - if the service unit is not deployed, or
if it is in an incorrect state.public String undeploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException
undeploy in interface ServiceUnitManagerserviceUnitName - name of the service unit being undeployed; must
be non-null, non-empty, and match the name of a previously
deployed (but not yet undeployed) service unit.serviceUnitRootPath - path of the service unit artifact root, in
platform specific format; must be non-null and non-empty.component-task-result type from
the schema given in the MBean Status and Result Strings
section of the Management chapter of the JBI
specification; must be non-null and non-empty.DeploymentException - if undeployment operation is unsuccessful,
or if the service unit is in an incorrect state.public String getComponentInfo()
getComponentInfo in interface ControllerMBeanpublic String getHelp()
getHelp in interface ControllerMBeanpublic ObjectName getDeployerMBean()
getDeployerMBean in interface ControllerMBeanpublic ObjectName getLifeCycleMBean()
getLifeCycleMBean in interface ControllerMBeanpublic ObjectName getLoggerMBeanByName(String aLoggerName)
aLoggerName,
or null, if the named logger does not exist in this component.getLoggerMBeanByName in interface ControllerMBeanpublic ObjectName getDefaultLoggerMBean()
getDefaultLoggerMBean in interface ControllerMBeanpublic ObjectName[] getLoggerMBeans()
getLoggerMBeans in interface ControllerMBeanpublic String getcomponentName()
getcomponentName in interface ControllerMBeanpublic void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
addNotificationListener in interface NotificationBroadcasterlistener - The listener object which will handle the
notifications emitted by the broadcaster.filter - The filter object. If filter is null, no
filtering will be performed before handling notifications.handback - An opaque object to be sent back to the
listener when a notification is emitted. This object cannot be
used by the Notification broadcaster object. It should be
resent unchanged with the notification to the listener.IllegalArgumentException - Listener parameter is null.removeNotificationListener(javax.management.NotificationListener)public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeNotificationListener in interface NotificationBroadcasterlistener - A listener that was previously added to this
MBean.ListenerNotFoundException - The listener is not
registered with the MBean.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object),
NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)public MBeanNotificationInfo[] getNotificationInfo()
Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.
It is not illegal for the MBean to send notifications not described in this array. However, some clients of the MBean server may depend on the array being complete for their correct functioning.
getNotificationInfo in interface NotificationBroadcasterpublic void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
Removes a listener from this MBean. The MBean must have a
listener that exactly matches the given listener,
filter, and handback parameters. If
there is more than one such listener, only one is removed.
The filter and handback parameters
may be null if and only if they are null in a listener to be
removed.
removeNotificationListener in interface NotificationEmitterlistener - A listener that was previously added to this
MBean.filter - The filter that was specified when the listener
was added.handback - The handback that was specified when the listener was
added.ListenerNotFoundException - The listener is not
registered with the MBean, or it is not registered with the
given filter and handback.public NotificationBroadcasterSupport getNotificationBroadcaster()
public String messageDeployOkay()
public String messageUnDeployOkay()
Copyright © 2011-2016 OpenESB Community. All Rights Reserved.