|
|||||||||
| 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 |
| - | - |
| Field Summary | |
protected java.util.Map |
objectTable
the hashtable holding all cached object |
| 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. |
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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Map objectTable
| 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 ObjectCachepublic java.lang.Object lookup(Identity oid)
lookup in interface ObjectCachepublic void remove(Identity oid)
remove in interface ObjectCacheoid - Identity of the object to be removed.public void beforeClose(PBStateEvent event)
beforeClose in interface PBStateListenerpublic void afterOpen(PBStateEvent event)
PBStateListenerPersistenceBroker
instance was obtained from pool.
afterOpen in interface PBStateListenerpublic void beforeBegin(PBStateEvent event)
PBStateListener
beforeBegin in interface PBStateListenerpublic void afterBegin(PBStateEvent event)
PBStateListener
afterBegin in interface PBStateListenerpublic void beforeCommit(PBStateEvent event)
PBStateListener
beforeCommit in interface PBStateListenerpublic void afterCommit(PBStateEvent event)
PBStateListener
afterCommit in interface PBStateListenerpublic void beforeRollback(PBStateEvent event)
PBStateListener
beforeRollback in interface PBStateListenerpublic 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 | ||||||||