org.infinispan.commands.write
Class InvalidateL1Command

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
                      extended by org.infinispan.commands.write.InvalidateL1Command
All Implemented Interfaces:
DataCommand, FlagAffectedCommand, ReplicableCommand, VisitableCommand, DataWriteCommand, WriteCommand

public class InvalidateL1Command
extends InvalidateCommand

Invalidates an entry in a L1 cache (used with DIST mode)

Since:
4.0
Author:
Manik Surtani, Mircea.Markus@jboss.com

Field Summary
static int COMMAND_ID
           
 
Fields inherited from class org.infinispan.commands.write.InvalidateCommand
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
InvalidateL1Command()
           
InvalidateL1Command(Address writeOrigin, boolean forRehash, DataContainer dc, Configuration config, DistributionManager dm, CacheNotifier notifier, Collection<Object> keys)
           
InvalidateL1Command(boolean forRehash, DataContainer dc, Configuration config, DistributionManager dm, CacheNotifier notifier, Collection<Object> keys)
           
InvalidateL1Command(boolean forRehash, DataContainer dc, Configuration config, DistributionManager dm, 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[] getParameters()
          Used by marshallers to stream this command across a network
 int hashCode()
           
 void init(Configuration config, DistributionManager dm, CacheNotifier n, DataContainer dc)
           
 boolean isCausedByALocalWrite(Address address)
          Returns true if the write that caused the invalidation was performed on this node.
 Object perform(InvocationContext ctx)
          Performs an invalidation on a specified entry
 void setKeys(Object[] keys)
           
 void setParameters(int commandId, Object[] args)
          Used by the CommandsFactory to create a command from raw data read off a stream.
 boolean shouldInvoke(InvocationContext ctx)
          Used by the InboundInvocationHandler to determine whether the command should be invoked or not.
 String toString()
           
 
Methods inherited from class org.infinispan.commands.write.InvalidateCommand
getKey, getKeys, ignoreCommandOnStatus, invalidate, notify
 
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
 
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
 

Field Detail

COMMAND_ID

public static final int COMMAND_ID
See Also:
Constant Field Values
Constructor Detail

InvalidateL1Command

public InvalidateL1Command()

InvalidateL1Command

public InvalidateL1Command(boolean forRehash,
                           DataContainer dc,
                           Configuration config,
                           DistributionManager dm,
                           CacheNotifier notifier,
                           Object... keys)

InvalidateL1Command

public InvalidateL1Command(boolean forRehash,
                           DataContainer dc,
                           Configuration config,
                           DistributionManager dm,
                           CacheNotifier notifier,
                           Collection<Object> keys)

InvalidateL1Command

public InvalidateL1Command(Address writeOrigin,
                           boolean forRehash,
                           DataContainer dc,
                           Configuration config,
                           DistributionManager dm,
                           CacheNotifier notifier,
                           Collection<Object> keys)
Method Detail

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 InvalidateCommand
Returns:
the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.

init

public void init(Configuration config,
                 DistributionManager dm,
                 CacheNotifier n,
                 DataContainer dc)

perform

public Object perform(InvocationContext ctx)
               throws Throwable
Description copied from class: InvalidateCommand
Performs an invalidation on a specified entry

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

setKeys

public void setKeys(Object[] keys)

shouldInvoke

public boolean shouldInvoke(InvocationContext ctx)
Description copied from interface: VisitableCommand
Used by the InboundInvocationHandler to determine whether the command should be invoked or not.

Specified by:
shouldInvoke in interface VisitableCommand
Overrides:
shouldInvoke in class AbstractDataCommand
Returns:
true if the command should be invoked, false otherwise.

equals

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

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

hashCode

public int hashCode()
Overrides:
hashCode in class InvalidateCommand

toString

public String toString()
Overrides:
toString in class InvalidateCommand

isCausedByALocalWrite

public boolean isCausedByALocalWrite(Address address)
Returns true if the write that caused the invalidation was performed on this node. More formal, if a put(k) happens on node A and ch(A)={B}, then an invalidation message might be multicasted by B to all cluster members including A. This method returns true if and only if the node where it is invoked is A.


-->

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