Class ConcurrentBroadcastCommandDispatcherFactory
java.lang.Object
org.wildfly.extension.messaging.activemq.broadcast.ConcurrentBroadcastCommandDispatcherFactory
- All Implemented Interfaces:
CommandDispatcherFactory<GroupMember>,Registrar<BroadcastReceiver>,BroadcastCommandDispatcherFactory,BroadcastReceiver,BroadcastReceiverRegistrar
public class ConcurrentBroadcastCommandDispatcherFactory
extends Object
implements BroadcastCommandDispatcherFactory
A
BroadcastCommandDispatcherFactory that returns the same CommandDispatcher instance for a given identifier.- Author:
- Paul Ferraro
-
Constructor Summary
ConstructorsConstructorDescriptionConcurrentBroadcastCommandDispatcherFactory(CommandDispatcherFactory<GroupMember> dispatcherFactory) -
Method Summary
Modifier and TypeMethodDescription<C> CommandDispatcher<GroupMember,C> createCommandDispatcher(Object id, C context) Creates a new command dispatcher using the specified identifier and context.<C> CommandDispatcher<GroupMember,C> createCommandDispatcher(Object id, C context, ClassLoader loader) Creates a new command dispatcher using the specified identifier and context whose marshaller will be configured from the specified class loader.getGroup()Returns the group upon which the this command dispatcher operates.voidreceive(byte[] data) Receives the specified broadcast data.register(BroadcastReceiver receiver) Registers an object.
-
Constructor Details
-
ConcurrentBroadcastCommandDispatcherFactory
public ConcurrentBroadcastCommandDispatcherFactory(CommandDispatcherFactory<GroupMember> dispatcherFactory)
-
-
Method Details
-
receive
public void receive(byte[] data) Description copied from interface:BroadcastReceiverReceives the specified broadcast data.- Specified by:
receivein interfaceBroadcastReceiver- Parameters:
data- broadcast data
-
register
Description copied from interface:RegistrarRegisters an object. The object is unregistered when the generatedRegistrationis closed.- Specified by:
registerin interfaceRegistrar<BroadcastReceiver>- Parameters:
receiver- an object to register- Returns:
- an object registration.
-
getGroup
Description copied from interface:CommandDispatcherFactoryReturns the group upon which the this command dispatcher operates.- Specified by:
getGroupin interfaceCommandDispatcherFactory<GroupMember>- Returns:
- a group
-
createCommandDispatcher
Description copied from interface:CommandDispatcherFactoryCreates a new command dispatcher using the specified identifier and context. The resultingCommandDispatcherwill communicate with those dispatchers within the group sharing the same identifier.- Specified by:
createCommandDispatcherin interfaceCommandDispatcherFactory<GroupMember>- Parameters:
id- a unique identifier for this dispatchercontext- the context used for executing commands- Returns:
- a new command dispatcher
-
createCommandDispatcher
public <C> CommandDispatcher<GroupMember,C> createCommandDispatcher(Object id, C context, ClassLoader loader) Description copied from interface:CommandDispatcherFactoryCreates a new command dispatcher using the specified identifier and context whose marshaller will be configured from the specified class loader. The resultingCommandDispatcherwill communicate with those dispatchers within the group sharing the same identifier.- Specified by:
createCommandDispatcherin interfaceCommandDispatcherFactory<GroupMember>- Parameters:
id- a unique identifier for this dispatchercontext- the context used for executing commandsloader- the class loader used to load commands to be dispatched.- Returns:
- a new command dispatcher
-