|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neodatis.odb.impl.core.transaction.CrossSessionCache
public class CrossSessionCache
A cache that survives the sessions. It is uses to automatically reconnect object to sessions
When active, the cross session cache keeps track of all objects and their OID. It contains a map
Constructor Summary | |
---|---|
protected |
CrossSessionCache()
Protected constructor for factory-based construction |
Method Summary | |
---|---|
void |
addObject(java.lang.Object o,
OID oid)
Associates the specified OID with the specified object(key) in
this cache |
void |
clear()
Removes all mappings from this cache. |
static void |
clearAll()
|
boolean |
existObject(java.lang.Object object)
Returns true if this cache maps one key to the specified object. |
static ICrossSessionCache |
getInstance(java.lang.String baseIdentification)
Gets the unique instance for the cache for the identification |
OID |
getOid(java.lang.Object object)
Return the specific OID |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings. |
static void |
release(java.lang.String baseIdentification)
removes the cross session cache from static cache |
void |
removeObject(java.lang.Object object)
Removes the mapping for this object from this cache if it is present. |
void |
removeOid(OID oid)
Mark the object with the oid as deleted. |
int |
size()
Returns the number of key-value mappings in this cache. |
boolean |
slowExistObject(java.lang.Object object)
|
java.lang.String |
toString()
Returns a String writing down the objects |
static java.lang.String |
toStringAll()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected CrossSessionCache()
Method Detail |
---|
public static ICrossSessionCache getInstance(java.lang.String baseIdentification)
public static void release(java.lang.String baseIdentification)
baseIdentification
- public void addObject(java.lang.Object o, OID oid)
ICrossSessionCache
OID
with the specified object(key) in
this cache
addObject
in interface ICrossSessionCache
o
- The key. This parameter can not be null
public void clear()
ICrossSessionCache
clear
in interface ICrossSessionCache
public boolean existObject(java.lang.Object object)
ICrossSessionCache
existObject
in interface ICrossSessionCache
public boolean slowExistObject(java.lang.Object object)
public OID getOid(java.lang.Object object)
ICrossSessionCache
OID
getOid
in interface ICrossSessionCache
object
- The key on the cache for a OID
. This parameter can not be null
OID
. Returns null
in case no find key.public boolean isEmpty()
ICrossSessionCache
isEmpty
in interface ICrossSessionCache
public void removeObject(java.lang.Object object)
ICrossSessionCache
removeObject
in interface ICrossSessionCache
object
- that contains the reference to OID
. This parameter can not be null
public void removeOid(OID oid)
ICrossSessionCache
removeOid
in interface ICrossSessionCache
oid
- that must be marked as deleted.
When objects are deleted by oid, the cost is too high to search the object by the oid, so we just keep the deleted oid, and when looking for an object, check if the oid if is the deleted oids
public int size()
ICrossSessionCache
size
in interface ICrossSessionCache
public java.lang.String toString()
ICrossSessionCache
toString
in interface ICrossSessionCache
toString
in class java.lang.Object
public static java.lang.String toStringAll()
public static void clearAll()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |