@ComponentProfile(summary="Listen for notifications against the specified ObjectName", tag="consumer,jmx", recommended=JmxConnection.class) public class JmxNotificationConsumer extends AdaptrisMessageConsumerImp implements javax.management.NotificationListener
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
JmxNotificationConsumer() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the component.
|
java.lang.Boolean |
getFailIfNotFound() |
NotificationSerializer |
getSerializer() |
void |
handleNotification(javax.management.Notification notification,
java.lang.Object handback) |
void |
init()
Initialises the component.
|
void |
prepare()
Prepare for initialisation.
|
void |
setFailIfNotFound(java.lang.Boolean b)
Whether or not to fail if the ObjectName is not found.
|
void |
setSerializer(NotificationSerializer serializer) |
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
changeState, getDestination, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentState, setDestination
createName, createQualifier, decode, encode, getEncoder, getIsConfirmation, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isConfirmation, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsConfirmation, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
getUniqueId
createName, createQualifier, isConfirmation, isTrackingEndpoint
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
spublic void start() throws CoreException
ComponentLifecycle
Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.
start
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
spublic void stop()
ComponentLifecycle
A stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing a
RuntimeException
may cause unintended consequences
stop
in interface ComponentLifecycle
public void close()
ComponentLifecycle
A closed component should release any connections it uses, etc. and clean up completely.
Throwing a RuntimeException
may cause unintended consequences
close
in interface ComponentLifecycle
public void prepare() throws CoreException
ComponentLifecycleExtension
prepare
in interface ComponentLifecycleExtension
CoreException
public NotificationSerializer getSerializer()
public void setSerializer(NotificationSerializer serializer)
serializer
- the serializer to setpublic void handleNotification(javax.management.Notification notification, java.lang.Object handback)
handleNotification
in interface javax.management.NotificationListener
public java.lang.Boolean getFailIfNotFound()
public void setFailIfNotFound(java.lang.Boolean b)
If set to false, and the object is not found, then an attempt will be made periodically to check the MBeanServeConnection for the object instance availability; when it becomes available, the notificaiton listener will be added at that point.
b
- the failIfNotFound to set, default is true