org.apache.portals.graffito.store.impl.ojb
Class SpringOjbFactory

java.lang.Object
  extended by org.apache.portals.graffito.store.impl.ojb.SpringOjbFactory
All Implemented Interfaces:
OjbFactory

public class SpringOjbFactory
extends java.lang.Object
implements OjbFactory

Spring implementation for the OJB factory. This factory is managing the persistenceService broker instance per thread

Version:
Author:
Lombart Christophe

Constructor Summary
SpringOjbFactory()
           
 
Method Summary
 org.apache.ojb.broker.PersistenceBroker getPersistenceBroker(org.apache.ojb.broker.PBKey pbKey, boolean allowCreate)
          Get an OJB PersistenceBroker for the given PBKey.
 org.apache.ojb.broker.PersistenceBroker getPersistenceBroker(org.apache.ojb.broker.PBKey pbKey, boolean allowCreate, boolean allowSynchronization)
          Get an OJB PersistenceBroker for the given PBKey.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringOjbFactory

public SpringOjbFactory()
Method Detail

getPersistenceBroker

public org.apache.ojb.broker.PersistenceBroker getPersistenceBroker(org.apache.ojb.broker.PBKey pbKey,
                                                                    boolean allowCreate)
Description copied from interface: OjbFactory
Get an OJB PersistenceBroker for the given PBKey. Is aware of a corresponding PersistenceBroker bound to the current thread, for example when using PersistenceBrokerTransactionManager. Will create a new PersistenceBroker else, if allowCreate is true.

Specified by:
getPersistenceBroker in interface OjbFactory
Parameters:
pbKey - PBKey to create the PersistenceBroker for
allowCreate - if a new PersistenceBroker should be created if no thread-bound found
Returns:
the PersistenceBroker
See Also:
OjbFactory.getPersistenceBroker(org.apache.ojb.broker.PBKey, boolean)

getPersistenceBroker

public org.apache.ojb.broker.PersistenceBroker getPersistenceBroker(org.apache.ojb.broker.PBKey pbKey,
                                                                    boolean allowCreate,
                                                                    boolean allowSynchronization)
Description copied from interface: OjbFactory
Get an OJB PersistenceBroker for the given PBKey. Is aware of a corresponding PersistenceBroker bound to the current thread, for example when using PersistenceBrokerTransactionManager. Will create a new PersistenceBroker else.

Specified by:
getPersistenceBroker in interface OjbFactory
Parameters:
pbKey - PBKey to create the PersistenceBroker for
allowCreate - if a new PersistenceBroker should be created if no thread-bound found
allowSynchronization - if a new OJB PersistenceBroker is supposed to be registered with transaction synchronization (if synchronization is active). This will always be true for typical data access code.
Returns:
the PersistenceBroker
See Also:
OjbFactory.getPersistenceBroker(org.apache.ojb.broker.PBKey, boolean, boolean)


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.