org.infinispan.commands.module
Interface ModuleCommandFactory

All Known Subinterfaces:
ExtendedModuleCommandFactory
All Known Implementing Classes:
CommandFactory

public interface ModuleCommandFactory

Modules which wish to implement their own commands and visitors must also provide an implementation of this interface and declare it in their infinispan-module.properties file under key infinispan.module.command.factory.

Implementations must be public classes with a public, no-arg constructor for instantiation.

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
 ReplicableCommand fromStream(byte commandId, Object[] args)
          Construct and initialize a ReplicableCommand based on the command id and argument array passed in.
 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.
 

Method Detail

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,
                             Object[] args)
Construct and initialize a ReplicableCommand based on the command id and argument array passed in.

Parameters:
commandId - command id to construct
args - array of arguments with which to initialize the ReplicableCommand
Returns:
a ReplicableCommand

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.