Class JMXConsumer

  • All Implemented Interfaces:
    AutoCloseable, EventListener, NotificationListener, org.apache.camel.Consumer, org.apache.camel.EndpointAware, org.apache.camel.health.HealthCheckAware, org.apache.camel.RouteAware, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.RouteIdAware, org.apache.camel.StatefulService, org.apache.camel.SuspendableService
    Direct Known Subclasses:
    JMXMonitorConsumer

    public class JMXConsumer
    extends org.apache.camel.support.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.support.service.BaseService

        BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Constructor Summary

      Constructors 
      Constructor Description
      JMXConsumer​(JMXEndpoint endpoint, org.apache.camel.Processor processor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addNotificationListener()
      Adds a notification listener to the target bean.
      protected void doStart()
      Initializes the mbean server connection and starts listening for Notification events from the object.
      protected void doStop()
      Removes the notification listeners and terminates the background connection polling process if it exists
      protected org.apache.camel.component.jmx.JMXConsumer.ConnectionNotificationListener getConnectionNotificationListener()
      Returns the connection notification listener; creates the default listener if one does not already exist
      JMXEndpoint getEndpoint()  
      protected NotificationXmlFormatter getFormatter()  
      protected MBeanServerConnection getServerConnection()  
      void handleNotification​(Notification aNotification, Object aHandback)
      Processes the Notification received.
      protected void removeNotificationListeners()
      Removes the configured notification listener and the connection notification listener from the connection
      protected void scheduleDelayedStart()
      Schedules execution of the doStart() operation to occur again after the reconnect delay
      protected void scheduleReconnect()
      Schedules an attempt to re-initialize a lost connection after the reconnect delay
      protected void setServerConnection​(MBeanServerConnection aServerConnection)  
      • Methods inherited from class org.apache.camel.support.DefaultConsumer

        createExchange, createUoW, defaultConsumerCallback, doBuild, doInit, doneUoW, doShutdown, getAsyncProcessor, getExceptionHandler, getHealthCheck, getProcessor, getRoute, getRouteId, handleException, handleException, releaseExchange, setExceptionHandler, setHealthCheck, setRoute, setRouteId, toString
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doFail, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
      • Methods inherited from interface org.apache.camel.Service

        build, close, init, start, stop
      • Methods inherited from interface org.apache.camel.ShutdownableService

        shutdown
      • Methods inherited from interface org.apache.camel.StatefulService

        getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
      • Methods inherited from interface org.apache.camel.SuspendableService

        isSuspended, resume, suspend
    • Constructor Detail

      • JMXConsumer

        public JMXConsumer​(JMXEndpoint endpoint,
                           org.apache.camel.Processor processor)
    • Method Detail

      • getEndpoint

        public JMXEndpoint getEndpoint()
        Specified by:
        getEndpoint in interface org.apache.camel.EndpointAware
        Overrides:
        getEndpoint in class org.apache.camel.support.DefaultConsumer
      • doStart

        protected void doStart()
                        throws Exception
        Initializes the mbean server connection and starts listening for Notification events from the object.
        Overrides:
        doStart in class org.apache.camel.support.DefaultConsumer
        Throws:
        Exception
      • getConnectionNotificationListener

        protected org.apache.camel.component.jmx.JMXConsumer.ConnectionNotificationListener getConnectionNotificationListener()
        Returns the connection notification listener; creates the default listener if one does not already exist
      • scheduleDelayedStart

        protected void scheduleDelayedStart()
        Schedules execution of the doStart() operation to occur again after the reconnect delay
      • scheduleReconnect

        protected void scheduleReconnect()
        Schedules an attempt to re-initialize a lost connection after the reconnect delay
      • addNotificationListener

        protected void addNotificationListener()
                                        throws Exception
        Adds a notification listener to the target bean.
        Throws:
        Exception
      • doStop

        protected void doStop()
                       throws Exception
        Removes the notification listeners and terminates the background connection polling process if it exists
        Overrides:
        doStop in class org.apache.camel.support.DefaultConsumer
        Throws:
        Exception
      • removeNotificationListeners

        protected void removeNotificationListeners()
                                            throws Exception
        Removes the configured notification listener and the connection notification listener from the connection
        Throws:
        Exception