|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.store.MemoryLimitedCacheLoader net.sf.ehcache.terracotta.TerracottaBootstrapCacheLoader
public class TerracottaBootstrapCacheLoader
A BootstrapCacheLoader
that will load Elements into a Terracotta clustered cache, based on a previously
snapshotted key set. It is also responsible to create snapshot files to disk
Field Summary | |
---|---|
static boolean |
DEFAULT_DEDICATED_THREAD
The default on whether to do the snapshot on a dedicated thread or using the CacheManager's ScheduledExecutorService |
static long |
DEFAULT_INTERVAL
The default interval in seconds, between each snapshot |
Constructor Summary | |
---|---|
TerracottaBootstrapCacheLoader(boolean asynchronous,
String directory,
boolean doKeySnapshots)
Constructor |
|
TerracottaBootstrapCacheLoader(boolean asynchronous,
String directory,
long interval)
Constructor |
|
TerracottaBootstrapCacheLoader(boolean asynchronous,
String directory,
long interval,
boolean onDedicatedThread)
Constructor |
Method Summary | |
---|---|
Object |
clone()
Clones the loader |
void |
dispose()
Will shut the keysnapshot thread and other resources down. |
void |
doLocalKeySnapshot()
Calling this method will result in a snapshot being taken or wait for the one in progress to finish |
boolean |
isAsynchronous()
|
boolean |
isImmediateShutdown()
Whether the on going keysnapshot will finish before the instance is disposed |
void |
load(Ehcache cache)
Instructs the loader to load the given cache |
void |
setImmediateShutdown(boolean immediateShutdown)
Sets whether the disposal of the instance will let the potential current key set being written to disk finish, or whether the shutdown will be immediate |
void |
setSnapshotOnDispose(boolean doKeySnapshotOnDispose)
Configures the Loader to take a snapshot when it is being disposed |
Methods inherited from class net.sf.ehcache.store.MemoryLimitedCacheLoader |
---|
isInMemoryLimitReached |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_INTERVAL
public static final boolean DEFAULT_DEDICATED_THREAD
ScheduledExecutorService
Constructor Detail |
---|
public TerracottaBootstrapCacheLoader(boolean asynchronous, String directory, boolean doKeySnapshots)
asynchronous
- do the loading asynchronously, or synchronouslydirectory
- the directory to read snapshot files from, and write them todoKeySnapshots
- Whether to do keysnapshottingpublic TerracottaBootstrapCacheLoader(boolean asynchronous, String directory, long interval)
asynchronous
- do the loading asynchronously, or synchronouslydirectory
- the directory to read snapshot files from, and write them tointerval
- the interval in seconds at which the snapshots of the local key set has to occurpublic TerracottaBootstrapCacheLoader(boolean asynchronous, String directory, long interval, boolean onDedicatedThread)
asynchronous
- do the loading asynchronously, or synchronouslydirectory
- the directory to read snapshot files from, and write them tointerval
- the interval in seconds at which the snapshots of the local key set has to occuronDedicatedThread
- whether to do the snapshot on a dedicated thread or using the CacheManager's
ScheduledExecutorService
Method Detail |
---|
public boolean isImmediateShutdown()
Disposable
public void setImmediateShutdown(boolean immediateShutdown)
immediateShutdown
- true if immediate, false to let the snapshot finishpublic void load(Ehcache cache) throws CacheException
load
in interface BootstrapCacheLoader
CacheException
public boolean isAsynchronous()
isAsynchronous
in interface BootstrapCacheLoader
public void dispose()
setImmediateShutdown(boolean)
value
dispose
in interface Disposable
public void doLocalKeySnapshot() throws IOException
IOException
- On exception being thrown while doing the snapshotpublic Object clone() throws CloneNotSupportedException
clone
in interface BootstrapCacheLoader
clone
in class MemoryLimitedCacheLoader
CloneNotSupportedException
public void setSnapshotOnDispose(boolean doKeySnapshotOnDispose)
doKeySnapshotOnDispose
- whether to snapshot on loader disposal
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |