com.ibm.websphere.command
Interface CacheableCommand
All Superinterfaces:
All known implementing classes:
- public interface CacheableCommand
- extends TargetableCommand, CommandCaller
Field Summary
Fields inherited from interface com.ibm.websphere.command.Command |
---|
serialVersionUID |
Method Summary
Modifier and Type | Method and Description |
---|---|
|
executeFromCache()
executeFromCache This method will check the cache to see if the
given command is present.
|
getCaller()
Returns the object that called this command instance.
|
|
getEntryInfo()
This gets the EntryInfo object for this command, which
holds caching metadata.
|
|
|
getId()
This gets the cache id for the command.
|
|
getSharingPolicy()
This gets the sharing policy that dictates how distributed caching
is managed.
|
|
postExecute()
Allows the command writer to perform actions on the cache
after the execution, and potential caching, of the command.
|
|
preExecute()
Allows the command writer to perform actions on the cache
prior to the execution, and potential caching, of the command.
|
|
setCaller(CommandCaller caller)
This sets the caller object for a caller who is cached.
|
|
updateCache()
This method will cause the current command to be placed into the cache.
|
Methods inherited from interface com.ibm.websphere.command.TargetableCommand |
---|
getCommandTarget, getCommandTargetName, hasOutputProperties, performExecute, setCommandTarget, setCommandTargetName, setOutputProperties |
Methods inherited from interface com.ibm.websphere.command.Command |
---|
execute, isReadyToCallExecute, reset |
Methods inherited from interface com.ibm.websphere.command.CommandCaller |
---|
unionDependencies |
Method Detail
getId
- java.lang.String getId()
This gets the cache id for the command.
It typically has a simple relationship to the
command class and input properties.
However, it can involve any logic that can be invoked in the
command client's JVM.
Returns:
The cache id.
getSharingPolicy
- int getSharingPolicy()
This gets the sharing policy that dictates how distributed caching
is managed.
Returns:
Either EntryInfo.NOT_SHARED, EntryInfo.SHARED_PULL
or EntryInfo.SHARED_PUSH.
getEntryInfo
- EntryInfo getEntryInfo()
This gets the EntryInfo object for this command, which
holds caching metadata.
Returns:
The EntryInfo object.
preExecute
- boolean preExecute()
Allows the command writer to perform actions on the cache
prior to the execution, and potential caching, of the command.
Returns:
True implies that the command's execution should be
terminated, so the performExecute, postExecute and setCommand
will not happen.
postExecute
- void postExecute()
Allows the command writer to perform actions on the cache
after the execution, and potential caching, of the command.
Such actions might include invalidation of commands
made invalid by execution of this command.
setCaller
- void setCaller(CommandCaller caller)
This sets the caller object for a caller who is cached.
The caller can be another command or a JSP.
The caller must support the CommandCaller interface.
It allows invalidation dependencies to be added to the caller.
The caller of a command must call this method on the command some time after creating the new command instance, but before calling the execute() method.
Parameters:
caller
- The command that called this command. getCaller
- CommandCaller getCaller()
Returns the object that called this command instance.
The caller can be another command or a JSP.
The caller must support the CommandCaller interface.
It is used by this command to add invalidation dependencies
to the caller.
The caller must be explicitly set using the setCaller method.
Returns:
The caller of the command.
executeFromCache
- boolean executeFromCache()
- throws CommandException
executeFromCache This method will check the cache to see if the
given command is present. If so then the command is populated with the
cached results and true is returned. If the command is not cached, then
false is returned and no change is made to the state of the command.
updateCache
- void updateCache()
This method will cause the current command to be placed into the cache.
Any existing entry with the same cache id will be replaced.