org.infinispan.commands.write
Class InvalidateCommand

java.lang.Object
  extended by org.infinispan.commands.AbstractFlagAffectedCommand
      extended by org.infinispan.commands.read.AbstractDataCommand
          extended by org.infinispan.commands.write.AbstractDataWriteCommand
              extended by org.infinispan.commands.write.RemoveCommand
                  extended by org.infinispan.commands.write.InvalidateCommand
All Implemented Interfaces:
DataCommand, FlagAffectedCommand, ReplicableCommand, VisitableCommand, DataWriteCommand, WriteCommand
Direct Known Subclasses:
InvalidateL1Command

public class InvalidateCommand
extends RemoveCommand

Removes an entry from memory.

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

Field Summary
static int COMMAND_ID
           
protected  Object[] keys
           
 
Fields inherited from class org.infinispan.commands.write.RemoveCommand
notifier, value
 
Fields inherited from class org.infinispan.commands.read.AbstractDataCommand
key
 
Fields inherited from class org.infinispan.commands.AbstractFlagAffectedCommand
flags
 
Constructor Summary
InvalidateCommand()
           
InvalidateCommand(CacheNotifier notifier, Collection<Object> keys)
           
InvalidateCommand(CacheNotifier notifier, Object... keys)
           
 
Method Summary
 Object acceptVisitor(InvocationContext ctx, Visitor visitor)
          Accept a visitor, and return the result of accepting this visitor.
 boolean equals(Object o)
           
 byte getCommandId()
          Used by marshallers to convert this command into an id for streaming.
 Object getKey()
           
 Object[] getKeys()
           
 Object[] getParameters()
          Used by marshallers to stream this command across a network
 int hashCode()
           
 boolean ignoreCommandOnStatus(ComponentStatus status)
          Similar to VisitableCommand.shouldInvoke(InvocationContext) but evaluated by InvocationContextInterceptor.
protected  void invalidate(InvocationContext ctx, Object keyToInvalidate)
           
protected  void notify(InvocationContext ctx, Object value, boolean isPre)
           
 Object perform(InvocationContext ctx)
          Performs an invalidation on a specified entry
 void setParameters(int commandId, Object[] args)
          Used by the CommandsFactory to create a command from raw data read off a stream.
 String toString()
           
 
Methods inherited from class org.infinispan.commands.write.RemoveCommand
init, isConditional, isNonExistent, isSuccessful
 
Methods inherited from class org.infinispan.commands.write.AbstractDataWriteCommand
getAffectedKeys, isReturnValueExpected
 
Methods inherited from class org.infinispan.commands.read.AbstractDataCommand
setKey, shouldInvoke
 
Methods inherited from class org.infinispan.commands.AbstractFlagAffectedCommand
getFlags, hasFlag, setFlags
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.infinispan.commands.FlagAffectedCommand
getFlags, hasFlag, setFlags
 
Methods inherited from interface org.infinispan.commands.VisitableCommand
shouldInvoke
 

Field Detail

COMMAND_ID

public static final int COMMAND_ID
See Also:
Constant Field Values

keys

protected Object[] keys
Constructor Detail

InvalidateCommand

public InvalidateCommand()

InvalidateCommand

public InvalidateCommand(CacheNotifier notifier,
                         Object... keys)

InvalidateCommand

public InvalidateCommand(CacheNotifier notifier,
                         Collection<Object> keys)
Method Detail

perform

public Object perform(InvocationContext ctx)
               throws Throwable
Performs an invalidation on a specified entry

Specified by:
perform in interface ReplicableCommand
Overrides:
perform in class RemoveCommand
Parameters:
ctx - invocation context
Returns:
null
Throws:
Throwable - in the event of problems.

invalidate

protected void invalidate(InvocationContext ctx,
                          Object keyToInvalidate)
                   throws Throwable
Throws:
Throwable

notify

protected void notify(InvocationContext ctx,
                      Object value,
                      boolean isPre)
Overrides:
notify in class RemoveCommand

getCommandId

public byte 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 RemoveCommand
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 RemoveCommand

getParameters

public Object[] getParameters()
Description copied from interface: ReplicableCommand
Used by marshallers to stream this command across a network

Specified by:
getParameters in interface ReplicableCommand
Overrides:
getParameters in class RemoveCommand
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 interface: ReplicableCommand
Used by the CommandsFactory to create a command from raw data read off a stream.

Specified by:
setParameters in interface ReplicableCommand
Overrides:
setParameters in class RemoveCommand
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

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 RemoveCommand
Parameters:
ctx - invocation context
visitor - visitor to accept
Returns:
arbitrary return value
Throws:
Throwable - in the event of problems

getKey

public Object getKey()
Specified by:
getKey in interface DataCommand
Overrides:
getKey in class AbstractDataCommand

getKeys

public Object[] getKeys()

ignoreCommandOnStatus

public boolean ignoreCommandOnStatus(ComponentStatus status)
Description copied from interface: VisitableCommand
Similar to VisitableCommand.shouldInvoke(InvocationContext) but evaluated by InvocationContextInterceptor. Commands can opt to be discarded in case the cache status is not suited (as InvalidateCommand)

Specified by:
ignoreCommandOnStatus in interface VisitableCommand
Overrides:
ignoreCommandOnStatus in class RemoveCommand
Returns:
true if the command should NOT be invoked.

equals

public boolean equals(Object o)
Overrides:
equals in class RemoveCommand

hashCode

public int hashCode()
Overrides:
hashCode in class RemoveCommand

-->

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