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 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

      ReplicableCommand fromStream(byte commandId)
      Construct and initialize a ReplicableCommand based on the command id.
      Parameters:
      commandId - command id to construct
      Returns:
      a ReplicableCommand
    • fromStream

      CacheRpcCommand fromStream(byte commandId, ByteString cacheName)
      Construct and initialize a CacheRpcCommand based on the command id.
      Parameters:
      commandId - command id to construct
      cacheName - cache name at which command to be created is directed
      Returns:
      a CacheRpcCommand