public class ChannelManager extends ComponentManagerImpl<Channel> implements ChannelManagerMBean, ChannelRuntimeManager
ChannelManagerMBean
.ComponentManagerImpl.ComponentNotificationType
log
ADAPTER_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 |
---|
ChannelManager(Channel c,
AdapterManager owner) |
Modifier and Type | Method and Description |
---|---|
boolean |
addChild(WorkflowRuntimeManager cmb)
Add a a child to this parent.
|
boolean |
addChildJmxComponent(ChildRuntimeInfoComponent comp) |
boolean |
addChildren(java.util.Collection<WorkflowRuntimeManager> coll)
Add some children to this parent (optional operation).
|
javax.management.ObjectName |
addWorkflow(java.lang.String xml)
Add a
Workflow to this channel. |
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.
|
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.
|
java.util.Collection<BaseComponentMBean> |
getAllDescendants()
Get all the descendants of this ParentComponent implementation.
|
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() |
javax.management.MBeanNotificationInfo[] |
getNotificationInfo() |
protected java.lang.String |
getNotificationType(ComponentManagerImpl.ComponentNotificationType type) |
AdapterManager |
getParent()
Get our direct parent component.
|
java.lang.String |
getParentId()
Get the parent's uniqueid.
|
javax.management.ObjectName |
getParentObjectName()
Get the parents ObjectName representation.
|
Channel |
getWrappedComponent()
Get the component that this implementation manages.
|
int |
hashCode() |
void |
registerMBean()
Register this component (and all children) against the default Platform MBeanServer.
|
boolean |
removeChild(WorkflowRuntimeManager cmb)
Remove a Child from this parent.
|
boolean |
removeChildJmxComponent(ChildRuntimeInfoComponent comp) |
boolean |
removeChildren(java.util.Collection<WorkflowRuntimeManager> coll)
Remove some children from this parent.
|
boolean |
removeWorkflow(java.lang.String id)
Remove a
Workflow from this channel. |
long |
requestStartTime()
Returns timestamp of the last start time for this component
|
long |
requestStopTime()
Returns timestamp of the last stop time for this component
|
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, unregisterSelf
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getWrappedComponentClassname
getComponentState, getConfiguration, getUniqueId, requestClose, requestClose, requestInit, requestInit, requestRestart, requestRestart, requestStart, requestStart, requestStop, requestStop
public ChannelManager(Channel c, AdapterManager owner) throws javax.management.MalformedObjectNameException, CoreException
javax.management.MalformedObjectNameException
CoreException
public javax.management.ObjectName createObjectName() throws javax.management.MalformedObjectNameException
BaseComponentMBean
createObjectName
in interface BaseComponentMBean
javax.management.MalformedObjectNameException
- on exception.public long requestStartTime()
AdapterComponentMBean
requestStartTime
in interface AdapterComponentMBean
public long requestStopTime()
AdapterComponentMBean
requestStopTime
in interface AdapterComponentMBean
public java.util.Collection<javax.management.ObjectName> getChildren() throws javax.management.MalformedObjectNameException
ParentComponentMBean
ObjectName
instances that map to all the immeidate child components of this parent.getChildren
in interface ParentComponentMBean
ObjectName
instances.javax.management.MalformedObjectNameException
public boolean addChild(WorkflowRuntimeManager cmb) throws CoreException
ParentComponent
addChild
in interface ParentComponent<WorkflowRuntimeManager>
cmb
- a channel managerCoreException
- wrapping any underlying exceptionSet.add(Object)
public boolean removeChild(WorkflowRuntimeManager cmb) throws CoreException
ParentComponent
removeChild
in interface ParentComponent<WorkflowRuntimeManager>
cmb
- a channel managerCoreException
- wrapping any underlying exceptionSet.remove(Object)
public boolean addChildren(java.util.Collection<WorkflowRuntimeManager> coll) throws CoreException
ParentComponent
addChildren
in interface ParentComponent<WorkflowRuntimeManager>
coll
- a collection of items to be added.CoreException
- wrapping any underlying exceptionSet.addAll(Collection)
public boolean removeChildren(java.util.Collection<WorkflowRuntimeManager> coll) throws CoreException
ParentComponent
removeChildren
in interface ParentComponent<WorkflowRuntimeManager>
coll
- a collection of items to be removed.CoreException
- wrapping any underlying exceptionSet.addAll(Collection)
public Channel getWrappedComponent()
AdapterRuntimeComponent
getWrappedComponent
in interface AdapterRuntimeComponent<Channel>
public AdapterManager getParent()
ChildComponent
getParent
in interface ChildComponent<AdapterRuntimeManager>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
protected void checkTransitionTo(ComponentState futureState) throws CoreException
ComponentManagerImpl
checkTransitionTo
in class ComponentManagerImpl<Channel>
futureState
- the state we want to transition to.CoreException
- if the state transition check fails.public java.util.Collection<BaseComponentMBean> getAllDescendants()
AdapterRuntimeComponent
getAllDescendants
in interface AdapterRuntimeComponent<Channel>
getAllDescendants
in interface ParentComponent<WorkflowRuntimeManager>
public java.lang.String getParentId()
ChildRuntimeInfoComponentMBean
getParentId
in interface ChildComponentMBean
getParentId
in interface ChildRuntimeInfoComponentMBean
public javax.management.ObjectName getParentObjectName() throws javax.management.MalformedObjectNameException
ChildRuntimeInfoComponentMBean
getParentObjectName
in interface ChildComponentMBean
getParentObjectName
in interface ChildRuntimeInfoComponentMBean
javax.management.MalformedObjectNameException
public java.lang.String createObjectHierarchyString()
HierarchicalMBean
createObjectHierarchyString
in interface HierarchicalMBean
createObjectHierarchyString
in interface ParentComponent<WorkflowRuntimeManager>
public java.util.Collection<javax.management.ObjectName> getChildRuntimeInfoComponents() throws javax.management.MalformedObjectNameException
getChildRuntimeInfoComponents
in interface ParentRuntimeInfoComponentMBean
javax.management.MalformedObjectNameException
public boolean addChildJmxComponent(ChildRuntimeInfoComponent comp)
addChildJmxComponent
in interface ParentRuntimeInfoComponent
public boolean removeChildJmxComponent(ChildRuntimeInfoComponent comp)
removeChildJmxComponent
in interface ParentRuntimeInfoComponent
public void registerMBean() throws CoreException
BaseComponentMBean
registerMBean
in interface BaseComponentMBean
CoreException
- wrapping any exceptionManagementFactory.getPlatformMBeanServer()
public void unregisterMBean() throws CoreException
BaseComponentMBean
unregisterMBean
in interface BaseComponentMBean
CoreException
- wrapping any exceptionManagementFactory.getPlatformMBeanServer()
public javax.management.ObjectName addWorkflow(java.lang.String xml) throws CoreException, java.lang.IllegalStateException, javax.management.MalformedObjectNameException
ChannelManagerMBean
Workflow
to this channel.addWorkflow
in interface ChannelManagerMBean
xml
- the string representation of the workflow.CoreException
- wrapping any exceptionjava.lang.IllegalStateException
- if the state of the adapter is not "Closed"javax.management.MalformedObjectNameException
- upon ObjectName errors.public boolean removeWorkflow(java.lang.String id) throws CoreException, java.lang.IllegalStateException, javax.management.MalformedObjectNameException
ChannelManagerMBean
Workflow
from this channel.
This also removes the associated WorkflowManager
and calls BaseComponentMBean.unregisterMBean()
.
removeWorkflow
in interface ChannelManagerMBean
id
- the id of the channel to remove.CoreException
- wrapping any exceptionjava.lang.IllegalStateException
- if the state of the adapter is not "Closed"javax.management.MalformedObjectNameException
- upon ObjectName errors.public void childUpdated() throws CoreException
ParentComponent
childUpdated
in interface ParentComponent<WorkflowRuntimeManager>
CoreException
public javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface javax.management.NotificationBroadcaster
getNotificationInfo
in class javax.management.NotificationBroadcasterSupport
protected java.lang.String getNotificationType(ComponentManagerImpl.ComponentNotificationType type)
getNotificationType
in class ComponentManagerImpl<Channel>