public class RedissonLiveObjectService extends Object implements RLiveObjectService
| Constructor and Description |
|---|
RedissonLiveObjectService(RedissonClient redisson,
ConcurrentMap<Class<?>,Class<?>> classCache) |
| Modifier and Type | Method and Description |
|---|---|
<T> RLiveObject |
asLiveObject(T instance)
To cast the instance to RLiveObject instance.
|
<T> RExpirable |
asRExpirable(T instance)
To cast the instance to RExpirable instance.
|
<T,K,V> RMap<K,V> |
asRMap(T instance)
To cast the instance to RMap instance.
|
<T> T |
attach(T detachedObject)
Returns proxied object for the detached object.
|
<T,K> boolean |
delete(Class<T> entityClass,
K id)
Deletes object by class and id including all nested objects.
|
<T> void |
delete(T attachedObject)
Deletes attached object including all nested objects.
|
<T> T |
detach(T attachedObject)
Returns unproxied detached object for the attached object.
|
<T,K> T |
get(Class<T> entityClass,
K id)
Finds the entity from Redis with the id.
|
RMap<String,Object> |
getMap(Object proxied) |
boolean |
isClassRegistered(Class cls)
Check if the class is registered in the cache.
|
<T> boolean |
isExists(T instance)
Returns true if the RLiveObject already exists in redis.
|
<T> boolean |
isLiveObject(T instance)
Returns true if the instance is a instance of RLiveObject.
|
<T> T |
merge(T detachedObject)
Returns proxied object for the detached object.
|
<T> T |
persist(T detachedObject)
Returns proxied attached object for the detached object.
|
void |
registerClass(Class cls)
Pre register the class with the service, registering all the classes on
startup can speed up the instance creation.
|
void |
unregisterClass(Class cls)
Unregister the class with the service.
|
public RedissonLiveObjectService(RedissonClient redisson, ConcurrentMap<Class<?>,Class<?>> classCache)
public <T,K> T get(Class<T> entityClass, K id)
RLiveObjectServiceget in interface RLiveObjectServiceT - Entity typeK - Key typeentityClass - Entity classid - identifierpublic <T> T attach(T detachedObject)
RLiveObjectServiceattach in interface RLiveObjectServiceT - Entity typedetachedObject - - not proxied objectpublic <T> T merge(T detachedObject)
RLiveObjectServicemerge in interface RLiveObjectServiceT - Entity typedetachedObject - - not proxied objectpublic <T> T persist(T detachedObject)
RLiveObjectServicepersist in interface RLiveObjectServiceT - Entity typedetachedObject - - not proxied objectpublic <T> T detach(T attachedObject)
RLiveObjectServicedetach in interface RLiveObjectServiceT - Entity typeattachedObject - - proxied objectpublic <T> void delete(T attachedObject)
RLiveObjectServicedelete in interface RLiveObjectServiceT - Entity typeattachedObject - - proxied objectpublic <T,K> boolean delete(Class<T> entityClass, K id)
RLiveObjectServicedelete in interface RLiveObjectServiceT - Entity typeK - Key typeentityClass - - object classid - - object idtrue if entity was deleted successfully, false otherwisepublic <T> RLiveObject asLiveObject(T instance)
RLiveObjectServiceasLiveObject in interface RLiveObjectServiceT - type of instanceinstance - - live objectpublic <T> RExpirable asRExpirable(T instance)
RLiveObjectServiceasRExpirable in interface RLiveObjectServiceT - type of instanceinstance - - live objectpublic <T,K,V> RMap<K,V> asRMap(T instance)
RLiveObjectServiceasRMap in interface RLiveObjectServiceT - type of instanceK - type of keyV - type of valueinstance - - live objectpublic <T> boolean isLiveObject(T instance)
RLiveObjectServiceisLiveObject in interface RLiveObjectServiceT - type of instanceinstance - - live objecttrue object is RLiveObjectpublic <T> boolean isExists(T instance)
RLiveObjectServiceisExists in interface RLiveObjectServiceT - type of instanceinstance - - live objecttrue object existspublic void registerClass(Class cls)
RLiveObjectServiceregisterClass in interface RLiveObjectServicecls - - classpublic void unregisterClass(Class cls)
RLiveObjectServiceunregisterClass in interface RLiveObjectServicecls - It can be either the proxied class or the unproxied conterpart.public boolean isClassRegistered(Class cls)
RLiveObjectServiceisClassRegistered in interface RLiveObjectServicecls - - type of instancetrue if class already registeredCopyright © 2014–2018 The Redisson Project. All rights reserved.