|
Nux 1.4 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnux.xom.pool.PoolConfig
Set of tunable configuration parameters for DocumentMap
and
cousins.
Setters return this
for convenient method chaining.
Constructor Summary | |
|
PoolConfig()
Constructs an instance with default parameters. |
protected |
PoolConfig(PoolConfig src)
Constructs a deep copy of the given source configuration. |
Method Summary | |
PoolConfig |
copy()
Returns a deep copy of this configuration. |
long |
getCapacity()
Returns the maximum amount of memory [bytes] the sum of all contained pool values may occupy. |
int |
getCompressionLevel()
Returns the pool compression level. |
boolean |
getFileMonitoring()
Returns the file change invalidation policy. |
int |
getMaxEntries()
Returns the maximum number of entries this pool can hold before starting to evict old entries. |
long |
getMaxIdleTime()
Returns the (approximate) maximum time [ms] a pool entry is retained since its last access on get(). |
long |
getMaxLifeTime()
Returns the (approximate) maximum time [ms] a pool entry is retained since its creation/insertion on put(). |
PoolConfig |
setCapacity(long capacity)
Sets the maximum amount of memory [bytes] the sum of all contained pool values may occupy. |
PoolConfig |
setCompressionLevel(int compressionLevel)
Sets the pool compression level (defaults to 0). |
PoolConfig |
setFileMonitoring(boolean fileMonitoring)
Sets whether or not a pool should periodically monitor and automatically remove an entry if it's key is a File and that file has
been modified or deleted since the entry has been inserted into the pool. |
PoolConfig |
setMaxEntries(int maxEntries)
Sets the maximum number of entries this pool can hold before starting to evict old entries. |
PoolConfig |
setMaxIdleTime(long maxIdleTime)
Sets the (approximate) maximum time [ms] a pool entry is retained since its last access on get(). |
PoolConfig |
setMaxLifeTime(long maxLifeTime)
Sets the (approximate) maximum time [ms] a pool entry is retained since its creation/insertion on put(). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PoolConfig()
protected PoolConfig(PoolConfig src)
src
- the source configuration to copyMethod Detail |
public PoolConfig copy()
public int getCompressionLevel()
public PoolConfig setCompressionLevel(int compressionLevel)
compressionLevel
- a number in the range -1..9public int getMaxEntries()
public PoolConfig setMaxEntries(int maxEntries)
Integer.MAX_VALUE
effectively disables this constraint.
The default is 10000.
public long getCapacity()
public PoolConfig setCapacity(long capacity)
Long.MAX_VALUE
effectively
disables this constraint. The default is Runtime.maxMemory() / 2
.
Runtime.maxMemory()
public long getMaxIdleTime()
public PoolConfig setMaxIdleTime(long maxIdleTime)
Long.MAX_VALUE
effectively disables this constraint. The default is
public long getMaxLifeTime()
public PoolConfig setMaxLifeTime(long maxLifeTime)
Long.MAX_VALUE
effectively disables this constraint (this is the default).
public PoolConfig setFileMonitoring(boolean fileMonitoring)
File
and that file has
been modified or deleted since the entry has been inserted into the pool.
The default is false
.
fileMonitoring
- true to enable auto-removal of changed files, false otherwisepublic boolean getFileMonitoring()
|
Nux 1.4 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |