Package org.infinispan.commands.module
Interface ModuleCommandFactory
public interface ModuleCommandFactory
Modules which wish to implement their own commands and visitors must also provide an implementation of this
interface.
Note that this is a Scopes.GLOBAL component and as such cannot have Inject methods referring to
Scopes.NAMED_CACHE scoped components. For such components, use a corresponding Scopes.NAMED_CACHE-scoped ModuleCommandInitializer.
- Since:
- 5.0
- Author:
- Manik Surtani
-
Method Summary
Modifier and TypeMethodDescriptionfromStream(byte commandId) Construct and initialize aReplicableCommandbased on the command id.fromStream(byte commandId, ByteString cacheName) Construct and initialize aCacheRpcCommandbased on the command id.Map<Byte,Class<? extends ReplicableCommand>> Provides a map of command IDs to command types of all the commands handled by the command factory instance.
-
Method Details
-
getModuleCommands
Map<Byte,Class<? extends ReplicableCommand>> getModuleCommands()Provides a map of command IDs to command types of all the commands handled by the command factory instance. Unmarshalling requests for these command IDs will be dispatched to this implementation.- Returns:
- map of command IDs to command types handled by this implementation.
-
fromStream
Construct and initialize aReplicableCommandbased on the command id.- Parameters:
commandId- command id to construct- Returns:
- a ReplicableCommand
-
fromStream
Construct and initialize aCacheRpcCommandbased on the command id.- Parameters:
commandId- command id to constructcacheName- cache name at which command to be created is directed- Returns:
- a
CacheRpcCommand
-