Class SingleThreadedChannel<T,Y>

java.lang.Object
pt.unl.fct.di.novasys.channel.base.SingleThreadedChannel<T,Y>
All Implemented Interfaces:
IChannel<T>, MessageListener<Y>
Direct Known Subclasses:
SingleThreadedBiChannel, SingleThreadedClientChannel, SingleThreadedServerChannel

public abstract class SingleThreadedChannel<T,Y> extends Object implements IChannel<T>, MessageListener<Y>
  • Constructor Details

    • SingleThreadedChannel

      public SingleThreadedChannel(String threadName)
  • Method Details

    • sendMessage

      public void sendMessage(T msg, Host peer, int connection)
      Specified by:
      sendMessage in interface IChannel<T>
    • closeConnection

      public void closeConnection(Host peer, int connection)
      Specified by:
      closeConnection in interface IChannel<T>
    • deliverMessage

      public void deliverMessage(Y msg, Connection<Y> conn)
      Description copied from interface: MessageListener
      Method that is called to deliver a message from the network layer to the application
      Specified by:
      deliverMessage in interface MessageListener<T>
      Parameters:
      msg - The received message
    • openConnection

      public void openConnection(Host peer)
      Specified by:
      openConnection in interface IChannel<T>