Class DedicatedExecutorProtocolHolder

java.lang.Object
pt.unl.fct.di.novasys.babel2.core.AbstractBabelProtocolHolder
pt.unl.fct.di.novasys.babel2.core.DedicatedExecutorProtocolHolder
All Implemented Interfaces:
BabelProtocolHolder

public final class DedicatedExecutorProtocolHolder extends AbstractBabelProtocolHolder
A BabelProtocolHolder implementation that runs the protocol on a dedicated, single-threaded executor using a lock-free MpscArrayQueue.

This holder provides isolated execution for CPU-intensive protocols or protocols that must not share execution threads with others.

  • Constructor Details

    • DedicatedExecutorProtocolHolder

      protected DedicatedExecutorProtocolHolder(BabelProtocol protocol, Set<ProtocolExtension<? extends BabelProtocol>> extensions, ExecutorService executor, int maxQueueCapacity)
      Constructs a holder with a dedicated executor and bounded event queue.
      Parameters:
      protocol - the protocol instance to manage
      extensions - the protocol extensions configured for this protocol
      executor - the dedicated executor service for this protocol
      maxQueueCapacity - the maximum number of pending events allowed in the queue
  • Method Details

    • deliverEvent

      public void deliverEvent(BabelEvent event)
      Description copied from interface: BabelProtocolHolder
      Enqueues or delivers an event to the underlying protocol.
      Parameters:
      event - the event to deliver