Interface MonitorNotificationService<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Brings this service to a state where it has disposed of its resources.
      void init()
      Brings this service to a state where it is ready to process new publication requests.
      boolean publish​(java.nio.ByteBuffer dataBuffer, TypeSupports.TypeSupport<T> typeSupport, int dataCount)
      Publishes a new value to a monitor's subscriber using a value that must first be deserialized from the supplied data buffer.
      boolean publish​(T value)
      Publishes a new value to a monitor's subscriber (which this library models as a Java Consumer) using the value that is directly supplied.
    • Method Detail

      • publish

        boolean publish​(java.nio.ByteBuffer dataBuffer,
                        TypeSupports.TypeSupport<T> typeSupport,
                        int dataCount)
        Publishes a new value to a monitor's subscriber using a value that must first be deserialized from the supplied data buffer. This method places the responsibility of value deserialization on the service implementor. This provides the extra flexibility to reuse data structures and to avoid the cost of object creation.
        Parameters:
        dataBuffer - the byte buffer containing the new value (which must first be deserialized).
        typeSupport - reference to an object which has the capability of deserializing the information in the byte buffer.
        dataCount - the number of items in the buffer to be deserialized.
        Returns:
        true when the new value was accepted without any loss of data; false if the oldest value in the notification buffer was discarded.
      • publish

        boolean publish​(T value)
        Publishes a new value to a monitor's subscriber (which this library models as a Java Consumer) using the value that is directly supplied. The new value will be published to the Consumer on one or more notification threads. Where the subscriber is not immediately able to process it (eg the previous call to the Consumer is blocked) the value may optionally be buffered. If the value notification buffer becomes full the oldest value in the buffer is thrown away.
        Parameters:
        value - the new value.
        Returns:
        true when the new value was accepted without any loss of data; false if the oldest value in the notification buffer was discarded.
      • init

        void init()
        Brings this service to a state where it is ready to process new publication requests.
      • close

        void close()
        Brings this service to a state where it has disposed of its resources. Threads that were created within the service are guaranteed to be destroyed.
        Specified by:
        close in interface java.lang.AutoCloseable