getAttributes()
returns the attributes currently associated with the cache.
static java.lang.String
getCacheAddress()
returns the String representation of the address currently being used by this
instance of the cache, or null if the cache is not on the network.
static oracle.ias.cache.CacheAddress
getCacheAddressObject()
returns the Object representation of the address of the current
instance of the cache, or null if the cache is not on the network.
static int
getCacheId()
returns the global cache Id in a distributed cache system.
invalidate()
globally invalidates all the objects in the cache
system, includes all processes, memory and disk.
static void
invalidate(boolean localOnly)
globally invalidates all the objects in the cache
memory and disk.
static boolean
isDistributed()
returns true if the cache is currently in distributed mode,
that it is distributing updates and invalidates within the site, false
if all cache actions are local to the process only.
static boolean
isReady()
returns true if the cache has been initialized, false otherwise.
static java.util.Enumeration
listCacheObjects()
returns an Enumeration of CacheObjectInfo objects
describing the objects in all regions in the cache.
static java.util.Enumeration
listCacheObjects(java.lang.String region)
returns an Enumeration of CacheObjectInfo objects
describing the objects in specified region in the cache.
static void
open()
reads the configuration files and establishs the Java
caching system in the process.
static void
open(java.lang.String configFile)
reads the configuration files and establishs the Java
caching system in the process.
reads the configuration files and establishs the Java
caching system in the process. During the initialization, a hash table
is created for storing cached objects, the cache management and
message receive threads are started, the metadata is loaded from the
disk cache and the cache is registered with the group protocol layer
if the cache is distributed. This method should only be called once
for each process.
public static void open(java.lang.String configFile)
throws CacheException
reads the configuration files and establishs the Java
caching system in the process. During the initialization, a hash table
is created for storing cached objects, the cache management and
message receive threads are started, the metadata is loaded from the
disk cache and the cache is registered with the group protocol layer
if the cache is distributed. This method should only be called once
for each process.
Parameters:
configFile - the name of the configuration file to read the configuration
information from
initializes the cache. This
includes allocating space for metadata and starting service threads.
The attributes parameter contains configuration information to
initialize the cache system.
Parameters:
attr - CacheAttributes which has the cache configuration
information.
marks the cache as " not ready" and shutdown the cache.
Marking the cache as "not ready" will prevent any threads from accessing
the cache during shutdown. If the cache is distributed, close
will unregister with the distributed caching system. Close should
be called as part of process termination.
returns an estimate of the number of bytes consumed by objects in the
memory cache.
The accuracy of this value depends on the accuracy of the size attribute
set by the user for each object in the cache. If the cache configuration
parameter "maxSize" has not been set, the cache size is not maintained so
this method will always return 0.
Returns:
an estimate of the number of bytes consumed by objects in the cache
returns the number of bytes consumed by objects in the distributed
disk cache. If the disk cache is not configured or the cache is not
distributed, this method will return 0.
Returns:
the number of bytes consumed by objects in the distributed
disk cache
allows some cache attributes to be reset while the cache is running.
The following attributes can be reset: maxObjects, maxSize, diskSize,
cleanInterval and logSeverity.
Parameters:
attr - CacheAttributes which has the cache configuration
information.
GetVersion returns the current version of the cache.
Returns:
the cache version number
Since:
2.0.0
dump
public static void dump()
dumps all the objects in cache to the log file.
Since:
2.0.0
isReady
public static boolean isReady()
returns true if the cache has been initialized, false otherwise.
Returns:
true if the cache has been initialized; false, otherwise.
Since:
2.0.0
isDistributed
public static boolean isDistributed()
returns true if the cache is currently in distributed mode,
that it is distributing updates and invalidates within the site, false
if all cache actions are local to the process only.
Returns:
true, if cache is distributed; false, otherwise.
Since:
2.0.0
listCacheObjects
public static java.util.Enumeration listCacheObjects()
returns an Enumeration of CacheObjectInfo objects
describing the objects in all regions in the cache.
CacheObjectInfo will include information such as the object name,
the type, what group it is associated with, the reference count,
the expiration time if any and the number of accesses.
public static java.util.Enumeration listCacheObjects(java.lang.String region)
returns an Enumeration of CacheObjectInfo objects
describing the objects in specified region in the cache.
CacheObjectInfo will include information such as the object name,
the type, what group it is associated with, the reference count,
the expiration time if any and the number of accesses.
returns the global cache Id in a distributed cache system.
The cache Id for different cache process will be unique at any given
moment, however, the cache Id can be reused if one cache process exits,
and a new cache process joins the system. For example, a distributed
cache system may initially has three cache processes, they have cache id
1, 2, 3 respectively. Then, cache process with cache id 2 exit, and a
new cache process joins the distributed cache system, this new cache
process will get cache id 2.
Returns:
the global unique cache id (>=1) in the distributed cache system
or -1 if the cache is local.
Since:
2.0.0
updateStats
public static void updateStats()
aggregate the statics for the cache.
The statistics for the cache are aggregated as a background task at the
interval specified by the "cleanInterval" configuration parameter or by
directly calling updateStats. If a cache is already in the process of
aggregating statistics, updateStats will block until the aggregation is
complete.