org.jboss.cache.commands.write
Class CreateNodeCommand
java.lang.Object
org.jboss.cache.commands.read.AbstractDataCommand
org.jboss.cache.commands.write.CreateNodeCommand
- All Implemented Interfaces:
- Cloneable, DataCommand, ReplicableCommand, ReversibleCommand, VisitableCommand
public class CreateNodeCommand
- extends AbstractDataCommand
- implements ReversibleCommand
Command that creates a node. Primarily to be used as an undo command for removing nodes.
- Since:
- 2.2.0
- Author:
- Manik Surtani (manik@jboss.org)
METHOD_ID
public static final int METHOD_ID
- See Also:
- Constant Field Values
CreateNodeCommand
public CreateNodeCommand(Fqn fqn)
CreateNodeCommand
public CreateNodeCommand()
getCommandId
public int getCommandId()
- Description copied from interface:
ReplicableCommand
- Used by marshallers to convert this command into an id for streaming.
- Specified by:
getCommandId
in interface ReplicableCommand
- Returns:
- the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.
setGlobalTransaction
public void setGlobalTransaction(GlobalTransaction gtx)
- Description copied from interface:
ReversibleCommand
- Sets a GlobalTransaction on this command.
- Specified by:
setGlobalTransaction
in interface ReversibleCommand
- Parameters:
gtx
- global transaction to set
getGlobalTransaction
public GlobalTransaction getGlobalTransaction()
- Specified by:
getGlobalTransaction
in interface ReversibleCommand
- Returns:
- a GlobalTransaction associated with this command.
perform
public Object perform(InvocationContext ctx)
- Creates a node in the cache, specified by the given Fqn.
- Specified by:
perform
in interface ReplicableCommand
- Parameters:
ctx
- invocation context
- Returns:
- arbitrary return value generated by performing this command
acceptVisitor
public Object acceptVisitor(InvocationContext ctx,
Visitor visitor)
throws Throwable
- Description copied from interface:
VisitableCommand
- Accept a visitor, and return the result of accepting this visitor.
- Specified by:
acceptVisitor
in interface VisitableCommand
- Parameters:
ctx
- invocation contextvisitor
- visitor to accept
- Returns:
- arbitrary return value
- Throws:
Throwable
- in the event of problems
rollback
public void rollback()
- Description copied from interface:
ReversibleCommand
- Reverses a command that has already been invoked.
Important: this method will be invoked at the end of interceptors chain. It should never be called directly from
a custom interceptor.
- Specified by:
rollback
in interface ReversibleCommand
toString
public String toString()
- Overrides:
toString
in class AbstractDataCommand
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.