Class MultiQueue


  • public class MultiQueue
    extends java.lang.Object
    Author:
    Fabrizio Giudici
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiQueue()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <TOPIC> void add​(java.lang.Class<TOPIC> topic, TOPIC message)
      Adds a message of the given topic to this queue and issues a notification.
      <TOPIC> it.tidalwave.messagebus.spi.MultiQueue.TopicAndMessage<TOPIC> remove()
      Removes and returns the next pair (topic, message) from the queue.
      • Methods inherited from class java.lang.Object

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

      • MultiQueue

        public MultiQueue()
    • Method Detail

      • add

        public <TOPIC> void add​(@Nonnull
                                java.lang.Class<TOPIC> topic,
                                @Nonnull
                                TOPIC message)
        Adds a message of the given topic to this queue and issues a notification.
        Type Parameters:
        TOPIC - the static type of the message
        Parameters:
        topic - the dynamic type of the message
        message - the message
      • remove

        @Nonnull
        public <TOPIC> it.tidalwave.messagebus.spi.MultiQueue.TopicAndMessage<TOPIC> remove()
                                                                                     throws java.lang.InterruptedException
        Removes and returns the next pair (topic, message) from the queue. Blocks until one is available.
        Type Parameters:
        TOPIC - the static type of the topic
        Returns:
        the topic and message
        Throws:
        java.lang.InterruptedException - if interrupted while waiting