org.castor.jdo.engine

Class AbstractConnectionFactory

public abstract class AbstractConnectionFactory extends Object implements ConnectionFactory

Since: 0.9.9

Version: $Revision: 1.4 $ $Date: 2005/08/17 13:37:07 $

Author: Werner Guttmann Ralf Joachim

Field Summary
static StringGENERIC_ENGINE
The name of the generic SQL engine, if no SQL engine specified.
Constructor Summary
protected AbstractConnectionFactory(String name, String engine, Mapping mapping, TransactionManager txManager)
Constructs a new AbstractConnectionFactory with given name, engine and mapping.
protected AbstractConnectionFactory(JdoConf jdoConf, int index, Mapping mapping)
Constructs a new AbstractConnectionFactory with given database and mapping.
Method Summary
DatabasegetDatabase()
Get the database configuration.
LockEnginegetEngine()
Get the LockEngine only available after initialization.
MappinggetMapping()
Get the mapping to load.
StringgetName()
Get the name of the database configuration.
TransactionManagergetTransactionManager()
Get the transaction manager.
voidinitialize()
Initialize factory if it had not been initialized before.
protected abstract voidinitializeFactory()
Initialize the concrete factory.

Field Detail

GENERIC_ENGINE

public static final String GENERIC_ENGINE
The name of the generic SQL engine, if no SQL engine specified.

Constructor Detail

AbstractConnectionFactory

protected AbstractConnectionFactory(String name, String engine, Mapping mapping, TransactionManager txManager)
Constructs a new AbstractConnectionFactory with given name, engine and mapping. Factory will be ready to use without calling initialize first.

Parameters: name The Name of the database configuration. engine The Name of the persistence factory to use. txManager The transaction manager to use. mapping The previously loaded mapping.

Throws: MappingException If LockEngine could not be initialized.

AbstractConnectionFactory

protected AbstractConnectionFactory(JdoConf jdoConf, int index, Mapping mapping)
Constructs a new AbstractConnectionFactory with given database and mapping. Initialize needs to be called before using the factory to create connections.

Parameters: jdoConf The jdo configuartion. index Index of the database configuration in the jdo configuration. mapping The mapping to load.

Method Detail

getDatabase

public final Database getDatabase()
Get the database configuration.

Returns: The database configuration.

getEngine

public final LockEngine getEngine()
Get the LockEngine only available after initialization.

Returns: The LockEngine.

getMapping

public final Mapping getMapping()
Get the mapping to load.

Returns: The mapping to load.

getName

public final String getName()
Get the name of the database configuration.

Returns: The name of the database configuration.

getTransactionManager

public final TransactionManager getTransactionManager()
Get the transaction manager.

Returns: The transaction manager.

initialize

public final void initialize()
Initialize factory if it had not been initialized before.

Throws: MappingException If concrete factory or LockEngine fail to initialize or mapping could not be loaded.

initializeFactory

protected abstract void initializeFactory()
Initialize the concrete factory.

Throws: MappingException If concrete factory could not be initialized.

Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com