Interface CommandsFactory

All Known Implementing Classes:
CommandsFactoryImpl

public interface CommandsFactory
A factory to build commands, initializing and injecting dependencies accordingly. Commands built for a specific, named cache instance cannot be reused on a different cache instance since most commands contain the cache name it was built for along with references to other named-cache scoped components.

Commands returned by the various build*Command methods should be initialised sufficiently for local execution via the interceptor chain, with no calls to initializeReplicableCommand(ReplicableCommand, boolean) required. However, for remote execution, it's assumed that a command will be initialized via initializeReplicableCommand(ReplicableCommand, boolean) before being invoked.

Note, InitializableCommand implementations should not rely on access to the ComponentRegistry in their constructors for local execution initialization as this leads to duplicated code. Instead implementations of this interface should call InitializableCommand.init(ComponentRegistry, boolean) before returning the created command.

Since:
4.0
Author:
Manik Surtani, [email protected], Galder ZamarreƱo