org.infinispan.commands
Class RemoteCommandsFactory

java.lang.Object
  extended by org.infinispan.commands.RemoteCommandsFactory

public class RemoteCommandsFactory
extends Object

Specifically used to create un-initialized ReplicableCommands from a byte stream. This is a Scopes.GLOBAL component and doesn't have knowledge of initializing a command by injecting cache-specific components into it.

Usually a second step to unmarshalling a command from a byte stream (after creating an un-initialized version using this factory) is to pass the command though CommandsFactory.initializeReplicableCommand(ReplicableCommand,boolean).

Since:
4.0
Author:
Manik Surtani, Mircea.Markus@jboss.com
See Also:
CommandsFactory.initializeReplicableCommand(ReplicableCommand,boolean)

Constructor Summary
RemoteCommandsFactory()
           
 
Method Summary
 ReplicableCommand fromStream(byte id, Object[] parameters, byte type)
          Creates an un-initialized command.
 CacheRpcCommand fromStream(byte id, Object[] parameters, byte type, String cacheName)
          Resolve an CacheRpcCommand from the stream.
 void inject(EmbeddedCacheManager cacheManager, GlobalComponentRegistry registry, Map<Byte,ModuleCommandFactory> commandFactories)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteCommandsFactory

public RemoteCommandsFactory()
Method Detail

inject

public void inject(EmbeddedCacheManager cacheManager,
                   GlobalComponentRegistry registry,
                   Map<Byte,ModuleCommandFactory> commandFactories)

fromStream

public ReplicableCommand fromStream(byte id,
                                    Object[] parameters,
                                    byte type)
Creates an un-initialized command. Un-initialized in the sense that parameters will be set, but any components specific to the cache in question will not be set.

You would typically set these parameters using CommandsFactory.initializeReplicableCommand(ReplicableCommand,boolean)

Parameters:
id - id of the command
parameters - parameters to set
type -
Returns:
a replicable command

fromStream

public CacheRpcCommand fromStream(byte id,
                                  Object[] parameters,
                                  byte type,
                                  String cacheName)
Resolve an CacheRpcCommand from the stream.

Parameters:
id - id of the command
parameters - parameters to be set
type - type of command (whether internal or user defined)
cacheName - cache name at which this command is directed
Returns:
an instance of CacheRpcCommand

-->

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