|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.opensymphony.oscache.hibernate.OSCacheProvider
public class OSCacheProvider
Cache provider plugin for Hibernate 3.2 and OpenSymphony OSCache 2.4.
This implementation assumes that identifiers have well-behaved toString() methods. To enable OSCache for Hibernate's second level cache add the following line to Hibernate's configuration e.g.hibernate.cfg.xml):
hibernate.cache.provider_class=com.opensymphony.oscache.hibernate.OSCacheProvider
To configure a different configuration file use the following parameter in the Hibernate's configuration:
com.opensymphony.oscache.configurationResourceName=[path to oscache-hibernate.properties]
| Field Summary | |
|---|---|
private static GeneralCacheAdministrator |
cache
|
private static Log |
LOG
|
static String |
OSCACHE_CONFIGURATION_RESOURCE_NAME
In the Hibernate system property you can specify the location of the oscache configuration file name. |
static String |
OSCACHE_CRON
The OSCache CRON expression property suffix. |
static String |
OSCACHE_REFRESH_PERIOD
The OSCache refresh period property suffix. |
| Constructor Summary | |
|---|---|
OSCacheProvider()
|
|
| Method Summary | |
|---|---|
org.hibernate.cache.Cache |
buildCache(String region,
Properties properties)
Builds a new Cache instance, and gets it's properties from the
GeneralCacheAdministrator GeneralCacheAdministrator
which reads the properties file (oscache.properties) in the start method: |
boolean |
isMinimalPutsEnabledByDefault()
This method isn't documented in Hibernate: |
long |
nextTimestamp()
|
void |
start(Properties hibernateSystemProperties)
|
void |
stop()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Log LOG
public static final String OSCACHE_CONFIGURATION_RESOURCE_NAME
public static final String OSCACHE_REFRESH_PERIOD
public static final String OSCACHE_CRON
private static GeneralCacheAdministrator cache
| Constructor Detail |
|---|
public OSCacheProvider()
| Method Detail |
|---|
public org.hibernate.cache.Cache buildCache(String region,
Properties properties)
throws org.hibernate.cache.CacheException
Cache instance, and gets it's properties from the
GeneralCacheAdministrator GeneralCacheAdministrator
which reads the properties file (oscache.properties) in the start method:
buildCache in interface org.hibernate.cache.CacheProviderregion - the region of the cacheproperties - not used
org.hibernate.cache.CacheExceptionstart(java.util.Properties),
CacheProvider.buildCache(java.lang.String, java.util.Properties)public long nextTimestamp()
nextTimestamp in interface org.hibernate.cache.CacheProviderCacheProvider.nextTimestamp()public boolean isMinimalPutsEnabledByDefault()
isMinimalPutsEnabledByDefault in interface org.hibernate.cache.CacheProviderCacheProvider.isMinimalPutsEnabledByDefault()public void stop()
stop in interface org.hibernate.cache.CacheProviderCacheProvider.stop()
public void start(Properties hibernateSystemProperties)
throws org.hibernate.cache.CacheException
start in interface org.hibernate.cache.CacheProviderorg.hibernate.cache.CacheExceptionCacheProvider.start(java.util.Properties)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||