public class RemoveExpiredCommand extends RemoveCommand
| Modifier and Type | Field and Description |
|---|---|
static int |
COMMAND_ID |
protected Long |
lifespan |
protected TimeService |
timeService |
notifier, value, valueEquivalence, valueMatchercommandInvocationIdkeyflags| Constructor and Description |
|---|
RemoveExpiredCommand() |
RemoveExpiredCommand(Object key,
Object value,
Long lifespan,
CacheNotifier notifier,
Equivalence valueEquivalence,
TimeService timeService,
CommandInvocationId commandInvocationId) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
Set<Flag> |
getFlags() |
boolean |
hasFlag(Flag flag)
Check whether a particular flag is present in the command
|
int |
hashCode() |
boolean |
ignoreCommandOnStatus(ComponentStatus status)
Similar to
VisitableCommand.shouldInvoke(InvocationContext) but evaluated by InvocationContextInterceptor. |
void |
init(CacheNotifier notifier,
Configuration configuration,
TimeService timeService) |
boolean |
isConditional()
Certain commands only work based on a certain condition or state of the cache.
|
void |
notify(InvocationContext ctx,
Object removedValue,
Metadata removedMetadata,
boolean isPre) |
Object |
perform(InvocationContext ctx)
Performs an expiration on a specified entry
|
void |
readFrom(ObjectInput input)
Reads this instance from the stream written by
ReplicableCommand.writeTo(ObjectOutput). |
String |
toString() |
void |
writeTo(ObjectOutput output)
Writes this instance to the
ObjectOutput. |
acceptVisitor, getValue, getValueMatcher, init, isNonExistent, isReturnValueExpected, isSuccessful, performRemove, readsExistingValues, setValue, setValueMatcher, updateStatusFromRemoteResponsecanBlock, getAffectedKeys, getKeyLockOwner, getKeysToLock, hasSkipLocking, hasZeroLockAcquisitiongetKey, setKey, shouldInvokegetMetadata, getTopologyId, setMetadata, setTopologyIdsetFlagsclone, finalize, getClass, notify, notifyAll, wait, wait, waitisWriteOnlyalwaysReadsExistingValues, shouldInvokegetTopologyId, setTopologyIdgetParameters, setParametersgetMetadata, setMetadataaddFlag, addFlags, setFlags, setFlagsgetKeypublic static final int COMMAND_ID
protected Long lifespan
protected TimeService timeService
public RemoveExpiredCommand()
public RemoveExpiredCommand(Object key, Object value, Long lifespan, CacheNotifier notifier, Equivalence valueEquivalence, TimeService timeService, CommandInvocationId commandInvocationId)
public void init(CacheNotifier notifier, Configuration configuration, TimeService timeService)
public Object perform(InvocationContext ctx) throws Throwable
perform in interface ReplicableCommandperform in class RemoveCommandctx - invocation contextThrowable - in the event of problems.public boolean isConditional()
WriteCommandConcurrentMap.putIfAbsent(Object, Object) only does anything if a condition is met, i.e., the entry in
question is not already present. This method tests whether the command in question is conditional or not.isConditional in interface WriteCommandisConditional in class RemoveCommandpublic void notify(InvocationContext ctx, Object removedValue, Metadata removedMetadata, boolean isPre)
notify in class RemoveCommandpublic byte getCommandId()
ReplicableCommandgetCommandId in interface ReplicableCommandgetCommandId in class RemoveCommandpublic String toString()
toString in class RemoveCommandpublic void writeTo(ObjectOutput output) throws IOException
ReplicableCommandObjectOutput.writeTo in interface ReplicableCommandwriteTo in class RemoveCommandoutput - the stream.IOException - if an error occurred during the I/O.public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
ReplicableCommandReplicableCommand.writeTo(ObjectOutput).readFrom in interface ReplicableCommandreadFrom in class RemoveCommandinput - the stream to read.IOException - if an error occurred during the I/O.ClassNotFoundException - if it tries to load an undefined class.public boolean ignoreCommandOnStatus(ComponentStatus status)
VisitableCommandVisitableCommand.shouldInvoke(InvocationContext) but evaluated by InvocationContextInterceptor.
Commands can opt to be discarded in case the cache status is not suited (as InvalidateCommand)ignoreCommandOnStatus in interface VisitableCommandignoreCommandOnStatus in class RemoveCommandpublic boolean equals(Object o)
equals in class RemoveCommandpublic int hashCode()
hashCode in class RemoveCommandpublic Set<Flag> getFlags()
getFlags in interface LocalFlagAffectedCommandgetFlags in class AbstractLocalFlagAffectedCommandLocalFlagAffectedCommand.setFlags(java.util.Set). The set should
not be modified directly, only via the LocalFlagAffectedCommand.setFlags(Set), LocalFlagAffectedCommand.addFlag(Flag) and LocalFlagAffectedCommand.addFlags(Set) methods.public boolean hasFlag(Flag flag)
LocalFlagAffectedCommandflag - to lookup in the commandCopyright © 2025 JBoss, a division of Red Hat. All rights reserved.