|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.cache.ObjectCachePerBrokerImpl
This local ObjectCache
implementation allows to have dedicated caches per broker.
All calls are delegated to the cache associated with the currentBroker.
When the broker was closed (returned to pool) the cache was cleared.
Implementation configuration properties:
Property Key | Property Values |
- | - |
Constructor Summary | |
ObjectCachePerBrokerImpl(PersistenceBroker broker,
java.util.Properties prop)
public Default Constructor |
Method Summary | |
void |
afterBegin(PBStateEvent event)
Called after a PersistenceBroker transaction was started. |
void |
afterCommit(PBStateEvent event)
Called after a PersistenceBroker commit was called. |
void |
afterOpen(PBStateEvent event)
Called after the PersistenceBroker
instance was obtained from pool. |
void |
afterRollback(PBStateEvent event)
Called after a PersistenceBroker rollback was called. |
void |
beforeBegin(PBStateEvent event)
Called before a PersistenceBroker transaction was started. |
void |
beforeClose(PBStateEvent event)
We clear the cache |
void |
beforeCommit(PBStateEvent event)
Called before a PersistenceBroker commit was called. |
void |
beforeRollback(PBStateEvent event)
Called before a PersistenceBroker rollback was called. |
void |
cache(Identity oid,
java.lang.Object obj)
Makes object persistent to the Objectcache. |
boolean |
cacheIfNew(Identity oid,
java.lang.Object obj)
|
void |
clear()
Clear ObjectCache. |
java.lang.Object |
lookup(Identity oid)
Lookup object with Identity oid in objectTable. |
void |
remove(Identity oid)
Removes an Object from the cache. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ObjectCachePerBrokerImpl(PersistenceBroker broker, java.util.Properties prop)
Method Detail |
public void clear()
clear
in interface ObjectCache
public void cache(Identity oid, java.lang.Object obj)
cache
in interface ObjectCache
oid
- Identity of the object to cache.obj
- The object to cache.public boolean cacheIfNew(Identity oid, java.lang.Object obj)
public java.lang.Object lookup(Identity oid)
lookup
in interface ObjectCache
oid
- Identity of the object to search for.
Identity
is found.public void remove(Identity oid)
remove
in interface ObjectCache
oid
- Identity of the object to be removed.public void beforeClose(PBStateEvent event)
beforeClose
in interface PBStateListener
public void afterOpen(PBStateEvent event)
PBStateListener
PersistenceBroker
instance was obtained from pool.
afterOpen
in interface PBStateListener
public void beforeBegin(PBStateEvent event)
PBStateListener
beforeBegin
in interface PBStateListener
public void afterBegin(PBStateEvent event)
PBStateListener
afterBegin
in interface PBStateListener
public void beforeCommit(PBStateEvent event)
PBStateListener
beforeCommit
in interface PBStateListener
public void afterCommit(PBStateEvent event)
PBStateListener
afterCommit
in interface PBStateListener
public void beforeRollback(PBStateEvent event)
PBStateListener
beforeRollback
in interface PBStateListener
public void afterRollback(PBStateEvent event)
PBStateListener
afterRollback
in interface PBStateListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |