com.ibm.wsspi.cache
Class CacheEntry
- java.lang.Object
com.ibm.wsspi.cache.CacheEntry
- public class CacheEntry
- extends java.lang.Object
Field Summary
Modifier and Type | Field and Description |
---|---|
cacheEntry
|
Constructor Summary
Constructor and Description |
---|
CacheEntry(CacheEntry ce)
Constructor for wrapping the cache entry which is used by Cache Monitor.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
getCacheType()
Returns the type of CacheEntry (CACHE_TYPE_DEFAULT or CACHE_TYPE_JAXRPC)
ALL implementors of this method other than Dynacache should return CACHE_TYPE_DEFAULT
for this method.
|
|
getCacheValueSize()
Returns the best-effort size of the cache entry's value.
|
|
getDataIds()
Returns all IDs (cache IDs and data IDs) that this entry
depends on for invalidation.
|
|
getDisplayValue()
Returns the entry's value in a displayable format.
|
|
getExpirationTime()
Returns the absolute time when the entry should expire.
|
|
getExternalCacheGroupId()
Returns the name this the cache entry belongs too.
|
|
getId()
Returns the unique identifier of this cached entry.
|
|
getPriority()
Returns the priority of this cache entry, which
determines how long the entry will stay in cache
when it is not being used.
|
|
getSharingPolicy()
Returns the sharing policy of this entry.
|
|
getTemplates()
Returns all templates that this entry depends on for invalidation.
|
|
getTimeLimit()
Returns the maximum interval of time in seconds
that the entry is allowed to stay in the cache.
|
|
getTimeStamp()
Returns the creation time of this entry.
|
|
isBatchEnabled()
Deprecated. The updates for Push or Push-Pull sharing policies are
always done in an asynchronous batch mode. It always
returns true.
|
|
refreshEntry()
This mimics a cache Hit, refreshing an entries spot in the replacement algorithm.
|
|
toString()
Returns the string representation of cache entry.
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail
cacheEntry
- public CacheEntry cacheEntry
Constructor Detail
CacheEntry
- public CacheEntry(CacheEntry ce)
Constructor for wrapping the cache entry which is used by Cache Monitor.
Parameters:
ce
- Cache entry instance Method Detail
getCacheType
- public int getCacheType()
Returns the type of CacheEntry (CACHE_TYPE_DEFAULT or CACHE_TYPE_JAXRPC)
ALL implementors of this method other than Dynacache should return CACHE_TYPE_DEFAULT
for this method.
Returns:
cache type
getTemplates
- public java.util.Enumeration getTemplates( )
Returns all templates that this entry depends on for invalidation.
For a JSP/servlet, a template is the URI for this entry.
- For a top-level entry (eg, a JSP/Servlet that is externally requested), this is obtained from the HTTP request object's URL. It can be set either by the server or by the top-level JSP/Servlet.
- For a contained entry, this is the JSP/Servlet file name URL (the parameter that would be used in the callPage method). It can be set either by the JSP/Servlet it names or its containing JSP/Servlet, plus other information from the request object.
Returns:
An Enumeration of the templates.
getDataIds
- public java.util.Enumeration getDataIds( )
Returns all IDs (cache IDs and data IDs) that this entry
depends on for invalidation. Its elements are Strings.
They are the identifiers used in the invalidateById methods
to invalidate all cache entries having a dependency on these IDs.
Data IDs must be unique within the same scope as cache IDs.
Returns:
An Enumeration of the IDs.
getTimeLimit
- public int getTimeLimit()
Returns the maximum interval of time in seconds
that the entry is allowed to stay in the cache.
The entry may be discarded via LRU replacement prior to this time.
A negative value indicates no time limit.
Returns:
The time limit.
getExpirationTime
- public long getExpirationTime()
Returns the absolute time when the entry should expire.
The entry may be discarded via LRU replacement prior to this time.
A negative value indicates no expiration time.
Returns:
The expiration time.
getTimeStamp
- public long getTimeStamp()
Returns the creation time of this entry.
Returns:
The creation timestamp.
getPriority
- public int getPriority()
Returns the priority of this cache entry, which
determines how long the entry will stay in cache
when it is not being used.
A larger priority gives an entry a longer time in the
cache.
The value of priority should be based on the ratio of
the cost of computing the entry to the cost of
the memory in the cache (the size of the entry).
The default is 1.
Returns:
This entry's priority.
getSharingPolicy
- public int getSharingPolicy()
Returns the sharing policy of this entry. In a
multi-JVM environment, this indicates whether the cache entry
should be EntryInfo.NOT_SHARED, EntryInfo.SHARED_PUSH_PULL or
EntryInfo.SHARED_PUSH. The default is NOT_SHARED.
Returns:
The sharing policy.
isBatchEnabled
- public boolean isBatchEnabled()
Deprecated. The updates for Push or Push-Pull sharing policies are
always done in an asynchronous batch mode. It always
returns true.
In a multi-JVM environment, this indicates whether updates to the
cache entry (when using EntryInfo.SHARED_PUSH) will be written out
immediately or in a batched, asynchronous fashion.
Returns:
True if batch is enabled, false otherwise.
getId
- public java.lang.String getId()
Returns the unique identifier of this cached entry.
It must be unique within the scope of the group of Cache instances.
Having this in the CacheEntry allows an entry obtained
via the LRU array to know how to find it in the entryHashtable.
Returns:
The String ID of this CacheEntry.
getDisplayValue
- public byte[] getDisplayValue()
Returns the entry's value in a displayable format.
Returns:
The entry's value.
refreshEntry
- public void refreshEntry()
This mimics a cache Hit, refreshing an entries spot in the replacement algorithm.
getCacheValueSize
- public long getCacheValueSize()
Returns the best-effort size of the cache entry's value.
Returns:
The best-effort determination of the size of the cache entry's value. If the size
cannot be determined, the return value is -1;
toString
- public java.lang.String toString( )
Returns the string representation of cache entry.
Overrides:
toString
in class java.lang.Object
Returns:
string representation of cache entry
getExternalCacheGroupId
- public java.lang.String getExternalCacheGroupId( )
Returns the name this the cache entry belongs too.
Returns:
null of this cache entry is not cached externally