org.jboss.cache.commands
Interface ReversibleCommand

All Superinterfaces:
Cloneable, DataCommand, ReplicableCommand, VisitableCommand
All Known Subinterfaces:
VersionedDataCommand
All Known Implementing Classes:
AbstractVersionedDataCommand, CreateNodeCommand, EvictCommand, InvalidateCommand, MoveCommand, PutDataMapCommand, PutKeyValueCommand, RemoveDataCommand, RemoveKeyCommand, RemoveNodeCommand

public interface ReversibleCommand
extends DataCommand

A reversible command is one that can be rolled back. Also typically has a reference to a GlobalTransaction.

Since:
2.2.0
Author:
Mircea.Markus@jboss.com, Manik Surtani (manik@jboss.org)

Method Summary
 GlobalTransaction getGlobalTransaction()
           
 void rollback()
          Reverses a command that has already been invoked.
 void setGlobalTransaction(GlobalTransaction gtx)
          Sets a GlobalTransaction on this command.
 
Methods inherited from interface org.jboss.cache.commands.DataCommand
getFqn
 
Methods inherited from interface org.jboss.cache.commands.VisitableCommand
acceptVisitor
 
Methods inherited from interface org.jboss.cache.commands.ReplicableCommand
getCommandId, getParameters, perform, setParameters
 

Method Detail

rollback

void rollback()
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.


getGlobalTransaction

GlobalTransaction getGlobalTransaction()
Returns:
a GlobalTransaction associated with this command.

setGlobalTransaction

void setGlobalTransaction(GlobalTransaction gtx)
Sets a GlobalTransaction on this command.

Parameters:
gtx - global transaction to set


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