|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Torque
Avalon role interface for Torque.
Field Summary | |
---|---|
static String |
ROLE
The avalon role. |
Method Summary | |
---|---|
void |
closeConnection(Connection con)
Closes a connection. |
org.apache.commons.configuration.Configuration |
getConfiguration()
Get the configuration for this component. |
Connection |
getConnection()
This method returns a Connection from the default pool. |
Connection |
getConnection(String name)
|
Connection |
getConnection(String name,
String username,
String password)
This method returns a Connecton using the given parameters. |
Database |
getDatabase(String databaseName)
Returns the database for the key databaseName . |
DatabaseMap |
getDatabaseMap()
Returns the default database map information. |
DatabaseMap |
getDatabaseMap(String name)
Returns the database map information. |
Map |
getDatabases()
Returns a Map containing all Databases registered to Torque. |
DB |
getDB(String name)
Returns database adapter for a specific connection pool. |
String |
getDefaultDB()
Returns the name of the default database. |
AbstractBaseManager |
getManager(String name)
This method returns a Manager for the given name. |
AbstractBaseManager |
getManager(String name,
String defaultClassName)
This methods returns either the Manager from the configuration file, or the default one provided by the generated code. |
MapBuilder |
getMapBuilder(String className)
Get a MapBuilder |
Database |
getOrCreateDatabase(String databaseName)
Returns the database for the key databaseName . |
String |
getSchema(String name)
This method returns the current schema for a database connection |
boolean |
isInit()
Determine whether Torque has already been initialized. |
void |
registerMapBuilder(MapBuilder builder)
Register a MapBuilder |
void |
registerMapBuilder(String className)
Register a MapBuilder |
void |
setSchema(String name,
String schema)
Sets the current schema for a database connection |
Field Detail |
---|
static final String ROLE
Method Detail |
---|
boolean isInit()
org.apache.commons.configuration.Configuration getConfiguration()
AbstractBaseManager getManager(String name)
name
- name of the manager
AbstractBaseManager getManager(String name, String defaultClassName)
name
- name of the managerdefaultClassName
- the class to use if name has not been configured
DatabaseMap getDatabaseMap() throws TorqueException
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.DatabaseMap getDatabaseMap(String name) throws TorqueException
name
- The name of the database corresponding to the
DatabaseMap
to retrieve.
DatabaseMap
.
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.void registerMapBuilder(String className)
className
- the MapBuildervoid registerMapBuilder(MapBuilder builder)
builder
- the instance of the MapBuilderMapBuilder getMapBuilder(String className) throws TorqueException
className
- of the MapBuilder
TorqueException
- if the Map Builder cannot be instantiatedConnection getConnection() throws TorqueException
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.Connection getConnection(String name) throws TorqueException
name
- The database name.
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.Connection getConnection(String name, String username, String password) throws TorqueException
name
- The database name.username
- The name of the database user.password
- The password of the database user.
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.DB getDB(String name) throws TorqueException
name
- A pool name.
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.String getDefaultDB()
void closeConnection(Connection con)
con
- A Connection to close.void setSchema(String name, String schema) throws TorqueException
name
- The database name.schema
- The current schema name
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.String getSchema(String name) throws TorqueException
name
- The database name.
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.Database getDatabase(String databaseName) throws TorqueException
databaseName
.
databaseName
- the key to get the database for.
TorqueException
- if Torque is not yet initialized.Map getDatabases() throws TorqueException
TorqueException
- if Torque is not yet initialized.Database getOrCreateDatabase(String databaseName)
databaseName
.
If no database is associated to the specified key,
a new database is created, mapped to the specified key, and returned.
databaseName
- the key to get the database for.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |