public class OSCacheProvider extends Object implements CacheProvider
Modifier and Type | Field and Description |
---|---|
static String |
OSCACHE_CAPACITY
The OSCache cache capacity property suffix.
|
static String |
OSCACHE_CRON
The OSCache CRON expression property suffix.
|
static String |
OSCACHE_REFRESH_PERIOD
The OSCache refresh period property suffix.
|
Constructor and Description |
---|
OSCacheProvider() |
Modifier and Type | Method and Description |
---|---|
Cache |
buildCache(String region,
Properties properties)
Builds a new
Cache instance, and gets it's properties from the OSCache Config
which reads the properties file (oscache.properties ) from the classpath. |
boolean |
isMinimalPutsEnabledByDefault() |
long |
nextTimestamp()
Generate a timestamp
|
void |
start(Properties properties)
Callback to perform any necessary initialization of the underlying cache implementation
during SessionFactory construction.
|
void |
stop()
Callback to perform any necessary cleanup of the underlying cache implementation
during SessionFactory.close().
|
public static final String OSCACHE_REFRESH_PERIOD
public static final String OSCACHE_CRON
public static final String OSCACHE_CAPACITY
public Cache buildCache(String region, Properties properties) throws CacheException
Cache
instance, and gets it's properties from the OSCache Config
which reads the properties file (oscache.properties
) from the classpath.
If the file cannot be found or loaded, an the defaults are used.buildCache
in interface CacheProvider
region
- properties
- CacheException
public long nextTimestamp()
CacheProvider
nextTimestamp
in interface CacheProvider
public void start(Properties properties) throws CacheException
start
in interface CacheProvider
properties
- current configuration settings.CacheException
public void stop()
stop
in interface CacheProvider
public boolean isMinimalPutsEnabledByDefault()
isMinimalPutsEnabledByDefault
in interface CacheProvider
Copyright © 2018. All rights reserved.