IBM WebSphere Application ServerTM
Release 8

com.ibm.websphere.cache
Interface EntryInfo

All Known Subinterfaces:
FragmentInfo, JAXRPCEntryInfo

public interface EntryInfo

EntryInfo and FragmentInfo objects contain metadata for caching and are attached to each cache entry. IdGenerators and MetaDataGenerators use these interfaces to define the caching metadata for an entry.

Typically a Id/MetaDataGenerator will get an entry's FragmentInfo object from the ServletCacheRequest, and use the object's set methods to configure that entry.

The following is a summary of the caching metadata for a CacheEntry:


Field Summary
static int NOT_SHARED
          The entry is kept local to the JVM that executed the entry's JSP or command instead of shared across all JVMs.
static int SHARED_PULL
          Deprecated. Share type PULL should not be used in new code development. Use share type PUSH_PULL instead. Share type PULL, if used in existing code, will function like share type PUSH_PULL.
static int SHARED_PUSH
          The entry is shared across multiple JVMs; the entry is pushed to all JVMs after its JSP or command is executed instead of waiting for the JVMs to pull it.
static int SHARED_PUSH_PULL
          The entry is shared across multiple JVMs; the ID of the entry is pushed on initial creation (execution of JSP/Servlet or command) and stored in the other JVMs.
 
Method Summary
 void addAlias(java.lang.Object alias)
          Adds a new alias ID.
 void addDataId(java.lang.String dataId)
          Adds a new data ID.
 void addTemplate(java.lang.String template)
          Adds a template.
 java.util.Enumeration getAliasList()
          Returns the alias IDs set on this entry info.
 int getCacheType()
          Returns cache type (CACHE_TYPE_DEFAULT or CACHE_TYPE_JAXRPC)
 java.util.Enumeration getDataIds()
          Returns the data IDs set on this entry info.
 long getExpirationTime()
          Returns the expiration time.
 java.lang.String getId()
          Returns the string representation of cache ID.
 java.lang.Object getIdObject()
          Returns the object representation of cache ID.
 int getInactivity()
          Returns the inactiviy timer.
 boolean getPersistToDisk()
          Determine whether persist-to-disk is true.
 int getPriority()
          Returns the priority.
 int getSharingPolicy()
          Returns the sharing policy in the sharingPolicy variable.
 java.lang.String getTemplate()
          Returns one of the templates set on this entry info.
 java.util.Enumeration getTemplates()
          Returns the templates set on this entry info.
 int getTimeLimit()
          Returns the time limit.
 java.lang.Object getUserMetaData()
          Returns the userMetaData.
 long getValidatorExpirationTime()
          Returns the validator expiration time of the entry in the cache The validator expiration time along with the expiration time control the state of the entry in the cache.
 boolean isBatchEnabled()
          Deprecated. The updates for Push or Push-Pull sharing policies are always done in an asynchronous batch mode. It always returns true.
 boolean isNotShared()
          Determines whether the sharingPolicy is EntryInfo.NOT_SHARED.
 boolean isSharedPull()
          Determines whether the sharingPolicy is EntryInfo.SHARED_PULL.
 boolean isSharedPush()
          Determines whether the sharingPolicy is EntryInfo.SHARED_PUSH.
 void setBatchEnabled(boolean flag)
          Deprecated. The updates for Push or Push-Pull sharing policies are always done in an asynchronous batch mode. Calling setBatchEnabled(false) has no effect on cache replication.
 void setExpirationTime(long expirationTime)
          Assigns new expiration time.
 void setId(java.lang.String id)
          Sets the cache ID.
 void setInactivity(int inactivity)
          Assigns the inactivity timer.
 void setPersistToDisk(boolean persistToDisk)
          Sets the persist-to-disk.
 void setPriority(int priority)
          Assigns the new priority.
 void setSharingPolicy(int policy)
          Sets the sharing policy.
 void setTimeLimit(int timeLimit)
          Assigns the time limit.
 void setUserMetaData(java.lang.Object userMetaData)
          Assigns the new userMetaData.
 

Field Detail

NOT_SHARED

static final int NOT_SHARED
The entry is kept local to the JVM that executed the entry's JSP or command instead of shared across all JVMs. This option is useful when there is affinity between a client and web application server and the data is only used by that client (e.g., a shopping cart).

See Also:
Constant Field Values

SHARED_PUSH

static final int SHARED_PUSH
The entry is shared across multiple JVMs; the entry is pushed to all JVMs after its JSP or command is executed instead of waiting for the JVMs to pull it. Pushing these entries is delayed for a short time (which is configurable) to exploit the efficiency of batching several entries in one message. This option is useful when the entry is very heavily used by all clients (e.g., a popular product display).

See Also:
Constant Field Values

SHARED_PULL

static final int SHARED_PULL
Deprecated. Share type PULL should not be used in new code development. Use share type PUSH_PULL instead. Share type PULL, if used in existing code, will function like share type PUSH_PULL.
The entry is shared across multiple JVMs; other JVMs get it by pulling it when needed and then storing it in its local cache for further requests. This option is useful when the entry is shared by all clients but is not accessed often enough between invalidations to warrant pushing it to other (e.g., a not-so-popular product display).

See Also:
Constant Field Values

SHARED_PUSH_PULL

static final int SHARED_PUSH_PULL
The entry is shared across multiple JVMs; the ID of the entry is pushed on initial creation (execution of JSP/Servlet or command) and stored in the other JVMs. If the actual entry is requested, other JVMs first look to see if the ID has been broadcasted previously before making a remote request for it.

See Also:
Constant Field Values
Method Detail

getId

java.lang.String getId()
Returns the string representation of cache ID.

Returns:
The string representation of cache ID..

getIdObject

java.lang.Object getIdObject()
Returns the object representation of cache ID.

Returns:
The object representation of cache ID.

setId

void setId(java.lang.String id)
Sets the cache ID.

Parameters:
id - The cache ID.

isBatchEnabled

boolean isBatchEnabled()
Deprecated. The updates for Push or Push-Pull sharing policies are always done in an asynchronous batch mode. It always returns true.

Determines whether updates (when sharing is PUSH) are sent immediately or in an asynchronous batch fashion

Returns:
True if updates are done in a batch

setBatchEnabled

void setBatchEnabled(boolean flag)
Deprecated. The updates for Push or Push-Pull sharing policies are always done in an asynchronous batch mode. Calling setBatchEnabled(false) has no effect on cache replication.

Sets whether updates (when sharing is PUSH) are sent immediately or in an asynchronous batch fashion

Parameters:
flag - true to enable batch updates, false otherwise.

getSharingPolicy

int getSharingPolicy()
Returns the sharing policy in the sharingPolicy variable.

Returns:
The sharing policy.
See Also:
EntryInfo

getPersistToDisk

boolean getPersistToDisk()
Determine whether persist-to-disk is true.

Returns:
True if this entry persists to disk.

setSharingPolicy

void setSharingPolicy(int policy)
Sets the sharing policy.

Parameters:
policy - The sharing policy.
See Also:
EntryInfo

setPersistToDisk

void setPersistToDisk(boolean persistToDisk)
Sets the persist-to-disk. If disk cache offload is enabled and persist-to-disk is true, the entry will be offloaded to the disk.

Parameters:
persistToDisk - The persist-to-disk.

isNotShared

boolean isNotShared()
Determines whether the sharingPolicy is EntryInfo.NOT_SHARED.

Returns:
True indicates that the sharingPolicy is EntryInfo.NOT_SHARED.

isSharedPush

boolean isSharedPush()
Determines whether the sharingPolicy is EntryInfo.SHARED_PUSH.

Returns:
True indicates that the sharingPolicy is EntryInfo.SHARED_PUSH or EntryInfo.SHARED_PUSH_PULL.

isSharedPull

boolean isSharedPull()
Determines whether the sharingPolicy is EntryInfo.SHARED_PULL.

Returns:
True indicates that the sharingPolicy is EntryInfo.SHARED_PULL or EntryInfo.SHARED_PUSH_PULL.

getTimeLimit

int getTimeLimit()
Returns the time limit.

Returns:
The time limit.

setTimeLimit

void setTimeLimit(int timeLimit)
Assigns the time limit. Once an entry is cached, it will remain in the cache for this many seconds

Parameters:
timeLimit - The time limit.

getInactivity

int getInactivity()
Returns the inactiviy timer.

Returns:
The inactivity timer.

setInactivity

void setInactivity(int inactivity)
Assigns the inactivity timer. Once an entry is cached, it will remain in the cache for this many seconds if not accessed.

Parameters:
inactivity - This inactivity timer.

getExpirationTime

long getExpirationTime()
Returns the expiration time.

Returns:
The expiration time.

setExpirationTime

void setExpirationTime(long expirationTime)
Assigns new expiration time.

Parameters:
expirationTime - The new expiration time.

getPriority

int getPriority()
Returns the priority.

Returns:
The priority.

setPriority

void setPriority(int priority)
Assigns the new priority.

Parameters:
priority - The new priority.

getTemplates

java.util.Enumeration getTemplates()
Returns the templates set on this entry info.

Returns:
An Enumeration of the template names.

getTemplate

java.lang.String getTemplate()
Returns one of the templates set on this entry info.

Returns:
A template name.

addTemplate

void addTemplate(java.lang.String template)
Adds a template.

Parameters:
template - The new Template name.

getDataIds

java.util.Enumeration getDataIds()
Returns the data IDs set on this entry info.

Returns:
The Enumeration of data IDs.

addDataId

void addDataId(java.lang.String dataId)
Adds a new data ID.

Parameters:
dataId - The new data ID.

getAliasList

java.util.Enumeration getAliasList()
Returns the alias IDs set on this entry info.

Returns:
The Enumeration of alias IDs.

addAlias

void addAlias(java.lang.Object alias)
Adds a new alias ID.

Parameters:
alias - The new alias ID.

getUserMetaData

java.lang.Object getUserMetaData()
Returns the userMetaData.

Returns:
The userMetaData.

setUserMetaData

void setUserMetaData(java.lang.Object userMetaData)
Assigns the new userMetaData.

Parameters:
userMetaData - The new userMetaData.

getValidatorExpirationTime

long getValidatorExpirationTime()
Returns the validator expiration time of the entry in the cache The validator expiration time along with the expiration time control the state of the entry in the cache.

Returns:
long the current validator expiration time in milliseconds

getCacheType

int getCacheType()
Returns cache type (CACHE_TYPE_DEFAULT or CACHE_TYPE_JAXRPC)

Returns:
cache type

IBM WebSphere Application ServerTM
Release 8