@ComponentProfile(summary="Listen for notifications against the specified ObjectName",
tag="consumer,jmx",
metadata="jmxNotificationSource",
recommended=JmxConnection.class)
public class JmxNotificationConsumer
extends AdaptrisMessageConsumerImp
implements javax.management.NotificationListener
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JMX_NOTIF_SOURCE |
log| Constructor and Description |
|---|
JmxNotificationConsumer() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the component.
|
java.lang.String |
consumeLocationKey()
Provides the metadata key '"jmxNotificationSource"' that contains the source of the
notifcation.
|
ConsumeDestination |
getDestination()
Deprecated.
|
java.lang.Boolean |
getFailIfNotFound() |
java.lang.String |
getObjectName()
The object name which we will register as a listener for.
|
NotificationSerializer |
getSerializer() |
void |
handleNotification(javax.management.Notification notification,
java.lang.Object handback) |
void |
init()
Initialises the component.
|
protected java.lang.String |
newThreadName() |
protected java.lang.String |
objectName() |
void |
prepare()
Prepare for initialisation.
|
void |
setDestination(ConsumeDestination destination)
Deprecated.
|
void |
setFailIfNotFound(java.lang.Boolean b)
Whether or not to fail if the ObjectName is not found.
|
void |
setObjectName(java.lang.String objectName)
The object name which we will register as a listener for.
|
void |
setSerializer(NotificationSerializer serializer) |
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
changeState, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentStatecreateName, createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueIDclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdecode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactorygetUniqueIdcreateName, createQualifier, isTrackingEndpointpublic static final java.lang.String JMX_NOTIF_SOURCE
protected java.lang.String objectName()
protected java.lang.String newThreadName()
newThreadName in class AdaptrisMessageConsumerImppublic void prepare()
throws CoreException
ComponentLifecycleExtensionprepare in interface ComponentLifecycleExtensionCoreExceptionpublic void init()
throws CoreException
ComponentLifecycleComponent initialisation includes config verification, creation of connections etc.
init in interface ComponentLifecycleCoreException - wrapping any underlying Exceptionspublic 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 ComponentLifecycleCoreException - wrapping any underlying Exceptionspublic 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 ComponentLifecyclepublic 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 ComponentLifecyclepublic 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.NotificationListenerpublic 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 truepublic java.lang.String consumeLocationKey()
consumeLocationKey in interface AdaptrisMessageConsumer@Deprecated public ConsumeDestination getDestination()
@Deprecated public void setDestination(ConsumeDestination destination)
public java.lang.String getObjectName()
public void setObjectName(java.lang.String objectName)