org.jboss.cache.commands.write
Class EvictCommand

java.lang.Object
  extended by org.jboss.cache.commands.read.AbstractDataCommand
      extended by org.jboss.cache.commands.write.EvictCommand
All Implemented Interfaces:
DataCommand, ReplicableCommand, VisitableCommand
Direct Known Subclasses:
LegacyEvictCommand

public class EvictCommand
extends AbstractDataCommand

Implements functionality defined by Cache.evict(org.jboss.cache.Fqn)

Since:
2.2
Author:
Mircea.Markus@jboss.com

Field Summary
protected static org.apache.commons.logging.Log log
           
static int METHOD_ID
           
protected  Notifier notifier
           
protected static boolean trace
           
static int VERSIONED_METHOD_ID
           
 
Fields inherited from class org.jboss.cache.commands.read.AbstractDataCommand
dataContainer, fqn
 
Constructor Summary
EvictCommand()
           
EvictCommand(Fqn fqn)
           
 
Method Summary
 Object acceptVisitor(InvocationContext ctx, Visitor visitor)
          Accept a visitor, and return the result of accepting this visitor.
protected  boolean evictNode(Fqn fqn, InvocationContext ctx, NodeSPI node)
           
 int getCommandId()
          Used by marshallers to convert this command into an id for streaming.
 List<Fqn> getNodesToEvict()
           
 Object[] getParameters()
          Basic versions of these methods
protected  Collection<Fqn> getRecursiveEvictionNodes()
           
 void initialize(Notifier notifier, DataContainer dataContainer)
           
 boolean isRecursive()
           
protected  NodeSPI lookupForEviction(InvocationContext ctx, Fqn fqn)
           
 Object perform(InvocationContext ctx)
          Evicts a node.
 void rollback()
           
 void setNodesToEvict(List<Fqn> nodesToEvict)
           
 void setParameters(int commandId, Object[] args)
          Basic versions of these methods
 void setRecursive(boolean recursive)
           
 String toString()
           
 
Methods inherited from class org.jboss.cache.commands.read.AbstractDataCommand
equals, getFqn, hashCode, initialize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

METHOD_ID

public static final int METHOD_ID
See Also:
Constant Field Values

VERSIONED_METHOD_ID

public static final int VERSIONED_METHOD_ID
See Also:
Constant Field Values

notifier

protected Notifier notifier

log

protected static final org.apache.commons.logging.Log log

trace

protected static final boolean trace
Constructor Detail

EvictCommand

public EvictCommand(Fqn fqn)

EvictCommand

public EvictCommand()
Method Detail

initialize

public void initialize(Notifier notifier,
                       DataContainer dataContainer)

getNodesToEvict

public List<Fqn> getNodesToEvict()

setNodesToEvict

public void setNodesToEvict(List<Fqn> nodesToEvict)

perform

public Object perform(InvocationContext ctx)
Evicts a node.

See EvictionInterceptor.visitEvictFqnCommand(org.jboss.cache.InvocationContext , EvictCommand) which is where the return value is used

Parameters:
ctx - invocation context
Returns:
true if the node is now absent from the cache. Returns false if the node still exists; i.e. was only data removed because it still has children.

getRecursiveEvictionNodes

protected Collection<Fqn> getRecursiveEvictionNodes()

evictNode

protected boolean evictNode(Fqn fqn,
                            InvocationContext ctx,
                            NodeSPI node)

lookupForEviction

protected NodeSPI lookupForEviction(InvocationContext ctx,
                                    Fqn fqn)

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.

Parameters:
ctx - invocation context
visitor - visitor to accept
Returns:
arbitrary return value
Throws:
Throwable - in the event of problems

getCommandId

public int getCommandId()
Description copied from interface: ReplicableCommand
Used by marshallers to convert this command into an id for streaming.

Returns:
the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.

isRecursive

public boolean isRecursive()

setRecursive

public void setRecursive(boolean recursive)

getParameters

public Object[] getParameters()
Description copied from class: AbstractDataCommand
Basic versions of these methods

Specified by:
getParameters in interface ReplicableCommand
Overrides:
getParameters in class AbstractDataCommand
Returns:
an object array of arguments, compatible with pre-2.2.0 MethodCall args.

setParameters

public void setParameters(int commandId,
                          Object[] args)
Description copied from class: AbstractDataCommand
Basic versions of these methods

Specified by:
setParameters in interface ReplicableCommand
Overrides:
setParameters in class AbstractDataCommand
Parameters:
commandId - command id to set. This is usually unused but *could* be used in the event of a command having multiple IDs, such as PutKeyValueCommand.
args - object array of args

toString

public String toString()
Overrides:
toString in class AbstractDataCommand

rollback

public void rollback()


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