org.neodatis.odb.core.transaction
Interface ICrossSessionCache
-
- All Known Implementing Classes:
- CrossSessionCache
public interface ICrossSessionCacheThis interface define the control over objects alive across different sessions. It is a wrapper for all objects put into cross cache. It's primary purpose is to maintain references to the linked objects that has been used. Different strategies can be used on the implementations to support the idea of a cache based on weak reference.- Since:
- 1.9
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddObject(java.lang.Object object, OID oid)Associates the specifiedOIDwith the specified object(key) in this cachevoidclear()Removes all mappings from this cache.booleanexistObject(java.lang.Object object)Returns true if this cache maps one key to the specified object.OIDgetOid(java.lang.Object object)Return the specificOIDbooleanisEmpty()Returns true if this map contains no key-value mappings.voidremoveObject(java.lang.Object object)Removes the mapping for this object from this cache if it is present.voidremoveOid(OID oid)Mark the object with the oid as deleted.intsize()Returns the number of key-value mappings in this cache.java.lang.StringtoString()Returns a String writing down the objects
-
-
-
Method Detail
-
addObject
void addObject(java.lang.Object object, OID oid)Associates the specifiedOIDwith the specified object(key) in this cache- Parameters:
object- The key. This parameter can not benull{@link- OID} The value. It is transformed to use weak reference for the keys.
-
removeObject
void removeObject(java.lang.Object object)
Removes the mapping for this object from this cache if it is present.- Parameters:
object- that contains the reference toOID. This parameter can not benull
-
removeOid
void removeOid(OID oid)
Mark the object with the oid as deleted.- Parameters:
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
-
existObject
boolean existObject(java.lang.Object object)
Returns true if this cache maps one key to the specified object.- Parameters:
object-- Returns:
- boolean
-
isEmpty
boolean isEmpty()
Returns true if this map contains no key-value mappings.- Returns:
- boolean
-
clear
void clear()
Removes all mappings from this cache.
-
toString
java.lang.String toString()
Returns a String writing down the objects- Overrides:
toStringin classjava.lang.Object- Returns:
- String
-
size
int size()
Returns the number of key-value mappings in this cache.- Returns:
- int The amount of objects on the cache
-
-
DataMelt 3.0 © DataMelt by jWork.ORG