Class DedicatedExecutorProtocolHolderFactory
java.lang.Object
pt.unl.fct.di.novasys.babel2.core.DedicatedExecutorProtocolHolderFactory
- All Implemented Interfaces:
BabelProtocolHolderFactory
public final class DedicatedExecutorProtocolHolderFactory
extends Object
implements BabelProtocolHolderFactory
Factory for creating
DedicatedExecutorProtocolHolder instances.
Each protocol registered with this factory receives a dedicated single-threaded executor and an isolated event queue of the specified capacity.
-
Constructor Summary
ConstructorsConstructorDescriptionDedicatedExecutorProtocolHolderFactory(int maxQueueCapacity) Constructs a factory with the specified maximum queue capacity per protocol. -
Method Summary
Modifier and TypeMethodDescriptioncreateInstance(BabelProtocol protocol, Set<ProtocolExtension<? extends BabelProtocol>> extensions) Creates a newBabelProtocolHolderwrapping the given protocol and extensions.
-
Constructor Details
-
DedicatedExecutorProtocolHolderFactory
public DedicatedExecutorProtocolHolderFactory(int maxQueueCapacity) Constructs a factory with the specified maximum queue capacity per protocol.- Parameters:
maxQueueCapacity- the maximum number of events permitted in each protocol's queue
-
-
Method Details
-
createInstance
public BabelProtocolHolder createInstance(BabelProtocol protocol, Set<ProtocolExtension<? extends BabelProtocol>> extensions) Description copied from interface:BabelProtocolHolderFactoryCreates a newBabelProtocolHolderwrapping the given protocol and extensions.- Specified by:
createInstancein interfaceBabelProtocolHolderFactory- Parameters:
protocol- the protocol instance to wrapextensions- the set of protocol extensions configured for the protocol- Returns:
- a new
BabelProtocolHoldermanaging the protocol
-