Method Summary |
|
public void | closeConnection(Connection con) Closes a connection. |
public Configuration | getConfiguration() Get the configuration for this component. |
public Connection | getConnection() This method returns a Connection from the default pool. |
public Connection | getConnection(String name) Returns a database connection to the database with the key
name .
Parameters: name - The database name. |
public Connection | getConnection(String name, String username, String password) This method returns a Connection using the given parameters.
You should only use this method if you need user based access to the
database!
Parameters: name - The database name. Parameters: username - The name of the database user. Parameters: password - The password of the database user. |
public DB | getDB(String name) Returns the database adapter for a specific database.
Parameters: name - the name of the database to get the adapter for. |
public DataSourceFactory | getDataSourceFactory(String name) Returns the DataSourceFactory for the database with the name
name .
Parameters: name - The name of the database to get the DSF for. |
public Database | getDatabase(String databaseName) Returns the database for the key databaseName .
Parameters: databaseName - the key to get the database for. |
public DatabaseMap | getDatabaseMap() Returns the default database map information. |
public DatabaseMap | getDatabaseMap(String name) Returns the database map information. |
public Map | getDatabases() Returns a Map containing all Databases registered to Torque.
The key of the Map is the name of the database, and the value is the
database instance. |
public String | getDefaultDB() Returns the name of the default database. |
public AbstractBaseManager | getManager(String name) This method returns a Manager for the given name. |
public 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. |
public MapBuilder | getMapBuilder(String className) |
public Map | getMapBuilders() |
public Database | getOrCreateDatabase(String databaseName) Returns the database for the key databaseName .
If no database is associated to the specified key,
a new database is created, mapped to the specified key, and returned.
Parameters: databaseName - the key to get the database for. |
public String | getSchema(String name) This method returns the current schema for a database connection
Parameters: name - The database name. |
public void | init(String configFile) Initialization of Torque with a properties file. |
public synchronized void | init(Configuration conf) Initialization of Torque with a Configuration object. |
protected void | initManagerMappings(Configuration conf) Creates a mapping between classes and their manager classes.
The mapping is built according to settings present in
properties file. |
public boolean | isInit() Determine whether Torque has already been initialized. |
public void | registerMapBuilder(String className) |
public void | registerMapBuilder(MapBuilder builder) |
public void | setConfiguration(Configuration conf) Sets the configuration for Torque and all dependencies. |
public void | setSchema(String name, String schema) |
public synchronized void | shutdown() Shuts down the service.
This method halts the IDBroker's daemon thread in all of
the DatabaseMap's. |