org.castor.jdo.engine
Class DatabaseRegistry
java.lang.Object
org.castor.jdo.engine.DatabaseRegistry
public final class DatabaseRegistry
extends java.lang.Object
$Revision: 6036 $ $Date: 2006-04-10 16:39:24 -0600 (Mon, 10 Apr 2006) $static void | clear() - Reset all database configurations.
|
static AbstractConnectionFactory | getConnectionFactory(String name) - Get the ConnectionFactory for the given database name.
|
static boolean | hasDatabaseRegistries() - Check if any database configuration has been loaded.
|
static boolean | isDatabaseRegistred(String name) - Check if database configuration with given name has been loaded.
|
static void | loadDatabase(InputSource source, EntityResolver resolver, ClassLoader loader) - Instantiates a ConnectionFactory from the JDO configuration file
|
static void | loadDatabase(String name, String engine, DataSource datasource, Mapping mapping, TransactionManager txManager) - Instantiates a DataSourceConnectionFactory with given name, engine, datasource
and mapping.
|
static void | loadDatabase(JdoConf jdoConf, EntityResolver resolver, ClassLoader loader, String baseURI) - Creates a entry for every database and associates them with their name in a
map.
|
clear
public static void clear()
Reset all database configurations.
getConnectionFactory
public static AbstractConnectionFactory getConnectionFactory(String name)
throws MappingException
Get the ConnectionFactory for the given database name.
name
- Name of the database configuration.
- The ConnectionFactory for the given database name.
hasDatabaseRegistries
public static boolean hasDatabaseRegistries()
Check if any database configuration has been loaded.
true
if a databases configuration has been loaded.
isDatabaseRegistred
public static boolean isDatabaseRegistred(String name)
Check if database configuration with given name has been loaded.
name
- Name of the database to check if loaded.
true
if databases configuration has been loaded.
loadDatabase
public static void loadDatabase(InputSource source,
EntityResolver resolver,
ClassLoader loader)
throws MappingException
Instantiates a ConnectionFactory from the JDO configuration file
source
- InputSource
pointing to the JDO configuration.resolver
- An entity resolver.loader
- A class loader
loadDatabase
public static void loadDatabase(String name,
String engine,
DataSource datasource,
Mapping mapping,
TransactionManager txManager)
throws MappingException
Instantiates a DataSourceConnectionFactory with given name, engine, datasource
and mapping.
name
- The Name of the database configuration.engine
- The Name of the persistence factory to use.datasource
- The preconfigured datasource to use for creating connections.mapping
- The previously loaded mapping.txManager
- The transaction manager to use.
loadDatabase
public static void loadDatabase(JdoConf jdoConf,
EntityResolver resolver,
ClassLoader loader,
String baseURI)
throws MappingException
Creates a entry for every database and associates them with their name in a
map. It then instantiates all databases if
'org.exolab.castor.jdo.DatabaseInitializeAtLoad' key can not be found or is
set to true
in castor.properties file. If above property is set
to false
it will instantiate all databases only when they are
needed.
jdoConf
- An in-memory jdo configuration.resolver
- An entity resolver.loader
- A class loaderbaseURI
- The base URL for the mapping
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com