org.openspaces.hibernate.cache
Class AbstractMapCacheProvider
java.lang.Object
org.openspaces.hibernate.cache.AbstractMapCacheProvider
- All Implemented Interfaces:
- org.hibernate.cache.CacheProvider
- Direct Known Subclasses:
- SimpleMapCacheProvider, TransactionalMapCacheProvider
public abstract class AbstractMapCacheProvider
- extends Object
- implements org.hibernate.cache.CacheProvider
Base class for pure Space (no OpenSpaces components) Hibernate cache provider. Uses the
property gigaspace.hibernate.cache.url
to retrieve the Space/Cache url. Also
passes the properites object to the Space/Cache construction allowing to fully configure
the cache using Hibernate cache proeprties (for example, have "xpath" configuration set
there).
Allows to configure the time to live of cache entries within the Space using the
gigaspace.hibernate.cache.timeToLive
property. Defaults to Long.MAX_VALUE
.
Stops the local cache when this cache provider stops. Also stops the master Space if it
was started in an embedded mode.
- Author:
- kimchy
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.hibernate.cache.CacheProvider |
buildCache |
log
protected final Log log
CACHE_URL_PROPERTY
public static final String CACHE_URL_PROPERTY
- See Also:
- Constant Field Values
TIME_TO_LIVE_PROPERTY
public static final String TIME_TO_LIVE_PROPERTY
- See Also:
- Constant Field Values
WAIT_FOR_RESPONSE_PROPERTY
public static final String WAIT_FOR_RESPONSE_PROPERTY
- See Also:
- Constant Field Values
AbstractMapCacheProvider
public AbstractMapCacheProvider()
start
public void start(Properties properties)
throws org.hibernate.cache.CacheException
- Starts the pure GigaSpace Hibernate cache provider. Uses
gigaspace.hibernate.cache.url
property to fetch the cache url. Also passes the proeprties to the CacheFinder.find(String, java.util.Properties)
so any additional Space related properties can be set.
- Specified by:
start
in interface org.hibernate.cache.CacheProvider
- Throws:
org.hibernate.cache.CacheException
doStart
protected void doStart(Properties properties)
throws org.hibernate.cache.CacheException
- Subclasses can implement this method in order to perform additional operations
during startup.
- Throws:
org.hibernate.cache.CacheException
stop
public void stop()
- Stops the local cache. If the master Space was started in embedded mode, will also
stop the master space.
- Specified by:
stop
in interface org.hibernate.cache.CacheProvider
doStop
protected void doStop()
nextTimestamp
public long nextTimestamp()
- Specified by:
nextTimestamp
in interface org.hibernate.cache.CacheProvider
isMinimalPutsEnabledByDefault
public boolean isMinimalPutsEnabledByDefault()
- Specified by:
isMinimalPutsEnabledByDefault
in interface org.hibernate.cache.CacheProvider
getMap
protected IMap getMap()
getTimeToLive
protected long getTimeToLive()
getWaitForResponse
protected long getWaitForResponse()
Copyright © GigaSpaces.