Class DisruptorMonitorNotificationServiceFactory

    • Constructor Summary

      Constructors 
      Constructor Description
      DisruptorMonitorNotificationServiceFactory​(boolean oldImpl)
      Creates a new factory with the capability of generating MonitorNotificationService instances on a per Consumer basis.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes down this service factory and releases all underlying resources.
      int getQosMetricBufferSizePerConsumer()
      Returns an indication of the size of each consumer's notification buffer (for service implementations which provide buffering).
      boolean getQosMetricIsBuffered()
      Returns an indication of whether this service implementation can be expected to drop notifications or whether it will buffer them in situations where the publication rate exceeds the rate at which the consumers can process the data.
      boolean getQosMetricIsNullPublishable()
      Returns an indication of whether the publish method accepts null as a valid token to be sent to the Coinsumer.
      int getQosMetricNumberOfNotificationThreadsPerConsumer()
      Returns an indication of how many threads the consumer may be called back on.
      int getServiceCount()
      Returns the count of service instances created by this provider.
      <T> MonitorNotificationService<T> getServiceForConsumer​(java.util.function.Consumer<? super T> consumer)
      Returns a service instance which will publish events to the specified Consumer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DisruptorMonitorNotificationServiceFactory

        public DisruptorMonitorNotificationServiceFactory​(boolean oldImpl)
        Creates a new factory with the capability of generating MonitorNotificationService instances on a per Consumer basis. This factory provides service instances based on the LMAX Disruptor technology.
        Parameters:
        oldImpl - determines the backwards compatibility mode for the Disruptor. True means the original Disruptor implementation will be used.
    • Method Detail

      • getServiceForConsumer

        public <T> MonitorNotificationService<T> getServiceForConsumer​(java.util.function.Consumer<? super T> consumer)
        Returns a service instance which will publish events to the specified Consumer.
        Specified by:
        getServiceForConsumer in interface MonitorNotificationServiceFactory
        Type Parameters:
        T - the type of events that this service instance will publish.
        Parameters:
        consumer - the consumer to publish to.
        Returns:
        the service instance.
      • close

        public void close()
        Closes down this service factory and releases all underlying resources.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface MonitorNotificationServiceFactory
        Implementation Note:
        This implementation calls close on all service instances that it previously created.
      • getQosMetricNumberOfNotificationThreadsPerConsumer

        public int getQosMetricNumberOfNotificationThreadsPerConsumer()
        Returns an indication of how many threads the consumer may be called back on. Where multiple threads are involved the consumer may wish to synchronize their accept method to force serialisation of the notification sequence so that events get notified in the same sequence as they were published.
        Specified by:
        getQosMetricNumberOfNotificationThreadsPerConsumer in interface MonitorNotificationServiceFactory
        Returns:
        the result.
        Implementation Note:
        Always 1 for this service factory.
      • getQosMetricIsNullPublishable

        public boolean getQosMetricIsNullPublishable()
        Returns an indication of whether the publish method accepts null as a valid token to be sent to the Coinsumer.
        Specified by:
        getQosMetricIsNullPublishable in interface MonitorNotificationServiceFactory
        Returns:
        the result.
        Implementation Note:
        True for this service factory.
      • getQosMetricIsBuffered

        public boolean getQosMetricIsBuffered()
        Returns an indication of whether this service implementation can be expected to drop notifications or whether it will buffer them in situations where the publication rate exceeds the rate at which the consumers can process the data.
        Specified by:
        getQosMetricIsBuffered in interface MonitorNotificationServiceFactory
        Returns:
        the result.
        Implementation Note:
        This implementation has a minimal buffer holding the previous value only. Thus, for all practical purposes it can be considered unbuffered when it comes to smoothing out bursty traffic requests.
      • getQosMetricBufferSizePerConsumer

        public int getQosMetricBufferSizePerConsumer()
        Returns an indication of the size of each consumer's notification buffer (for service implementations which provide buffering). Returns 1 in the case that the service implementation is not buffered.
        Specified by:
        getQosMetricBufferSizePerConsumer in interface MonitorNotificationServiceFactory
        Returns:
        the result.
        Implementation Note:
        This implementation has a minimal buffer holding the previous value only.