Interface Muxer<T>

All Known Implementing Classes:
MuxUpHandler

public interface Muxer<T>
Allows registration/deregistrator of multiplexed handlers by mux id.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(short id, T handler)
    Registers the specified handler to handle messages containing a mux header with the specified mux identifier.
    get(short id)
    Gets the handler registered under the specified id
    Gets the handler for messages that have no mux header.
    void
    remove(short id)
    Unregisters the handler associated with the specifed mux identifier
    void
    Sets the handler for messages that have no mux header.
  • Method Details

    • add

      void add(short id, T handler)
      Registers the specified handler to handle messages containing a mux header with the specified mux identifier.
      Parameters:
      id - a mux id
      handler - a handler for the specified id
    • get

      T get(short id)
      Gets the handler registered under the specified id
      Parameters:
      id - a mux id
      Returns:
      the handler, or null if no handler is registered under id
    • remove

      void remove(short id)
      Unregisters the handler associated with the specifed mux identifier
      Parameters:
      id - a mux id
    • getDefaultHandler

      T getDefaultHandler()
      Gets the handler for messages that have no mux header.
      Returns:
      the default handler, or null if no default handler has been set
    • setDefaultHandler

      void setDefaultHandler(T handler)
      Sets the handler for messages that have no mux header.
      Parameters:
      handler - a handler for messages that have no mux header