org.apache.ojb.broker
Class PersistenceBrokerFactory

java.lang.Object
  extended by org.apache.ojb.broker.PersistenceBrokerFactory

public class PersistenceBrokerFactory
extends Object

Convenience factory class that produces PersistenceBroker instances.

Version:
$Id: PersistenceBrokerFactory.java,v 1.1 2007-08-24 22:17:36 ewestfal Exp $
Author:
Thomas Mahler
See Also:
PersistenceBrokerFactoryFactory, PersistenceBrokerFactoryIF

Constructor Summary
PersistenceBrokerFactory()
           
 
Method Summary
static PersistenceBroker createPersistenceBroker(PBKey key)
          Creates a new broker instance for the given key.
static PersistenceBroker createPersistenceBroker(String jcdAlias, String user, String password)
          Creates a new broker instance.
static PersistenceBroker defaultPersistenceBroker()
          Creates a default broker instance for the default broker key.
static Configurator getConfigurator()
          Returns the Configurator object.
static PBKey getDefaultKey()
          Returns the key that specifies the default persistence manager.
static void releaseAllInstances()
          Releases all broker instances pooled by this factory (if any).
static void setDefaultKey(PBKey key)
          Sets the key that specifies the default persistence manager.
static void shutdown()
          Shuts OJB down, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceBrokerFactory

public PersistenceBrokerFactory()
Method Detail

getConfigurator

public static Configurator getConfigurator()
Returns the Configurator object.

Returns:
The configurator

setDefaultKey

public static void setDefaultKey(PBKey key)
Sets the key that specifies the default persistence manager.

Parameters:
key - The default broker key
See Also:
PersistenceBrokerFactoryIF.setDefaultKey(org.apache.ojb.broker.PBKey)

getDefaultKey

public static PBKey getDefaultKey()
Returns the key that specifies the default persistence manager.

Returns:
The default broker key
See Also:
PersistenceBrokerFactoryIF.getDefaultKey()

defaultPersistenceBroker

public static PersistenceBroker defaultPersistenceBroker()
                                                  throws PBFactoryException
Creates a default broker instance for the default broker key.

Returns:
The persistence broker
Throws:
PBFactoryException
See Also:
PersistenceBrokerFactoryIF.defaultPersistenceBroker()

createPersistenceBroker

public static PersistenceBroker createPersistenceBroker(String jcdAlias,
                                                        String user,
                                                        String password)
                                                 throws PBFactoryException
Creates a new broker instance.

Parameters:
jcdAlias - The jdbc connection descriptor name as defined in the repository
user - The user name to be used for connecting to the database
password - The password to be used for connecting to the database
Returns:
The persistence broker
Throws:
PBFactoryException
See Also:
PersistenceBrokerFactoryIF.createPersistenceBroker(java.lang.String, java.lang.String, java.lang.String)

createPersistenceBroker

public static PersistenceBroker createPersistenceBroker(PBKey key)
                                                 throws PBFactoryException
Creates a new broker instance for the given key.

Parameters:
key - The broker key
Returns:
The persistence broker
Throws:
PBFactoryException
See Also:
PersistenceBrokerFactoryIF.createPersistenceBroker(org.apache.ojb.broker.PBKey)

releaseAllInstances

public static void releaseAllInstances()
Releases all broker instances pooled by this factory (if any). Note that the broker are closed prior to releasing them.

See Also:
PersistenceBrokerFactoryIF.releaseAllInstances()

shutdown

public static void shutdown()
Shuts OJB down, i.e. releases all resources. You should not use any OJB functionality after calling this method.

See Also:
PersistenceBrokerFactoryIF.shutdown()


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.