Class GenericProtocol

java.lang.Object
pt.unl.fct.di.novasys.babel.core.GenericProtocol
Direct Known Subclasses:
PhiTest.PhiProto, TimerProto

public abstract class GenericProtocol extends Object
An abstract class that represent a generic protocol

This class handles all interactions required by protocols

Users should extend this class to implement their protocols

  • Constructor Details

    • GenericProtocol

      public GenericProtocol(String protoName, short protoId, BlockingQueue<InternalEvent> policy)
      Creates a generic protocol with the provided name and numeric identifier and the given event queue policy.

      Event queue policies can be defined to specify handling events in desired orders: Eg. If multiple events are inside the queue, then timers are always processes first than any other event in the queue.

      Parameters:
      protoName - the protocol name
      protoId - the protocol numeric identifier
      policy - the queue policy to use
    • GenericProtocol

      public GenericProtocol(String protoName, short protoId)
      Create a generic protocol with the provided name and numeric identifier and network service

      The internal event queue is defined to have a FIFO policy on all events

      Parameters:
      protoName - name of the protocol
      protoId - numeric identifier
  • Method Details