Interface MessageBusHelper.Adapter

Enclosing class:
MessageBusHelper

public static interface MessageBusHelper.Adapter
An adapter between MessageBusHelper and a specific message bus.
  • Method Details

    • createMethodAdapter

      @Nonnull <T> MessageBusHelper.MethodAdapter<T> createMethodAdapter(@Nonnull Object object, @Nonnull Method method, @Nonnull Class<T> topic)
      Creates a MessageBusHelper.MethodAdapter that delivers the messages of the given topic to the given method of the given object.
      Type Parameters:
      T - the static type of the topic
      Parameters:
      object - the object that owns the method
      method - the listener method
      topic - the topic
      Returns:
      the MethodAdapter
    • publish

      void publish(@Nonnull Object message)
      Publishes a message. The topic is the class of the message.
      Parameters:
      message - the message
    • publish

      <T> void publish(Class<T> topic, @Nonnull T message)
      Publishes a message with an explicit topic.
      Type Parameters:
      T - the static type of the topic
      Parameters:
      topic - the topic
      message - the message