|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
This is the default implementation of the PersistenceBrokerFactoryIF
interface.
This implementation use a pool of PersistenceBroker
instances [abbr. PB]. Each pooled PB instance (the implementation class was specified
in OJB configuration file) is wrapped by PoolablePersistenceBroker class
before add to pool.
When calling createPersistenceBroker(org.apache.ojb.broker.PBKey) or PersistenceBrokerFactoryBaseImpl.defaultPersistenceBroker() the pooled-PB
instance (PoolablePersistenceBroker) on its part was wrapped with PersistenceBrokerHandle
handle.
When a client do a PB.close() call on the handle the wrapped PoolablePersistenceBroker will be closed and returned to pool. All further method calls on the handle (except PB.isClosed() and PB.isInTransaction()) result in an exception.
Each differentPBKey (based on PBKey.equals(...) method)
get its own PB-pool.
PersistenceBrokerFactoryBaseImpl| Constructor Summary | |
PersistenceBrokerFactoryDefaultImpl()
|
|
| Method Summary | |
int |
activePersistenceBroker()
Not implemented! |
PersistenceBrokerInternal |
createPersistenceBroker(PBKey pbKey)
Return broker instance from pool. |
java.util.Properties |
getPoolConfiguration()
could be used for monitoring TODO: is this useful? |
void |
releaseAllInstances()
release all broker instances pooled by the factory. |
void |
setPoolConfiguration(java.util.Properties prop)
could be used for runtime configuration TODO: is this useful? |
void |
shutdown()
Shutdown method for OJB, kills all running processes within OJB - after shutdown OJB can no longer be used. |
| Methods inherited from class org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl |
configure, createPersistenceBroker, defaultPersistenceBroker, getDefaultKey, setDefaultKey |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PersistenceBrokerFactoryDefaultImpl()
| Method Detail |
public PersistenceBrokerInternal createPersistenceBroker(PBKey pbKey)
throws PBFactoryException
PBKey was not found in pool
a new pool for given
createPersistenceBroker in interface PersistenceBrokerFactoryIFcreatePersistenceBroker in class PersistenceBrokerFactoryBaseImplpbKey -
PBFactoryExceptionpublic void releaseAllInstances()
PersistenceBrokerFactoryIF
releaseAllInstances in interface PersistenceBrokerFactoryIFreleaseAllInstances in class PersistenceBrokerFactoryBaseImplPersistenceBrokerFactoryIF.releaseAllInstances()public void shutdown()
PersistenceBrokerFactoryIFThreadLocal instances in OJB source and the reuse of threads
by the container (e.g. servlet- or ejb-container).
shutdown in interface PersistenceBrokerFactoryIFshutdown in class PersistenceBrokerFactoryBaseImplpublic int activePersistenceBroker()
PersistenceBrokerFactoryBaseImpl
activePersistenceBroker in interface PersistenceBrokerFactoryIFactivePersistenceBroker in class PersistenceBrokerFactoryBaseImplpublic java.util.Properties getPoolConfiguration()
public void setPoolConfiguration(java.util.Properties prop)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||