Oracle Application Server 10g Java Object Cache API Reference
10g(9.0.4)

B10388-01

oracle.ias.cache
Class CacheAttributes

java.lang.Object
  |
  +--oracle.ias.cache.CacheAttributes

public class CacheAttributes
extends java.lang.Object

CacheAttributes has the Cache configuration information. It is a structure which is passed to Cache.init(CacheAttributes) to do the system wide configuration. All the fileds are public and user can access the fields directly. Two constructors and a set of convenient methods are provided.

Since:
2.0.0
See Also:
Cache.init(CacheAttributes)

Field Summary
 boolean autoInit
           
 java.lang.String cacheName
           
 int capacityBuffer
          The percentage of the cache to keep in reserve when determining when to clean the cache.
 java.lang.String capacityPolicy
          The capacityPolicy object which is used to determine if an object is eligible to be removed from the cache when the cache capacity has been reached.
 int cleanInterval
          Number of seconds between cache cleanings
 java.lang.String diskPath
          Absolute path to the the root of the disk cache directory
 int diskSize
          The size of the disk cache in megabytes
 boolean distribute
          Indicates the cache is distributed, updates and invalidates are propagated to other caches in the system
static int HTTP
          HTTP as network protocol for distributed cache
 boolean isSSLEnabled
          Use SSL in the transport protocol
 java.lang.String keyStoreLocation
          Absolute path to the key store
 java.lang.String localAddress
          Local host IP address which may not be the primary address
 java.lang.String logFileName
          Log file name for the default logger implementation.
 java.lang.String logger
          The logger object which is used to log cache messages.
 int logSeverity
          Log severity, see CacheLogger for details
 int maxIdleTime
          The maximum number of seconds an object can remain idle without being available for removal should the cache fill up
 int maxObjects
          Maximum number of in-memory objects in the cache
 int maxSize
          The size of the memory cache in megabytes
 boolean nlDeathDetectable
           
 int overrideNLPort
           
 int pingInterval
          Number of seconds between cache death detection(pinging)
 java.lang.String sslConfigFilePath
          Absolute to the SSL configuration file
static int TCP
          TCP as network protocol for distibuted cache
 int transport
          Transport protocol being used when distribute mode is set.
 java.lang.String version
          Version of the cache software

 

Constructor Summary
CacheAttributes()
          Constructs a default CacheAttributes which will set all the values to default.

 

Method Summary
 void addCacheAddr(java.net.InetAddress ipAddr, int port)
          adds a new ipAddr/port to the list of cache addresses
 void addCacheAddr(java.net.InetAddress ipAddr, int port, boolean replace)
          adds a new ipAddr/port to the list of cache addresses
 void addCacheAddr(java.net.InetAddress ipAddr, int port, boolean replace, boolean isOriginal)
          adds a new ipAddr/port to the list of cache addresses
 void addPrimaryCacheAddr(java.net.InetAddress ipAddr, int port)
          adds a new ipAddr/port to the list of cache addresses
 boolean addressIsOriginal(java.net.InetAddress ipAddr, int port)
          returns true if the ipAddr/port is on the list and is the original address
 java.lang.String getAddrListString()
          Returns the list of cache addresses in a formatted string, if the list is null, set to the default
 java.lang.String getAddrString()
          Returns all the ip:port discovery addresses in a String This differs from getAddrListString in that it only returns the ip:port It doesn't include other information about the port or formatting.
 java.util.Enumeration getCacheAddrs()
          gets an enumeration of the list of cache addresses, if the list is null the enumerator will return the default address.
 oracle.ias.cache.CacheAddress[] getCoordinatorList()
          gets the list of cache cache addresses, if the list is null set to the default
 java.lang.String getLocalAddress()
          Gets the specified localhost IP address for the listener to bind to
 int getOverrideNodeListenerPort()
          Get the override Node Listener port number if it is set
 boolean isNodeListenerDeathDetectable()
          Death detection for local Node Listener for coordinator discovery process
 boolean removeCacheAddr(java.net.InetAddress ipAddr, int port)
          remove an existing ipAddr/port from the list of cache addresses
 void setAutoInit(boolean flag)
           
 void setCacheName(java.lang.String name)
          sets the cach name
 void setCapacityBuffer(int count)
          sets the capacity buffer the percent of the cache capacity to try to hold in reserve
 void setCapacityPolicy(java.lang.String policyString)
          sets the capacity policy string The capacity policy string must be the class name for a class that extends the CapacityPolicy abstract class and implements the Declarable interface.
 void setCleanInterval(int pCleanInterval)
          sets number of seconds between cache cleanings
 void setDiskPath(java.lang.String pDiskPath)
          sets absolute path to the root of the disk cache directory.
 void setDiskSize(int pDiskSize)
          sets the disk cache size
 void setDistribute(boolean pDistribute)
          sets the distribute flag to indicate if the cache is local to the process of not
 void setEnableSSL(boolean enable)
          enable or disable SSL support for distribute cache
 void setKeyStore(java.lang.String name)
          Sets the key store location
 void setLocalAddress(java.lang.String addr)
          Specifies the localhost IP address for the listener to bind to
 void setLogFileName(java.lang.String pLogFileName)
          sets the log file name for the DefaultCacheLogger.
 void setLogger(java.lang.String pLogger)
          sets the logger object which will be used to log cache messages.
 void setLogSeverity(int severity)
          sets the log severity which determines which log messages are published to the log
 void setMaxObjects(int pMaxObjects)
          sets the maximum number of in-memory objects in the cache.
 void setMaxSize(int pMaxSize)
          sets the maximum number of bytes available to the in-memory cache
 void setNodeListenerDeathDetectable(boolean detect)
          Enable death detection for local Node Listener
 void setOverrideNodeListenerPort(int port)
          Force the Node Listener to listen on a specific port
 void setPingInterval(int pPingInterval)
          sets number of seconds between cache death detection
 void setSSLConfigFile(java.lang.String name)
          Sets the SSL configuration file location
 void setTransport(int mode)
          Specifies the transport protocol when distribute mode is set
 java.lang.String toString()
          converts this object into a formatted string

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

TCP

public static final int TCP
TCP as network protocol for distibuted cache
See Also:
Constant Field Values

HTTP

public static final int HTTP
HTTP as network protocol for distributed cache
See Also:
Constant Field Values

distribute

public boolean distribute
Indicates the cache is distributed, updates and invalidates are propagated to other caches in the system

version

public java.lang.String version
Version of the cache software

maxObjects

public int maxObjects
Maximum number of in-memory objects in the cache

maxSize

public int maxSize
The size of the memory cache in megabytes

diskSize

public int diskSize
The size of the disk cache in megabytes

diskPath

public java.lang.String diskPath
Absolute path to the the root of the disk cache directory

cleanInterval

public int cleanInterval
Number of seconds between cache cleanings

pingInterval

public int pingInterval
Number of seconds between cache death detection(pinging)

logger

public java.lang.String logger
The logger object which is used to log cache messages.

logFileName

public java.lang.String logFileName
Log file name for the default logger implementation.

logSeverity

public int logSeverity
Log severity, see CacheLogger for details

capacityPolicy

public java.lang.String capacityPolicy
The capacityPolicy object which is used to determine if an object is eligible to be removed from the cache when the cache capacity has been reached.

The capacity buffer is a percentage of the cache to be held in reserve. That is, the cache system will start looking for objects to be removed from the cache when only the indicated percentage of the cache is available. For example if maxCount is set to 1000 and the capacityBuffer is set to 5 then when the number of objects in the cache reaches 950, the cache will start looking for objects to remove. The default value for capacityBuffer is 15.


capacityBuffer

public int capacityBuffer
The percentage of the cache to keep in reserve when determining when to clean the cache.

maxIdleTime

public int maxIdleTime
The maximum number of seconds an object can remain idle without being available for removal should the cache fill up

transport

public int transport
Transport protocol being used when distribute mode is set.

isSSLEnabled

public boolean isSSLEnabled
Use SSL in the transport protocol

keyStoreLocation

public java.lang.String keyStoreLocation
Absolute path to the key store

sslConfigFilePath

public java.lang.String sslConfigFilePath
Absolute to the SSL configuration file

localAddress

public java.lang.String localAddress
Local host IP address which may not be the primary address

cacheName

public java.lang.String cacheName

autoInit

public boolean autoInit

nlDeathDetectable

public boolean nlDeathDetectable

overrideNLPort

public int overrideNLPort
Constructor Detail

CacheAttributes

public CacheAttributes()
                throws CacheException
Constructs a default CacheAttributes which will set all the values to default. The default values are as following:
Since:
2.0.0
Method Detail

setDistribute

public void setDistribute(boolean pDistribute)
sets the distribute flag to indicate if the cache is local to the process of not
Parameters:
pDistribute - is true, means the cache is part of the distributed cache otherwise, the cache is local to the process.
Since:
2.0.0

setMaxObjects

public void setMaxObjects(int pMaxObjects)
sets the maximum number of in-memory objects in the cache.
Parameters:
pMaxObjects - maximum number of in-memory objects in the cache
Since:
2.0.0

setMaxSize

public void setMaxSize(int pMaxSize)
sets the maximum number of bytes available to the in-memory cache
Since:
2.1.1

setDiskSize

public void setDiskSize(int pDiskSize)
sets the disk cache size
Parameters:
pDiskSize - the disk cache size in megabytes
Since:
2.0.0

setDiskPath

public void setDiskPath(java.lang.String pDiskPath)
sets absolute path to the root of the disk cache directory.
Parameters:
pDiskPath - the absolute path to the root of the disk cache directory
Since:
2.0.0

setCleanInterval

public void setCleanInterval(int pCleanInterval)
sets number of seconds between cache cleanings
Parameters:
pCleanInterval - number of seconds between cache cleanings
Since:
2.0.0

setPingInterval

public void setPingInterval(int pPingInterval)
sets number of seconds between cache death detection
Parameters:
pPingInterval - number of seconds between cache death detection
Since:
2.0.0

setLogger

public void setLogger(java.lang.String pLogger)
sets the logger object which will be used to log cache messages.
Parameters:
pLogger - an object extends CacheLogger
Since:
2.0.0

setLogSeverity

public void setLogSeverity(int severity)
sets the log severity which determines which log messages are published to the log
Parameters:
severity - log severity
Since:
2.1.1

setLogFileName

public void setLogFileName(java.lang.String pLogFileName)
sets the log file name for the DefaultCacheLogger.
Parameters:
pLogFileName - the log file name for the DefaultCacheLogger.
Since:
2.0.0

setCapacityPolicy

public void setCapacityPolicy(java.lang.String policyString)
sets the capacity policy string

The capacity policy string must be the class name for a class that extends the CapacityPolicy abstract class and implements the Declarable interface. The abstract method CapacityPolicy.policy must be implemented. The capacity policy set in CacheAttributes is the capacity policy for the cache as a whole. The init method of the Declarable interface is called when the object is instantiated to do any initialization required.

Parameters:
policyString - the class name of the capacity policy object
Since:
9.0.4

setAutoInit

public void setAutoInit(boolean flag)
Parameters:
flag - if true auto init is enabled
Since:
9.0.4

setCacheName

public void setCacheName(java.lang.String name)
sets the cach name
Since:
2.0.0

setKeyStore

public void setKeyStore(java.lang.String name)
Sets the key store location

setSSLConfigFile

public void setSSLConfigFile(java.lang.String name)
Sets the SSL configuration file location

setEnableSSL

public void setEnableSSL(boolean enable)
enable or disable SSL support for distribute cache

setTransport

public void setTransport(int mode)
Specifies the transport protocol when distribute mode is set

setLocalAddress

public void setLocalAddress(java.lang.String addr)
Specifies the localhost IP address for the listener to bind to

setCapacityBuffer

public void setCapacityBuffer(int count)
                       throws InvalidArgumentException
sets the capacity buffer the percent of the cache capacity to try to hold in reserve
Parameters:
count - percent of the cache to try to maintain as available
InvalidArgumentException
Since:
9.0.4

addCacheAddr

public void addCacheAddr(java.net.InetAddress ipAddr,
                         int port)
adds a new ipAddr/port to the list of cache addresses
Parameters:
ipAddr - the inet address
port - the port
Since:
2.0.0

addCacheAddr

public void addCacheAddr(java.net.InetAddress ipAddr,
                         int port,
                         boolean replace)
adds a new ipAddr/port to the list of cache addresses
Parameters:
ipAddr - the inet address
port - the port
replace - if the IP address already exists. The previous address would be discarded.
Since:
2.0.0

addCacheAddr

public void addCacheAddr(java.net.InetAddress ipAddr,
                         int port,
                         boolean replace,
                         boolean isOriginal)
adds a new ipAddr/port to the list of cache addresses
Parameters:
ipAddr - the inet address
port - the port
replace - if the IP address already exists. The previous address would be discarded.
isOriginal -
Since:
9.0.4

addPrimaryCacheAddr

public void addPrimaryCacheAddr(java.net.InetAddress ipAddr,
                                int port)
adds a new ipAddr/port to the list of cache addresses
Parameters:
ipAddr - the inet address
port - the port
Since:
9.0.4

addressIsOriginal

public boolean addressIsOriginal(java.net.InetAddress ipAddr,
                                 int port)
returns true if the ipAddr/port is on the list and is the original address
Parameters:
ipAddr - the inet address
port - the port
Returns:
true if the ipAddr/port is on the list and is the original address false otherwise
Since:
9.0.4

removeCacheAddr

public boolean removeCacheAddr(java.net.InetAddress ipAddr,
                               int port)
remove an existing ipAddr/port from the list of cache addresses
Parameters:
ipAddr - the inet address
port - the port
Since:
9.0.4

getCacheAddrs

public java.util.Enumeration getCacheAddrs()
gets an enumeration of the list of cache addresses, if the list is null the enumerator will return the default address.
Since:
2.0.0

getCoordinatorList

public oracle.ias.cache.CacheAddress[] getCoordinatorList()
gets the list of cache cache addresses, if the list is null set to the default
Since:
9.0.4

getAddrListString

public java.lang.String getAddrListString()
Returns the list of cache addresses in a formatted string, if the list is null, set to the default
Since:
2.0.1

getAddrString

public java.lang.String getAddrString()
Returns all the ip:port discovery addresses in a String This differs from getAddrListString in that it only returns the ip:port It doesn't include other information about the port or formatting. if the list is null, return the default ip:port
Since:
9.0.4

getLocalAddress

public java.lang.String getLocalAddress()
Gets the specified localhost IP address for the listener to bind to

isNodeListenerDeathDetectable

public boolean isNodeListenerDeathDetectable()
Death detection for local Node Listener for coordinator discovery process

setNodeListenerDeathDetectable

public void setNodeListenerDeathDetectable(boolean detect)
Enable death detection for local Node Listener

setOverrideNodeListenerPort

public void setOverrideNodeListenerPort(int port)
Force the Node Listener to listen on a specific port

getOverrideNodeListenerPort

public int getOverrideNodeListenerPort()
Get the override Node Listener port number if it is set

toString

public java.lang.String toString()
converts this object into a formatted string
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.
Since:
2.0.0

Oracle Application Server 10g Java Object Cache API Reference
10g(9.0.4)

B10388-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.