org.jboss.cache.commands.write
Class InvalidateCommand
java.lang.Object
org.jboss.cache.commands.read.AbstractDataCommand
org.jboss.cache.commands.write.AbstractVersionedDataCommand
org.jboss.cache.commands.write.EvictCommand
org.jboss.cache.commands.write.InvalidateCommand
- All Implemented Interfaces:
- Cloneable, DataCommand, ReplicableCommand, ReversibleCommand, VersionedDataCommand, VisitableCommand
public class InvalidateCommand
- extends EvictCommand
Very much like an evict(), except that regardless of whether there is a child present, this call will never
remove the node from memory - just remove its contents.
Also, potentially throws a cache exception if data versioning is used and the node in memory has a newer data
version than what is passed in.
Finally, the data version of the in-memory node is updated to the version being evicted to prevent versions
going out of sync.
- Since:
- 2.2
- Author:
- Mircea.Markus@jboss.com
METHOD_ID
public static final int METHOD_ID
- See Also:
- Constant Field Values
InvalidateCommand
public InvalidateCommand(Fqn fqn)
InvalidateCommand
public InvalidateCommand()
initialize
public void initialize(TransactionManager txManager,
CacheSPI cacheSpi,
boolean optimistic)
perform
public Object perform(InvocationContext ctx)
- Performs an invalidation on a specified node
- Specified by:
perform in interface ReplicableCommand- Overrides:
perform in class EvictCommand
- Parameters:
ctx - invocation context
- Returns:
- null
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- Overrides:
acceptVisitor in class EvictCommand
- Parameters:
ctx - invocation contextvisitor - visitor to accept
- Returns:
- arbitrary return value
- Throws:
Throwable - in the event of problems
isVersioned
public boolean isVersioned()
- Description copied from interface:
VersionedDataCommand
- Has data version set? (i.e. not null)
- Specified by:
isVersioned in interface VersionedDataCommand- Overrides:
isVersioned in class AbstractVersionedDataCommand
- Returns:
- true if getDataVersion() would not return null; false otherwise.
isVersionedId
protected boolean isVersionedId(int id)
- Overrides:
isVersionedId in class EvictCommand
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- Overrides:
getCommandId in class EvictCommand
- Returns:
- the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.
toString
public String toString()
- Overrides:
toString in class EvictCommand
getParameters
public Object[] getParameters()
- Description copied from class:
AbstractDataCommand
- Basic versions of these methods
- Specified by:
getParameters in interface ReplicableCommand- Overrides:
getParameters in class EvictCommand
- 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 EvictCommand
- 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
Copyright © 2008 JBoss, a division of Red Hat. All Rights Reserved.