com.ibm.websphere.servlet.cache
Interface EntryInfo

All Known Subinterfaces:
FragmentInfo

public interface EntryInfo

EntryInfo and FragmentInfo Objects 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
          The entry is shared across multiple JVMs.
static int SHARED_PUSH
          The entry is shared across multiple JVMs.
 
Method Summary
 void addDataId(java.lang.String dataId)
          This unions a new data id into the dataIds variable.
 java.util.Enumeration getDataIds()
          This gets the data ids from the dataIds variable.
 long getExpirationTime()
          This gets the expiration time from the expirationTime variable.
 java.lang.String getId()
          This gets the id variable.
 int getPriority()
          This gets the priority in the priority variable.
 int getSharingPolicy()
          This gets the sharing policy in the sharingPolicy variable.
 java.util.Enumeration getTemplates()
          This gets the templates in the templates variable.
 int getTimeLimit()
          This gets the time limit on this cache entry.
 boolean isNotShared()
          This determines whether the sharingPolicy is NOT_SHARED.
 boolean isSharedPull()
          This determines whether the sharingPolicy is SHARED_PULL.
 boolean isSharedPush()
          This determines whether the sharingPolicy is SHARED_PUSH.
 void setExpirationTime(long expirationTime)
          This sets the expirationTime variable.
 void setPriority(int priority)
          This assigns the new priority to the priority variable.
 void setTimeLimit(int timeLimit)
          This sets the time limit in the timeLimit variable.
 

Field Detail

NOT_SHARED

public 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).

SHARED_PUSH

public 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).

SHARED_PULL

public static final int SHARED_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).
Method Detail

getId

public java.lang.String getId()
This gets the id variable.
Returns:
The cache id.

getSharingPolicy

public int getSharingPolicy()
This gets the sharing policy in the sharingPolicy variable. Included for forward compatibility with distributed caches.
Returns:
The sharing policy.

isNotShared

public boolean isNotShared()
This determines whether the sharingPolicy is NOT_SHARED. Included for forward compatibility with distributed caches.
Returns:
True indicates that the sharingPolicy is NOT_SHARED.

isSharedPush

public boolean isSharedPush()
This determines whether the sharingPolicy is SHARED_PUSH. Included for forward compatibility with distributed caches.
Returns:
True indicates that the sharingPolicy is SHARED_PUSH.

isSharedPull

public boolean isSharedPull()
This determines whether the sharingPolicy is SHARED_PULL. Included for forward compatibility with distributed caches.
Returns:
True indicates that the sharingPolicy is SHARED_PULL.

getTimeLimit

public int getTimeLimit()
This gets the time limit on this cache entry.
Parameters:
The - time limit.

setTimeLimit

public void setTimeLimit(int timeLimit)
This sets the time limit in the timeLimit variable. Once an entry is cached, it will remain in the cache for this many seconds
Parameters:
timeLimit - This time limit.

getExpirationTime

public long getExpirationTime()
This gets the expiration time from the expirationTime variable.
Returns:
The expiration time.

setExpirationTime

public void setExpirationTime(long expirationTime)
This sets the expirationTime variable.
Parameters:
The - new expiration time.

getPriority

public int getPriority()
This gets the priority in the priority variable.
Returns:
The priority.

setPriority

public void setPriority(int priority)
This assigns the new priority to the priority variable.
Parameters:
priority - The new priority.

getTemplates

public java.util.Enumeration getTemplates()
This gets the templates in the templates variable.
Returns:
An Enumeration of the template names.

getDataIds

public java.util.Enumeration getDataIds()
This gets the data ids from the dataIds variable.
Returns:
The Enumeration of data ids.

addDataId

public void addDataId(java.lang.String dataId)
This unions a new data id into the dataIds variable.
Parameters:
dataId - The new data id.