org.springframework.datastore.redis
Class RedisSession
java.lang.Object
org.springframework.datastore.core.AbstractSession
org.springframework.datastore.redis.RedisSession
- All Implemented Interfaces:
- Session, SessionImplementor, EntityInterceptorAware
public class RedisSession
- extends AbstractSession
- Since:
- 1.0
Methods inherited from class org.springframework.datastore.core.AbstractSession |
addEntityInterceptor, attach, beginTransaction, cacheObject, clear, clear, contains, createQuery, delete, delete, flush, getAttribute, getDatastore, getFlushMode, getMappingContext, getPendingDeletes, getPendingInserts, getPendingUpdates, getPersister, getTransaction, persist, persist, proxy, refresh, retrieve, retrieveAll, retrieveAll, setAttribute, setEntityInterceptors, setFlushMode |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RedisSession
public RedisSession(Datastore ds,
MappingContext mappingContext,
RedisTemplate template)
createPersister
protected Persister createPersister(Class cls,
MappingContext mappingContext)
- Specified by:
createPersister
in class AbstractSession
isConnected
public boolean isConnected()
- Returns:
- true if connected to the datastore
disconnect
public void disconnect()
- Description copied from class:
AbstractSession
- Performs clear up. Subclasses should always call into this super
implementation.
- Specified by:
disconnect
in interface Session
- Overrides:
disconnect
in class AbstractSession
beginTransactionInternal
protected Transaction beginTransactionInternal()
- Specified by:
beginTransactionInternal
in class AbstractSession
lock
public void lock(Object o)
- Description copied from interface:
Session
- Obtains a write lock on the given object
- Specified by:
lock
in interface Session
- Overrides:
lock
in class AbstractSession
- Parameters:
o
- The object to lock
unlock
public void unlock(Object o)
- Description copied from interface:
Session
- Releases a lock, if not called all locked objects should be released by
Session.disconnect()
- Specified by:
unlock
in interface Session
- Overrides:
unlock
in class AbstractSession
- Parameters:
o
- The object to unlock
lock
public Object lock(Class type,
Serializable key)
- Description copied from interface:
Session
- Retrieves an individual object, using a write lock to prevent loss of updates
- Specified by:
lock
in interface Session
- Overrides:
lock
in class AbstractSession
- Parameters:
type
- The typekey
- The key
- Returns:
- The object
random
public Object random(Class type)
postFlush
protected void postFlush()
- Overrides:
postFlush
in class AbstractSession
pop
public Object pop(Class type)
getNativeInterface
public RedisTemplate getNativeInterface()
- Returns:
- The native interface to the datastore