public final class DatabaseRegistry
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
clear()
Reset all database configurations.
|
static AbstractConnectionFactory |
getConnectionFactory(java.lang.String name)
Get the ConnectionFactory for the given database name.
|
static boolean |
hasDatabaseRegistries()
Check if any database configuration has been loaded.
|
static boolean |
isDatabaseRegistred(java.lang.String name)
Check if database configuration with given name has been loaded.
|
static void |
loadDatabase(org.xml.sax.InputSource source,
org.xml.sax.EntityResolver resolver,
java.lang.ClassLoader loader)
Instantiates a ConnectionFactory from the JDO configuration file
|
static void |
loadDatabase(JdoConf jdoConf,
org.xml.sax.EntityResolver resolver,
java.lang.ClassLoader loader,
java.lang.String baseURI)
Creates a entry for every database and associates them with their name in a
map.
|
static void |
loadDatabase(java.lang.String name,
java.lang.String engine,
javax.sql.DataSource datasource,
Mapping mapping,
javax.transaction.TransactionManager txManager)
Instantiates a DataSourceConnectionFactory with given name, engine, datasource
and mapping.
|
public static void loadDatabase(java.lang.String name,
java.lang.String engine,
javax.sql.DataSource datasource,
Mapping mapping,
javax.transaction.TransactionManager txManager)
throws MappingException
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.MappingException - If LockEngine could not be initialized.public static void loadDatabase(org.xml.sax.InputSource source,
org.xml.sax.EntityResolver resolver,
java.lang.ClassLoader loader)
throws MappingException
source - InputSource pointing to the JDO configuration.resolver - An entity resolver.loader - A class loaderMappingException - If the database cannot be instantiated/loadeed.public static void loadDatabase(JdoConf jdoConf, org.xml.sax.EntityResolver resolver, java.lang.ClassLoader loader, java.lang.String baseURI) throws MappingException
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 mappingMappingException - If the database cannot be instantiated/loadeed.public static boolean hasDatabaseRegistries()
true if a databases configuration has been loaded.public static boolean isDatabaseRegistred(java.lang.String name)
name - Name of the database to check if loaded.true if databases configuration has been loaded.public static AbstractConnectionFactory getConnectionFactory(java.lang.String name) throws MappingException
name - Name of the database configuration.MappingException - If database can not be instantiated.public static void clear()
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com