|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.torque.avalon.TorqueComponent
Avalon component for Torque.
Field Summary | |
private java.lang.String |
configFile
The configuration file for Torque. |
private org.apache.avalon.framework.context.Context |
context
The Avalon Context |
private TorqueInstance |
torqueInstance
The instance of Torque used by this component. |
Fields inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|
Constructor Summary | |
|
TorqueComponent()
Creates a new instance. |
protected |
TorqueComponent(TorqueInstance torqueInstance)
Creates a new instance. |
Method Summary | |
void |
closeConnection(java.sql.Connection con)
Closes a connection. |
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
void |
contextualize(org.apache.avalon.framework.context.Context context)
|
org.apache.commons.configuration.Configuration |
getConfiguration()
Get the configuration for this component. |
java.sql.Connection |
getConnection()
This method returns a Connection from the default pool. |
java.sql.Connection |
getConnection(java.lang.String name)
|
java.sql.Connection |
getConnection(java.lang.String name,
java.lang.String username,
java.lang.String password)
This method returns a Connecton using the given parameters. |
DatabaseMap |
getDatabaseMap()
Returns the default database map information. |
DatabaseMap |
getDatabaseMap(java.lang.String name)
Returns the database map information. |
DB |
getDB(java.lang.String name)
Returns database adapter for a specific connection pool. |
java.lang.String |
getDefaultDB()
Returns the name of the default database. |
AbstractBaseManager |
getManager(java.lang.String name)
This method returns a Manager for the given name. |
AbstractBaseManager |
getManager(java.lang.String name,
java.lang.String defaultClassName)
This methods returns either the Manager from the configuration file, or the default one provided by the generated code. |
private TorqueInstance |
getTorque()
|
void |
initialize()
|
boolean |
isInit()
Determine whether Torque has already been initialized. |
void |
registerMapBuilder(java.lang.String className)
Register a MapBuilder |
void |
start()
|
void |
stop()
|
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private org.apache.avalon.framework.context.Context context
private TorqueInstance torqueInstance
private java.lang.String configFile
Constructor Detail |
public TorqueComponent()
protected TorqueComponent(TorqueInstance torqueInstance)
torqueInstance
- The instance of the Torque core used by
this component.Method Detail |
private TorqueInstance getTorque()
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.ConfigurationException
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)
public void contextualize(org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextException
contextualize
in interface org.apache.avalon.framework.context.Contextualizable
org.apache.avalon.framework.context.ContextException
Contextualizable
public void initialize() throws java.lang.Exception
initialize
in interface org.apache.avalon.framework.activity.Initializable
java.lang.Exception
Initializable.initialize()
public void start()
start
in interface org.apache.avalon.framework.activity.Startable
Startable.start()
public void stop()
stop
in interface org.apache.avalon.framework.activity.Startable
Startable.stop()
public boolean isInit()
public org.apache.commons.configuration.Configuration getConfiguration()
public AbstractBaseManager getManager(java.lang.String name)
name
- name of the manager
public AbstractBaseManager getManager(java.lang.String name, java.lang.String defaultClassName)
name
- name of the managerdefaultClassName
- the class to use if name has not been configured
public DatabaseMap getDatabaseMap() throws TorqueException
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.public DatabaseMap getDatabaseMap(java.lang.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.public void registerMapBuilder(java.lang.String className)
className
- the MapBuilderpublic java.sql.Connection getConnection() throws TorqueException
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.public java.sql.Connection getConnection(java.lang.String name) throws TorqueException
name
- The database name.
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.public java.sql.Connection getConnection(java.lang.String name, java.lang.String username, java.lang.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.public DB getDB(java.lang.String name) throws TorqueException
name
- A pool name.
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.public java.lang.String getDefaultDB()
public void closeConnection(java.sql.Connection con)
con
- A Connection to close.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |