org.apache.ojb.broker.core
Class PersistenceBrokerFactorySyncImpl
java.lang.Object
org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl
- All Implemented Interfaces:
- PersistenceBrokerFactoryIF, Configurable
public class PersistenceBrokerFactorySyncImpl
- extends PersistenceBrokerFactoryDefaultImpl
Workaround for participate the PB-api in JTA transaction by
implementing the Synchronization interface.
This may will be deprecated when we implemented a full JCA compliant connector.
When a new PersistenceBroker instance is created in method
wrapBrokerWithPoolingHandle(org.apache.ojb.broker.PersistenceBrokerInternal, org.apache.commons.pool.KeyedObjectPool)
the given PB instance is wrapped with PersistenceBrokerFactorySyncImpl.PersistenceBrokerSyncImpl before it was put to the PB-pool.
When a PB instance was requested class try to lookup the current JTA transaction in
wrapRequestedBrokerInstance(org.apache.ojb.broker.PersistenceBrokerInternal) before the pooled PB instance was wrapped with the PB handle.
If a running tx was found the PB instance was registered with the transaction using the
Synchronization interface.
- Version:
- $Id: PersistenceBrokerFactorySyncImpl.java,v 1.1 2007-08-24 22:17:35 ewestfal Exp $
- Author:
- Armin Waibel
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PersistenceBrokerFactorySyncImpl
public PersistenceBrokerFactorySyncImpl()
createPersistenceBroker
public PersistenceBrokerInternal createPersistenceBroker(PBKey pbKey)
throws PBFactoryException
- Description copied from class:
PersistenceBrokerFactoryDefaultImpl
- Return broker instance from pool. If given
PBKey was not found in pool
a new pool for given
- Specified by:
createPersistenceBroker in interface PersistenceBrokerFactoryIF- Overrides:
createPersistenceBroker in class PersistenceBrokerFactoryDefaultImpl
- Throws:
PBFactoryException
wrapBrokerWithPoolingHandle
protected PersistenceBrokerInternal wrapBrokerWithPoolingHandle(PersistenceBrokerInternal broker,
org.apache.commons.pool.KeyedObjectPool pool)
- Description copied from class:
PersistenceBrokerFactoryDefaultImpl
- Each real pooled
PersistenceBroker instance was wrapped by a
pooling handle when a new instance was created.
- Overrides:
wrapBrokerWithPoolingHandle in class PersistenceBrokerFactoryDefaultImpl
- Parameters:
broker - real PersistenceBroker instancepool - use KeyedObjectPool
- Returns:
- wrapped broker instance
- See Also:
PoolablePersistenceBroker
wrapRequestedBrokerInstance
protected PersistenceBrokerInternal wrapRequestedBrokerInstance(PersistenceBrokerInternal broker)
- Description copied from class:
PersistenceBrokerFactoryDefaultImpl
- Wraps the requested pooled broker instance. The returned handle
warps a pooled broker instance to avoid corruption
of already closed broker instances.
- Overrides:
wrapRequestedBrokerInstance in class PersistenceBrokerFactoryDefaultImpl
- Returns:
- The broker handle.
- See Also:
PersistenceBrokerHandle
Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.