public class AdapterManager extends ComponentManagerImpl<Adapter> implements AdapterManagerMBean, AdapterRuntimeManager
AdapterManagerMBean.ComponentManagerImpl.ComponentNotificationTypelogNOTIF_MSG_FORCE_CLOSEADAPTER_PREFIX, CHANNEL_PREFIX, EQUALS, ID_PREFIX, JMX_ADAPTER_TYPE, JMX_CHANNEL_TYPE, JMX_CONSUMER_MONITOR_TYPE, JMX_DOMAIN_NAME, JMX_FAILED_MESSAGE_RETRIER_TYPE, JMX_FS_MONITOR_TYPE, JMX_INFLIGHT_TYPE, JMX_LOG_HANDLER_TYPE, JMX_METRICS_TYPE, JMX_MSG_ERR_DIGESTER_TYPE, JMX_NOTIFIER_TYPE, JMX_RETRY_MONITOR_TYPE, JMX_WORKFLOW_TYPE, KEY_ADAPTER, KEY_CHANNEL, KEY_ID, KEY_WORKFLOW, NOTIF_MSG_CLOSED, NOTIF_MSG_CONFIG_UPDATED, NOTIF_MSG_INITIALISED, NOTIF_MSG_RESTARTED, NOTIF_MSG_STARTED, NOTIF_MSG_STOPPED, NOTIF_TYPE_ADAPTER_CONFIG, NOTIF_TYPE_ADAPTER_LIFECYCLE, NOTIF_TYPE_CHANNEL_CONFIG, NOTIF_TYPE_CHANNEL_LIFECYCLE, NOTIF_TYPE_WORKFLOW_CONFIG, NOTIF_TYPE_WORKFLOW_LIFECYCLE, PROPERTY_SEPARATOR, WORKFLOW_PREFIX| Constructor and Description |
|---|
AdapterManager(Adapter owner) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAndBindSharedConnection(java.lang.String xmlString)
Add an
AdaptrisConnection to the adapter's shared components. |
boolean |
addAndBindSharedService(java.lang.String xmlString)
Add an
Service to the adapter's shared components. |
javax.management.ObjectName |
addChannel(java.lang.String xml)
Add a
Channel to this adapter. |
boolean |
addChild(ChannelRuntimeManager cmb)
Add a a child to this parent.
|
boolean |
addChildJmxComponent(ChildRuntimeInfoComponent comp) |
boolean |
addChildren(java.util.Collection<ChannelRuntimeManager> coll)
Add some children to this parent (optional operation).
|
boolean |
addSharedConnection(java.lang.String xmlString)
Add an
AdaptrisConnection to the adapter's shared components.. |
boolean |
addSharedService(java.lang.String xmlString)
Add a
Service to the adapter's shared components. |
protected void |
checkTransitionTo(ComponentState futureState)
Check whether the transition is allowed in the context of the current component's (or parent's) state.
|
void |
childUpdated()
Notifies a parent that a child component has been updated.
|
boolean |
containsSharedConnection(java.lang.String connectionId)
Check if the associated connectionId is already present in the shared connections.
|
boolean |
containsSharedService(java.lang.String serviceId)
Check if the associated serviceId is already present in the shared services.
|
java.lang.String |
createObjectHierarchyString()
Create an ObjectName key/value pair hierarchy.
|
javax.management.ObjectName |
createObjectName()
Create the object name representation of the mbean.
|
boolean |
equals(java.lang.Object o)
Equality is based on the underlying ObjectName.
|
void |
forceClose()
Forcibly close the associated adapter.
|
java.lang.String |
getAdapterBuildVersion()
Get the adapter build version.
|
java.util.Collection<BaseComponentMBean> |
getAllDescendants()
Get all the descendants of this ParentComponent implementation.
|
java.util.List<java.lang.String> |
getArtifactIdentifiers()
Get a list of all the modules currently installed for this adapter.
|
java.util.Collection<javax.management.ObjectName> |
getChildren()
Get the list of
ObjectName instances that map to all the immeidate child components of this parent. |
java.util.Collection<javax.management.ObjectName> |
getChildRuntimeInfoComponents() |
java.util.List<java.lang.String> |
getModuleVersions()
Get a list of all the modules currently installed for this adapter.
|
javax.management.MBeanNotificationInfo[] |
getNotificationInfo() |
protected java.lang.String |
getNotificationType(ComponentManagerImpl.ComponentNotificationType type) |
java.util.Collection<java.lang.String> |
getSharedConnectionIds()
Get all the connection unique-ids that are currently registered as a shared connection.
|
java.util.Collection<java.lang.String> |
getSharedServiceIds()
Get all the service unique-ids that are currently registered as a shared service.
|
Adapter |
getWrappedComponent()
Get the component that this implementation manages.
|
int |
hashCode() |
void |
registerMBean()
Register this component (and all children) against the default Platform MBeanServer.
|
boolean |
removeChannel(java.lang.String id)
Remove a
Channel from this adapter. |
boolean |
removeChild(ChannelRuntimeManager cmb)
Remove a Child from this parent.
|
boolean |
removeChildJmxComponent(ChildRuntimeInfoComponent comp) |
boolean |
removeChildren(java.util.Collection<ChannelRuntimeManager> coll)
Remove some children from this parent.
|
boolean |
removeSharedComponent(java.lang.String id)
Convenience method to do both
AdapterManagerMBean.removeSharedService(String) and #removeSharedConnection(String) at once. |
boolean |
removeSharedConnection(java.lang.String connectionId)
Remove a connection from the adapter's shared connections.
|
boolean |
removeSharedService(java.lang.String serviceId)
Remove a service from the adapter's shared components.
|
long |
requestStartTime()
Returns timestamp of the last start time for this component
|
long |
requestStopTime()
Returns timestamp of the last stop time for this component
|
void |
sendLifecycleEvent(AdapterLifecycleEvent event)
Send an
AdapterLifecycleEvent to any configured event handlers. |
void |
setFailedMessageRetrier(java.lang.String xml)
Set the
FailedMessageRetrier for this adapter. |
void |
setMessageErrorHandler(java.lang.String xml)
Set the
ProcessingExceptionHandler for this adapter. |
java.lang.String |
toString() |
void |
unregisterMBean()
Unregister this component (and all children) from the default Platform MBeanServer.
|
asXml, closeQuietly, createLifecycleNotification, ensureState, getComponentState, getConfiguration, getUniqueId, getWrappedComponentClassname, marshalAndSendNotification, marshalConfig, registerSelf, requestClose, requestClose, requestInit, requestInit, requestRestart, requestRestart, requestStart, requestStart, requestStop, requestStop, sendConfigUpdateNotification, unregisterSelfaddNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotificationclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetWrappedComponentClassnamegetComponentState, getConfiguration, getUniqueId, requestClose, requestClose, requestInit, requestInit, requestRestart, requestRestart, requestStart, requestStart, requestStop, requestStoppublic AdapterManager(Adapter owner) throws javax.management.MalformedObjectNameException, CoreException
javax.management.MalformedObjectNameExceptionCoreExceptionpublic javax.management.ObjectName createObjectName()
throws javax.management.MalformedObjectNameException
BaseComponentMBeancreateObjectName in interface BaseComponentMBeanjavax.management.MalformedObjectNameException - on exception.public long requestStartTime()
AdapterComponentMBeanrequestStartTime in interface AdapterComponentMBeanpublic long requestStopTime()
AdapterComponentMBeanrequestStopTime in interface AdapterComponentMBeanpublic java.util.Collection<javax.management.ObjectName> getChildren()
throws javax.management.MalformedObjectNameException
ParentComponentMBeanObjectName instances that map to all the immeidate child components of this parent.getChildren in interface ParentComponentMBeanObjectName instances.javax.management.MalformedObjectNameExceptionpublic boolean addChild(ChannelRuntimeManager cmb) throws CoreException
ParentComponentaddChild in interface ParentComponent<ChannelRuntimeManager>cmb - a channel managerCoreException - wrapping any underlying exceptionSet.add(Object)public boolean removeChild(ChannelRuntimeManager cmb) throws CoreException
ParentComponentremoveChild in interface ParentComponent<ChannelRuntimeManager>cmb - a channel managerCoreException - wrapping any underlying exceptionSet.remove(Object)public boolean addChildren(java.util.Collection<ChannelRuntimeManager> coll) throws CoreException
ParentComponentaddChildren in interface ParentComponent<ChannelRuntimeManager>coll - a collection of items to be added.CoreException - wrapping any underlying exceptionSet.addAll(Collection)public boolean removeChildren(java.util.Collection<ChannelRuntimeManager> coll) throws CoreException
ParentComponentremoveChildren in interface ParentComponent<ChannelRuntimeManager>coll - a collection of items to be removed.CoreException - wrapping any underlying exceptionSet.addAll(Collection)public Adapter getWrappedComponent()
AdapterRuntimeComponentgetWrappedComponent in interface AdapterRuntimeComponent<Adapter>public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectprotected void checkTransitionTo(ComponentState futureState) throws CoreException
ComponentManagerImplcheckTransitionTo in class ComponentManagerImpl<Adapter>futureState - the state we want to transition to.CoreException - if the state transition check fails.public java.util.Collection<BaseComponentMBean> getAllDescendants()
AdapterRuntimeComponentgetAllDescendants in interface AdapterRuntimeComponent<Adapter>getAllDescendants in interface ParentComponent<ChannelRuntimeManager>public java.util.Collection<javax.management.ObjectName> getChildRuntimeInfoComponents()
throws javax.management.MalformedObjectNameException
getChildRuntimeInfoComponents in interface ParentRuntimeInfoComponentMBeanjavax.management.MalformedObjectNameExceptionpublic boolean addChildJmxComponent(ChildRuntimeInfoComponent comp)
addChildJmxComponent in interface ParentRuntimeInfoComponentpublic boolean removeChildJmxComponent(ChildRuntimeInfoComponent comp)
removeChildJmxComponent in interface ParentRuntimeInfoComponentpublic java.lang.String createObjectHierarchyString()
HierarchicalMBeancreateObjectHierarchyString in interface HierarchicalMBeancreateObjectHierarchyString in interface ParentComponent<ChannelRuntimeManager>public boolean addSharedConnection(java.lang.String xmlString)
throws CoreException,
java.lang.IllegalArgumentException
AdapterManagerMBeanAdaptrisConnection to the adapter's shared components..addSharedConnection in interface AdapterManagerMBeanxmlString - the string representation of the connection.CoreException - wrapping any other exceptionjava.lang.IllegalArgumentException - if the connection does not have an unique-idpublic boolean addAndBindSharedConnection(java.lang.String xmlString)
throws CoreException,
java.lang.IllegalStateException
AdapterManagerMBeanAdaptrisConnection to the adapter's shared components. and bind it to JNDI.
This is primarily for adding shared connections when the Adapter is currently started. Runtime manipulation of the adapter
allows you to invoke AdapterManagerMBean.addChannel(String) while the adapter is running. If the Channel object
contains a reference to a shared connection, then you should use this method to add the and bind the shared connection to JNDI
ready for use.
addAndBindSharedConnection in interface AdapterManagerMBeanxmlString - the string representation of the connection.CoreException - wrapping any other exceptionjava.lang.IllegalStateException - if the state of the adapter is actually closed, in which case you should use
AdapterManagerMBean.addSharedConnection(String) instead..public boolean removeSharedConnection(java.lang.String connectionId)
throws CoreException,
java.lang.IllegalStateException
AdapterManagerMBeanremoveSharedConnection in interface AdapterManagerMBeanconnectionId - the connection unique-id to remove.CoreException - wrapping any other exceptionjava.lang.IllegalStateException - if the state of the adapter is not closed.public boolean containsSharedConnection(java.lang.String connectionId)
throws CoreException
AdapterManagerMBeancontainsSharedConnection in interface AdapterManagerMBeanconnectionId - the connection unique-id to check forCoreException - wrapping any other exceptionpublic java.util.Collection<java.lang.String> getSharedConnectionIds()
throws CoreException
AdapterManagerMBeangetSharedConnectionIds in interface AdapterManagerMBeanCoreException - wrapping any other exceptionpublic boolean addSharedService(java.lang.String xmlString)
throws CoreException,
java.lang.IllegalStateException,
java.lang.IllegalArgumentException
AdapterManagerMBeanService to the adapter's shared components.addSharedService in interface AdapterManagerMBeanxmlString - the string representation of the service.CoreException - wrapping any other exceptionjava.lang.IllegalStateException - if the state of the adapter is not closed.java.lang.IllegalArgumentException - if the connection does not have an unique-idpublic boolean addAndBindSharedService(java.lang.String xmlString)
throws CoreException,
java.lang.IllegalStateException,
java.lang.IllegalArgumentException
AdapterManagerMBeanService to the adapter's shared components. and bind it to JNDI.
This is primarily for adding shared services when the Adapter is currently started. Runtime manipulation of the adapter allows
you to invoke AdapterManagerMBean.addChannel(String) while the adapter is running. If the Channel object
contains a reference to a shared service, then you should use this method to add the and bind the shared connection to JNDI
ready for use.
addAndBindSharedService in interface AdapterManagerMBeanxmlString - the string representation of the service.CoreException - wrapping any other exceptionjava.lang.IllegalStateException - if the state of the adapter is actually closed, in which case you should use
AdapterManagerMBean.addSharedConnection(String) instead..java.lang.IllegalArgumentException - if the connection does not have an unique-idpublic boolean removeSharedService(java.lang.String serviceId)
throws CoreException,
java.lang.IllegalStateException
AdapterManagerMBeanremoveSharedService in interface AdapterManagerMBeanserviceId - the shared service unique-id to remove.CoreException - wrapping any other exceptionjava.lang.IllegalStateException - if the state of the adapter is not closed.public boolean containsSharedService(java.lang.String serviceId)
throws CoreException
AdapterManagerMBeancontainsSharedService in interface AdapterManagerMBeanserviceId - the shared service unique-id to remove.CoreException - wrapping any other exceptionpublic java.util.Collection<java.lang.String> getSharedServiceIds()
throws CoreException
AdapterManagerMBeangetSharedServiceIds in interface AdapterManagerMBeanCoreException - wrapping any other exceptionpublic boolean removeSharedComponent(java.lang.String id)
throws CoreException,
java.lang.IllegalStateException
AdapterManagerMBeanAdapterManagerMBean.removeSharedService(String) and #removeSharedConnection(String) at once.removeSharedComponent in interface AdapterManagerMBeanid - the shared id to remove.CoreException - wrapping any other exceptionjava.lang.IllegalStateException - if the state of the adapter is not closed.public javax.management.ObjectName addChannel(java.lang.String xml)
throws CoreException,
javax.management.MalformedObjectNameException
AdapterManagerMBeanChannel to this adapter.addChannel in interface AdapterManagerMBeanxml - the string representation of the channel.CoreException - wrapping any exceptionjavax.management.MalformedObjectNameException - upon ObjectName errors.public boolean removeChannel(java.lang.String id)
throws CoreException,
javax.management.MalformedObjectNameException
AdapterManagerMBeanChannel from this adapter.
This also removes the associated ChannelManager and calls BaseComponentMBean.unregisterMBean().
removeChannel in interface AdapterManagerMBeanid - the id of the channel to remove.CoreException - wrapping any exceptionjavax.management.MalformedObjectNameException - upon ObjectName errors.public void setMessageErrorHandler(java.lang.String xml)
throws CoreException
AdapterManagerMBeanProcessingExceptionHandler for this adapter.setMessageErrorHandler in interface AdapterManagerMBeanxml - the string representation of the error handler.CoreException - wrapping any exceptionpublic void setFailedMessageRetrier(java.lang.String xml)
throws CoreException
AdapterManagerMBeanFailedMessageRetrier for this adapter.setFailedMessageRetrier in interface AdapterManagerMBeanxml - the string representation of the error handler.CoreException - wrapping any exceptionpublic void registerMBean()
throws CoreException
BaseComponentMBeanregisterMBean in interface BaseComponentMBeanCoreException - wrapping any exceptionManagementFactory.getPlatformMBeanServer()public void unregisterMBean()
throws CoreException
BaseComponentMBeanunregisterMBean in interface BaseComponentMBeanCoreException - wrapping any exceptionManagementFactory.getPlatformMBeanServer()public void childUpdated()
throws CoreException
ParentComponentchildUpdated in interface ParentComponent<ChannelRuntimeManager>CoreExceptionpublic java.lang.String getAdapterBuildVersion()
AdapterManagerMBeangetAdapterBuildVersion in interface AdapterManagerMBeanpublic java.util.List<java.lang.String> getModuleVersions()
AdapterManagerMBeangetModuleVersions in interface AdapterManagerMBeanpublic java.util.List<java.lang.String> getArtifactIdentifiers()
AdapterManagerMBeangetArtifactIdentifiers in interface AdapterManagerMBeangroupId:artifactId:version.public void sendLifecycleEvent(AdapterLifecycleEvent event) throws CoreException
AdapterManagerMBeanAdapterLifecycleEvent to any configured event handlers.sendLifecycleEvent in interface AdapterManagerMBeanevent - the AdapterLifecycleEvent to send.CoreException - wrapping any exceptionpublic javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface javax.management.NotificationBroadcastergetNotificationInfo in class javax.management.NotificationBroadcasterSupportprotected java.lang.String getNotificationType(ComponentManagerImpl.ComponentNotificationType type)
getNotificationType in class ComponentManagerImpl<Adapter>public void forceClose()
throws CoreException
AdapterManagerMBean
In the event that there is a concrete AllowsRetriesConnection that is configured incorrectly, and set
with infinite retries; then the adapter will appear to be stuck waiting in the incorrect state (generally, attempting to
initialise) when asked nicely to stop. Use this method to forcibly terminate whatever operations are being attempted and to
shutdown the adapter.
forceClose in interface AdapterManagerMBeanCoreException