public class JadiceCacheReaper extends Object implements org.springframework.beans.factory.InitializingBean, Runnable
Reaper class that attempts to clean the jadice global cache in a fixed interval to reduce memory consumption.
Background: Even though jadice server uses a thread local Cache
it might occur that some
data is stored in the global cache.
CacheManager.getDefault()
Constructor and Description |
---|
JadiceCacheReaper() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
ClearableDocumentLayerCache |
getDocumentLayerCache() |
JobScheduler |
getJobScheduler() |
int |
getTimeInterval() |
boolean |
isReapOnlyWhenIdle() |
void |
run() |
void |
setDocumentLayerCache(ClearableDocumentLayerCache documentLayerCache)
Replace the default
DocumentLayerCache by a custom one that will be cleared whenever
no jobs are running |
void |
setJobScheduler(JobScheduler jobScheduler)
The
JobScheduler on which the jadice server Job s are executed |
void |
setReapOnlyWhenIdle(boolean reapOnlyWhenIdle)
Choose if the cleansing is performed only when no jobs are running on jadice server
|
void |
setTimeInterval(int timeInterval)
Sets the time interval when to clean the jadice global cache
|
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void setTimeInterval(int timeInterval)
timeInterval
- time interval in secondspublic int getTimeInterval()
public void setReapOnlyWhenIdle(boolean reapOnlyWhenIdle)
reapOnlyWhenIdle
- if true
the cache is only cleaned when no jobs are runningpublic boolean isReapOnlyWhenIdle()
true
the cache is only cleaned when no jobs are runningpublic void setJobScheduler(JobScheduler jobScheduler)
JobScheduler
on which the jadice server Job
s are executedjobScheduler
- public JobScheduler getJobScheduler()
public void setDocumentLayerCache(ClearableDocumentLayerCache documentLayerCache)
DocumentLayerCache
by a custom one that will be cleared whenever
no jobs are runningdocumentLayerCache
- public ClearableDocumentLayerCache getDocumentLayerCache()
Copyright © 2016 levigo holding gmbh. All rights reserved.