public class RefreshAheadCacheConfiguration extends Object implements Cloneable
RefreshAheadCache
instances.Modifier and Type | Field and Description |
---|---|
static String |
BATCH_SIZE_KEY
Properties key for the batch size attribute
|
static String |
EVICT_ON_LOAD_MISS
Properties key for the batch size attribute
|
static String |
MAX_BACKLOG
Properties key for the max backlog attribute
|
static String |
NAME_KEY
Properties key for the batch size attribute
|
static String |
NUMBER_OF_THREADS_KEY
Properties key for the batch size attribute
|
static String |
TIME_TO_REFRESH_SECONDS_KEY
Properties key for the batch size attribute
|
Constructor and Description |
---|
RefreshAheadCacheConfiguration()
Create a default, valid configuration
|
Modifier and Type | Method and Description |
---|---|
RefreshAheadCacheConfiguration |
batchSize(int batchSize)
Fluently set the batch size for processing refresh requests.
|
RefreshAheadCacheConfiguration |
build()
Validate this configuration.
|
RefreshAheadCacheConfiguration |
evictOnLoadMiss(boolean loadMissEvicts)
Fluently set whether no return for a key from all CacheLoaders should force
an eviction prematurely from the underlying cache.
|
RefreshAheadCacheConfiguration |
fromProperties(Properties properties)
Initialize this configuration from a
Properties object. |
int |
getBatchSize()
Get the batch size with which refresh requests will be processed.
|
int |
getMaximumRefreshBacklogItems()
Get the maximum number of backlog items allowed.
|
String |
getName()
Get the name of this cache decorator
|
int |
getNumberOfThreads()
Get the number of threads used locally in this instance to process
refresh requests
|
long |
getTimeToRefreshMillis()
return the time to refresh in milliseconds.
|
long |
getTimeToRefreshSeconds()
Get the time to refresh in seconds
|
boolean |
isEvictOnLoadMiss()
Get whether no return for a key from all CacheLoaders will force
an eviction prematurely from the underlying cache.
|
RefreshAheadCacheConfiguration |
maximumRefreshBacklogItems(int maximumRefreshBacklogItems)
Fluently set the maximum refresh backlog items.
|
RefreshAheadCacheConfiguration |
name(String name)
Fluently set the name of this cache decorator
|
RefreshAheadCacheConfiguration |
numberOfThreads(int numberOfThreads)
Fluently set the number of threads used locally in this instance to process
refresh requests
|
void |
setBatchSize(int batchSize)
Set the batch size for processing refresh requests.
|
void |
setEvictOnLoadMiss(boolean loadMissEvicts)
Set whether no return for a key from all CacheLoaders should force
an eviction prematurely from the underlying cache.
|
void |
setMaximumRefreshBacklogItems(int maximumRefreshBacklogItems)
Set the maximum refresh backlog items.
|
void |
setName(String name)
Set the name of this cache decorator
|
void |
setNumberOfThreads(int numberOfThreads)
Set the number of threads used locally in this instance to process
refresh requests
|
void |
setTimeToRefreshSeconds(long timeToRefreshSeconds)
Set the time to refresh in seconds
|
RefreshAheadCacheConfiguration |
timeToRefreshSeconds(long secs)
Fluently set the time to refresh seconds
|
Properties |
toProperties()
Express this configuration as a
Properties object. |
String |
toString() |
public static final String BATCH_SIZE_KEY
public static final String NUMBER_OF_THREADS_KEY
public static final String NAME_KEY
public static final String TIME_TO_REFRESH_SECONDS_KEY
public static final String MAX_BACKLOG
public static final String EVICT_ON_LOAD_MISS
public RefreshAheadCacheConfiguration()
public RefreshAheadCacheConfiguration fromProperties(Properties properties)
Properties
object. Will be
validated before returning.properties
- public Properties toProperties()
Properties
object.public RefreshAheadCacheConfiguration build()
IllegalStateException
public long getTimeToRefreshMillis()
public RefreshAheadCacheConfiguration timeToRefreshSeconds(long secs)
secs
- secondspublic long getTimeToRefreshSeconds()
public void setTimeToRefreshSeconds(long timeToRefreshSeconds)
timeToRefreshSeconds
- public int getMaximumRefreshBacklogItems()
public RefreshAheadCacheConfiguration maximumRefreshBacklogItems(int maximumRefreshBacklogItems)
maximumRefreshBacklogItems
- public void setMaximumRefreshBacklogItems(int maximumRefreshBacklogItems)
maximumRefreshBacklogItems
- public int getNumberOfThreads()
public void setNumberOfThreads(int numberOfThreads)
numberOfThreads
- number of threadspublic RefreshAheadCacheConfiguration numberOfThreads(int numberOfThreads)
numberOfThreads
- number of threadspublic int getBatchSize()
public void setBatchSize(int batchSize)
batchSize
- maximum batch sizepublic RefreshAheadCacheConfiguration batchSize(int batchSize)
batchSize
- maximum batch sizepublic String getName()
public void setName(String name)
name
- public RefreshAheadCacheConfiguration name(String name)
name
- public boolean isEvictOnLoadMiss()
public void setEvictOnLoadMiss(boolean loadMissEvicts)
loadMissEvicts
- true to evictpublic RefreshAheadCacheConfiguration evictOnLoadMiss(boolean loadMissEvicts)
loadMissEvicts
- true to evictCopyright © 2003–2016 Terracotta, Inc.. All rights reserved.