Class Subscription

java.lang.Object
net.engio.mbassy.subscription.Subscription

public class Subscription extends Object
A subscription is a thread-safe container that manages exactly one message handler of all registered message listeners of the same class, i.e. all subscribed instances (excluding subclasses) of a SingleMessageHandler.class will be referenced in the subscription created for SingleMessageHandler.class. There will be as many unique subscription objects per message listener class as there are message handlers defined in the message listeners class hierarchy. The subscription provides functionality for message publication by means of delegation to the respective message dispatcher.
  • Field Details

  • Constructor Details

  • Method Details

    • belongsTo

      public boolean belongsTo(Class listener)
      Check whether this subscription manages a message handler of the given listener class.
    • contains

      public boolean contains(Object listener)
      Check whether this subscriptions manages the given listener instance.
    • handlesMessageType

      public boolean handlesMessageType(Class<?> messageType)
      Check whether this subscription manages a specific message type.
    • getHandledMessageTypes

      public Class[] getHandledMessageTypes()
    • publish

      public void publish(MessagePublication publication, Object message)
    • getPriority

      public int getPriority()
    • subscribe

      public void subscribe(Object o)
    • unsubscribe

      public boolean unsubscribe(Object existingListener)
    • size

      public int size()
    • getHandle

      public Subscription.Handle getHandle()