Class PersistenceBrokerFactorySyncImpl

  extended by
      extended by
          extended by
All Implemented Interfaces:

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.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( 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.

$Id: 365232 2005-12-21 22:36:07Z tomdz $
Armin Waibel

Nested Class Summary
static class PersistenceBrokerFactorySyncImpl.PersistenceBrokerSyncImpl
Constructor Summary
Method Summary
 PersistenceBrokerInternal createPersistenceBroker(PBKey pbKey)
          Return broker instance from pool.
Methods inherited from class
activePersistenceBroker, getPoolConfiguration, releaseAllInstances, setPoolConfiguration, shutdown
Methods inherited from class
configure, createPersistenceBroker, defaultPersistenceBroker, getDefaultKey, setDefaultKey
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public PersistenceBrokerFactorySyncImpl()
Method Detail


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
createPersistenceBroker in class PersistenceBrokerFactoryDefaultImpl

(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
Version: 1.0.4, 2005-12-30