Class ListenerTracker


  • public class ListenerTracker
    extends java.lang.Object
    Tracks event deliveries to an event listener and the way the listener processes the events. The collected information is made available through the EventListenerMBean interface.
    • Constructor Summary

      Constructors 
      Constructor Description
      ListenerTracker​(javax.jcr.observation.EventListener listener, int eventTypes, java.lang.String absPath, boolean isDeep, java.lang.String[] uuid, java.lang.String[] nodeTypeName, boolean noLocal)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      EventListenerMBean getListenerMBean()  
      javax.jcr.observation.EventListener getTrackedListener()  
      void recordOneSecond()
      Records the number of measured values over the past second and resets the counter.
      void recordProducerTime​(long time, java.util.concurrent.TimeUnit unit)
      Record additional producer time spent outside of the listeners, e.g.
      void recordQueueLength​(long length)
      Applications should call this to report the current queue length.
      void recordQueueLength​(long length, long headTimestamp)
      Applications should call this to report the current queue length when an item is removed from the queue.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ListenerTracker

        public ListenerTracker​(javax.jcr.observation.EventListener listener,
                               int eventTypes,
                               java.lang.String absPath,
                               boolean isDeep,
                               java.lang.String[] uuid,
                               java.lang.String[] nodeTypeName,
                               boolean noLocal)
    • Method Detail

      • recordQueueLength

        public void recordQueueLength​(long length)
        Applications should call this to report the current queue length.
        Parameters:
        length -
      • recordQueueLength

        public void recordQueueLength​(long length,
                                      long headTimestamp)
        Applications should call this to report the current queue length when an item is removed from the queue.
        Parameters:
        length - the length of the queue after the item was removed.
        headTimestamp - the time in milliseconds when the head item was created and put into the queue.
      • recordOneSecond

        public void recordOneSecond()
        Records the number of measured values over the past second and resets the counter. This method should be scheduled to be called once per second.
      • recordProducerTime

        public void recordProducerTime​(long time,
                                       java.util.concurrent.TimeUnit unit)
        Record additional producer time spent outside of the listeners, e.g. before onEvent() is called.
        Parameters:
        time - the amount of time.
        unit - the time unit.
      • getTrackedListener

        public javax.jcr.observation.EventListener getTrackedListener()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object