org.apache.camel.component.jmx
Class JMXConsumer
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultConsumer
org.apache.camel.component.jmx.JMXConsumer
- All Implemented Interfaces:
- EventListener, NotificationListener, Consumer, Service, ShutdownableService
public class JMXConsumer
- extends DefaultConsumer
- implements NotificationListener
Consumer will add itself as a NotificationListener on the object
specified by the objectName param.
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend |
JMXConsumer
public JMXConsumer(JMXEndpoint aEndpoint,
Processor aProcessor)
doStart
protected void doStart()
throws Exception
- Initializes the mbean server connection and starts listening for
Notification events from the object.
- Overrides:
doStart in class DefaultConsumer
- Throws:
Exception
doStop
protected void doStop()
throws Exception
- Removes the notification listener
- Overrides:
doStop in class DefaultConsumer
- Throws:
Exception
getServerConnection
protected MBeanServerConnection getServerConnection()
setServerConnection
protected void setServerConnection(MBeanServerConnection aServerConnection)
handleNotification
public void handleNotification(Notification aNotification,
Object aHandback)
- Processes the Notification received. The handback will be set as
the header "jmx.handback" while the Notification will be set as
the body.
If the format is set to "xml" then the Notification will be converted
to XML first using
NotificationXmlFormatter
- Specified by:
handleNotification in interface NotificationListener
- See Also:
NotificationListener.handleNotification(javax.management.Notification, java.lang.Object)
Apache CAMEL