Class TransportLogger.TransportHandler<T>

java.lang.Object
de.iip_ecosphere.platform.services.environment.TransportLogger.TransportHandler<T>
Type Parameters:
T - the type of data to be handled
All Implemented Interfaces:
de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<T>
Enclosing class:
TransportLogger

protected static class TransportLogger.TransportHandler<T> extends Object implements de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<T>
Implements a generic transport handler for logging.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • TransportHandler

      protected TransportHandler(String stream, Class<T> cls, Consumer<T> cons)
      Creates a handler.
      Parameters:
      stream - the transport stream to listen to
      cls - the class of data to listen to
      cons - the consumer to be called
  • Method Details

    • initialize

      public void initialize() throws IOException
      Initializes the handler.
      Throws:
      IOException - if registering the handler as reception callback fails
    • detach

      public void detach() throws IOException
      Detaches the handler from Transport.
      Throws:
      IOException - if detaching the handler as reception callback fails
    • received

      public void received(T data)
      Specified by:
      received in interface de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<T>
    • getType

      public Class<T> getType()
      Specified by:
      getType in interface de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<T>