|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.persistence.proxy.SharedCache
public class SharedCache
INTERNAL: A shared storage cache implementation. The cache uses a lookup index to store its cache entries. This cache is transaction independent.
Field Summary | |
---|---|
protected ClusterIF |
cluster
|
protected TicketIF |
current_ticket
|
protected long |
current_ticket_value
|
protected java.util.Map |
datacache
|
protected int |
eviction
|
protected java.util.Map |
field_counts
|
protected StorageIF |
storage
|
protected long |
timestamp
|
Method Summary | |
---|---|
void |
clear(boolean notifyCluster)
INTERNAL: Clears the cache. |
void |
close()
INTERNAL: Releases all resources used by the storage cache. |
IdentityIF |
createIdentity(java.lang.Object type,
long key)
INTERNAL: Factory method for creating new identity objects. |
IdentityIF |
createIdentity(java.lang.Object type,
java.lang.Object key)
INTERNAL: Factory method for creating new identity objects. |
IdentityIF |
createIdentity(java.lang.Object type,
java.lang.Object[] keys)
INTERNAL: Factory method for creating new identity objects. |
void |
evictField(IdentityIF identity,
int field,
boolean notifyCluster)
INTERNAL: Evict the identity's field value from the cache. |
void |
evictFields(IdentityIF identity,
boolean notifyCluster)
INTERNAL: Evict all the identity's field values from the cache. |
void |
evictIdentity(IdentityIF identity,
boolean notifyCluster)
INTERNAL: Evict the identity from the cache. |
boolean |
exists(StorageAccessIF access,
IdentityIF identity)
INTERNAL: Can be called to verify whether the specified identity exists in the cache or in the data repository. |
protected int |
getFieldsCount(java.lang.Object type)
|
AccessRegistrarIF |
getRegistrar()
INTERNAL: Returns the access registrar instance that is used by the storage cache. |
TicketIF |
getTicket()
INTERNAL: Get ticket that should be used as first argument to register methods. |
java.lang.Object |
getValue(StorageAccessIF access,
IdentityIF identity,
int field)
INTERNAL: A call forwarded by the transaction (TransactionIF) from persistent objects (PersistentIF) when the field value needs to be retrieved from storage. |
boolean |
isFieldLoaded(IdentityIF identity,
int field)
INTERNAL: Can be called to check if the specfied field has been registered with the cache. |
boolean |
isObjectLoaded(IdentityIF identity)
INTERNAL: Can be called to check if the identity has been registered with the cache. |
int |
prefetch(StorageAccessIF access,
java.lang.Object type,
int field,
int nextField,
boolean traverse,
java.util.Collection identities)
|
void |
registerEviction()
INTERNAL: Tells the cache that eviction is starting. |
void |
registerField(TicketIF ticket,
IdentityIF identity,
int field,
java.lang.Object value)
INTERNAL: Called by storage accessors (FieldAccessIF) when they read the value of an object field from the database. |
void |
registerIdentity(TicketIF ticket,
IdentityIF identity)
INTERNAL: Called by storage accessors (QueryIFs or FieldAccessIF) when they locate the identity of an object in the database. |
void |
releaseEviction()
INTERNAL: Deregister eviction. |
void |
setCluster(ClusterIF cluster)
|
java.lang.String |
toString()
|
void |
writeReport(java.io.Writer out,
boolean dumpCache)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected StorageIF storage
protected java.util.Map datacache
protected long current_ticket_value
protected TicketIF current_ticket
protected int eviction
protected ClusterIF cluster
protected long timestamp
protected java.util.Map field_counts
Method Detail |
---|
public void setCluster(ClusterIF cluster)
public AccessRegistrarIF getRegistrar()
StorageCacheIF
getRegistrar
in interface StorageCacheIF
public void close()
StorageCacheIF
close
in interface StorageCacheIF
public boolean exists(StorageAccessIF access, IdentityIF identity)
StorageCacheIF
exists
in interface StorageCacheIF
public java.lang.Object getValue(StorageAccessIF access, IdentityIF identity, int field)
StorageCacheIF
getValue
in interface StorageCacheIF
public boolean isObjectLoaded(IdentityIF identity)
StorageCacheIF
isObjectLoaded
in interface StorageCacheIF
public boolean isFieldLoaded(IdentityIF identity, int field)
StorageCacheIF
isFieldLoaded
in interface StorageCacheIF
public void evictIdentity(IdentityIF identity, boolean notifyCluster)
StorageCacheIF
evictIdentity
in interface StorageCacheIF
public void evictFields(IdentityIF identity, boolean notifyCluster)
StorageCacheIF
evictFields
in interface StorageCacheIF
public void evictField(IdentityIF identity, int field, boolean notifyCluster)
StorageCacheIF
evictField
in interface StorageCacheIF
public int prefetch(StorageAccessIF access, java.lang.Object type, int field, int nextField, boolean traverse, java.util.Collection identities)
prefetch
in interface StorageCacheIF
public IdentityIF createIdentity(java.lang.Object type, long key)
AccessRegistrarIF
createIdentity
in interface AccessRegistrarIF
public IdentityIF createIdentity(java.lang.Object type, java.lang.Object key)
AccessRegistrarIF
createIdentity
in interface AccessRegistrarIF
public IdentityIF createIdentity(java.lang.Object type, java.lang.Object[] keys)
AccessRegistrarIF
createIdentity
in interface AccessRegistrarIF
public void registerIdentity(TicketIF ticket, IdentityIF identity)
AccessRegistrarIF
registerIdentity
in interface AccessRegistrarIF
public void registerField(TicketIF ticket, IdentityIF identity, int field, java.lang.Object value)
AccessRegistrarIF
registerField
in interface AccessRegistrarIF
public TicketIF getTicket()
AccessRegistrarIF
getTicket
in interface AccessRegistrarIF
public void registerEviction()
StorageCacheIF
registerEviction
in interface StorageCacheIF
public void releaseEviction()
StorageCacheIF
releaseEviction
in interface StorageCacheIF
protected int getFieldsCount(java.lang.Object type)
public void clear(boolean notifyCluster)
StorageCacheIF
clear
in interface StorageCacheIF
public void writeReport(java.io.Writer out, boolean dumpCache) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |