Class MBassador<T>

All Implemented Interfaces:
ErrorHandlingSupport, GenericMessagePublicationSupport<T,SyncAsyncPostCommand<T>>, IMessageBus<T,SyncAsyncPostCommand<T>>, PubSubSupport<T>, RuntimeProvider

public class MBassador<T> extends AbstractSyncAsyncMessageBus<T,SyncAsyncPostCommand<T>> implements IMessageBus<T,SyncAsyncPostCommand<T>>
  • Constructor Details

    • MBassador

      public MBassador()
      Default constructor using default setup. super() will also add a default publication error logger
    • MBassador

      public MBassador(IPublicationErrorHandler errorHandler)
      Construct with default settings and specified publication error handler
      Parameters:
      errorHandler -
    • MBassador

      public MBassador(IBusConfiguration configuration)
      Construct with fully specified configuration
      Parameters:
      configuration -
  • Method Details

    • publishAsync

      public IMessagePublication publishAsync(T message)
    • publishAsync

      public IMessagePublication publishAsync(T message, long timeout, TimeUnit unit)
    • publish

      public IMessagePublication publish(T message)
      Synchronously publish a message to all registered listeners (this includes listeners defined for super types) The call blocks until every messageHandler has processed the message.
      Specified by:
      publish in interface PubSubSupport<T>
      Parameters:
      message -
    • post

      public SyncAsyncPostCommand<T> post(T message)
      Description copied from interface: IMessageBus
      Publish a message to the bus using on of its supported message publication mechanisms. The supported mechanisms depend on the available implementation and are exposed as subclasses of IPublicationCommand. The standard mechanism is the synchronous dispatch which will publish the message in the current thread and returns after every matching handler has been invoked.
      Specified by:
      post in interface GenericMessagePublicationSupport<T,SyncAsyncPostCommand<T>>
      Specified by:
      post in interface IMessageBus<T,SyncAsyncPostCommand<T>>
      Parameters:
      message - - Any subtype of T welcome
      Returns:
      An object that provides access to the available publication methods supported by the message bus.