org.apache.camel.component.jmx
Class JMXConsumer

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.impl.DefaultConsumer
          extended by 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.


Field Summary
 
Fields inherited from class org.apache.camel.impl.DefaultConsumer
log
 
Constructor Summary
JMXConsumer(JMXEndpoint aEndpoint, Processor aProcessor)
           
 
Method Summary
protected  void doStart()
          Initializes the mbean server connection and starts listening for Notification events from the object.
protected  void doStop()
          Removes the notification listener
protected  MBeanServerConnection getServerConnection()
           
 void handleNotification(Notification aNotification, Object aHandback)
          Processes the Notification received.
protected  void setServerConnection(MBeanServerConnection aServerConnection)
           
 
Methods inherited from class org.apache.camel.impl.DefaultConsumer
getAsyncProcessor, getEndpoint, getExceptionHandler, getProcessor, handleException, setExceptionHandler, toString
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

JMXConsumer

public JMXConsumer(JMXEndpoint aEndpoint,
                   Processor aProcessor)
Method Detail

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