Class AbstractThreadedQueuingConnector<O,I,CO,CI,M extends ModelAccess>

java.lang.Object
de.iip_ecosphere.platform.connectors.AbstractConnector<O,I,CO,CI>
de.iip_ecosphere.platform.connectors.AbstractThreadedConnector<O,I,CO,CI,M>
de.iip_ecosphere.platform.connectors.AbstractThreadedQueuingConnector<O,I,CO,CI,M>
Type Parameters:
O - the output type from the underlying machine/platform
I - the input type to the underlying machine/platform
CO - the output type of the connector
CI - the input type of the connector
M - the model access type of the connector
All Implemented Interfaces:
Connector<O,I,CO,CI>, EventHandlingConnector, AbstractModelAccess.NotificationChangedListener

public abstract class AbstractThreadedQueuingConnector<O,I,CO,CI,M extends ModelAccess> extends AbstractThreadedConnector<O,I,CO,CI,M>
Queues incoming data for sequential delayed processing. Further, provides a reusable base for connectors that require a ModelAccess instance per calling thread. Call startQueueProcessing() in AbstractConnector.connectImpl(ConnectorParameter) and stopQueueProcessing() in AbstractConnector.disconnectImpl().
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

  • Method Details

    • startQueueProcessing

      protected void startQueueProcessing()
      Starts queue processing. If not called, data is queued but not processed.
    • stopQueueProcessing

      protected void stopQueueProcessing()
      Stops queue processing.
    • write

      public void write(CI data) throws IOException
      Description copied from interface: Connector
      Writes the given data to the underlying machine/platform.
      Specified by:
      write in interface Connector<O,I,CO,CI>
      Overrides:
      write in class AbstractConnector<O,I,CO,CI>
      Parameters:
      data - the data to send to stream
      Throws:
      IOException - in case that problems during the connection happens
    • origWrite

      private void origWrite(CI data) throws IOException
      The original implementation of write(Object), overwritten for queuing in this class. Writes the given data to the underlying machine/platform.
      Parameters:
      data - the data to send to stream
      Throws:
      IOException - in case that problems during the connection happens