Class SimpleDuplexHandler<I,E,O,A extends Address>

All Implemented Interfaces:
Handler
Direct Known Subclasses:
Codec

public abstract class SimpleDuplexHandler<I,E,O,A extends Address> extends SimpleInboundHandler<I,E,A>
HandlerAdapter which allows to explicit only handle a specific type of messages and events.
  • Constructor Details

    • SimpleDuplexHandler

      protected SimpleDuplexHandler()
    • SimpleDuplexHandler

      protected SimpleDuplexHandler(Class<? extends I> inboundMessageType, Class<? extends E> inboundEventType, Class<? extends O> outboundMessageType, Class<? extends A> addressType)
  • Method Details

    • write

      public void write(HandlerContext ctx, Address recipient, Object msg, CompletableFuture<Void> future)
      Description copied from interface: Handler
      Gets called if a Object was send from the application to a recipient.
      Specified by:
      write in interface Handler
      Overrides:
      write in class HandlerAdapter
      Parameters:
      ctx - handler context
      recipient - the recipient of the message
      msg - the message
      future - a future for the message
    • acceptOutbound

      protected boolean acceptOutbound(Object msg)
      Returns true if the given message should be handled. If false it will be passed to the next Handler in the Pipeline.
    • matchedWrite

      protected abstract void matchedWrite(HandlerContext ctx, A recipient, O msg, CompletableFuture<Void> future)
      Is called for each message of type SimpleDuplexHandler.
      Parameters:
      ctx - handler context
      recipient - the recipient of the message
      msg - the message
      future - a future for the message