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

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

public class DefaultOjbFactory
extends java.lang.Object
implements OjbFactory

Default implementation for OjbFactory. This class is mainly used if Graffito is not running on container which support transaction management. For a better transaction support, specific implementation is required. Eg.If Graffito is running on Spring, the spring OjbFactory has to be use (SpringOjbFactory

Version:
Author:
Lombart Christophe

Constructor Summary
DefaultOjbFactory()
           
 
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

DefaultOjbFactory

public DefaultOjbFactory()
Method Detail

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:
Note : allowSynchronization is not used for this default implementation. Can be used for other implementations

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)


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