Java Doc for Torque.java in  » Database-ORM » Torque » org » apache » torque » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » Torque » org.apache.torque 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.torque.Torque

Torque
public class Torque (Code)
A static facade wrapper around the Torque implementation (which is in org.apache.torque.TorqueInstance ).

author:
   Daniel Rall
author:
   Magn�s ��r Torfason
author:
   Jason van Zyl
author:
   Rafal Krzewski
author:
   Martin Poeschl
author:
   Henning P. Schmiedehausen
author:
   Kurt Schrader
version:
   $Id: Torque.java 493449 2007-01-06 11:46:50Z tv $


Field Summary
final public static  StringCACHE_KEY
     property to determine whether caching is used.
final public static  StringDATABASE_DEFAULT
     Name of property that specifies the default map builder and map.
final public static  StringDATABASE_KEY
     The prefix for configuring the database adapters and the default database.
final public static  StringDEFAULT_KEY
     The key used to configure the name of the default database.
final public static  StringMANAGER_PREFIX
     A prefix for Manager properties in the configuration.
final public static  StringMANAGER_SUFFIX
     A Service property determining its implementing class name .
final public static  StringTORQUE_KEY
     The prefix for all configuration keys used by Torque.

Constructor Summary
public  Torque()
     C'tor for usage with the Stratum Lifecycle.

Method Summary
public static  voidcloseConnection(Connection con)
     Closes a connection.
public static  ConfigurationgetConfiguration()
     Get the configuration for this component.
public static  ConnectiongetConnection()
     This method returns a Connection from the default pool.
public static  ConnectiongetConnection(String name)
     This method returns a Connecton using the given database name.
Parameters:
  name - The database name.
public static  ConnectiongetConnection(String name, String username, String password)
     This method returns a Connecton 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 static  DBgetDB(String name)
     Returns database adapter for a specific connection pool.
Parameters:
  name - A pool name.
public static  DatabasegetDatabase(String name)
     Returns the database for the given key.
Parameters:
  name - The database name.
public static  DatabaseMapgetDatabaseMap()
     Returns the default database map information.
public static  DatabaseMapgetDatabaseMap(String name)
     Returns the database map information.
public static  MapgetDatabases()
     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 static  StringgetDefaultDB()
     Returns the name of the default database.
public static  TorqueInstancegetInstance()
     Retrieves the single org.apache.torque.TorqueInstance used by this class.
public static  AbstractBaseManagergetManager(String name)
     This method returns a Manager for the given name.
public static  AbstractBaseManagergetManager(String name, String defaultClassName)
     This methods returns either the Manager from the configuration file, or the default one provided by the generated code.
public static  MapBuildergetMapBuilder(String className)
    
public static  StringgetSchema(String name)
     This method returns the current schema for a database connection
Parameters:
  name - The database name.
public static  voidinit(String configFile)
     Initialization of Torque with a properties file.
public static  voidinit(Configuration conf)
     Initialization of Torque with a properties file.
public static  booleanisInit()
     Determine whether Torque has already been initialized.
public static  voidregisterMapBuilder(String className)
    
public static  voidregisterMapBuilder(MapBuilder builder)
    
public static  voidsetConfiguration(Configuration conf)
     Sets the configuration for Torque and all dependencies.
public static synchronized  voidsetInstance(TorqueInstance instance)
     Sets the single org.apache.torque.TorqueInstance used by this class.
public static  voidsetSchema(String name, String schema)
    
public static  voidshutdown()
     Shuts down the service. This method halts the IDBroker's daemon thread in all of the DatabaseMap's.

Field Detail
CACHE_KEY
final public static String CACHE_KEY(Code)
property to determine whether caching is used.



DATABASE_DEFAULT
final public static String DATABASE_DEFAULT(Code)
Name of property that specifies the default map builder and map.



DATABASE_KEY
final public static String DATABASE_KEY(Code)
The prefix for configuring the database adapters and the default database.



DEFAULT_KEY
final public static String DEFAULT_KEY(Code)
The key used to configure the name of the default database.



MANAGER_PREFIX
final public static String MANAGER_PREFIX(Code)
A prefix for Manager properties in the configuration.



MANAGER_SUFFIX
final public static String MANAGER_SUFFIX(Code)
A Service property determining its implementing class name .



TORQUE_KEY
final public static String TORQUE_KEY(Code)
The prefix for all configuration keys used by Torque.




Constructor Detail
Torque
public Torque()(Code)
C'tor for usage with the Stratum Lifecycle. TODO: Should be made private or protected once Stratum is removed.




Method Detail
closeConnection
public static void closeConnection(Connection con)(Code)
Closes a connection.
Parameters:
  con - A Connection to close.



getConfiguration
public static Configuration getConfiguration()(Code)
Get the configuration for this component. the Configuration



getConnection
public static Connection getConnection() throws TorqueException(Code)
This method returns a Connection from the default pool. The requested connection.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



getConnection
public static Connection getConnection(String name) throws TorqueException(Code)
This method returns a Connecton using the given database name.
Parameters:
  name - The database name. a database connection
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



getConnection
public static Connection getConnection(String name, String username, String password) throws TorqueException(Code)
This method returns a Connecton 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. A Connection.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



getDB
public static DB getDB(String name) throws TorqueException(Code)
Returns database adapter for a specific connection pool.
Parameters:
  name - A pool name. The corresponding database adapter.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



getDatabase
public static Database getDatabase(String name) throws TorqueException(Code)
Returns the database for the given key.
Parameters:
  name - The database name. the Database for the given name, or null if no database existsfor the given name.
throws:
  TorqueException - if Torque is not yet initialized.



getDatabaseMap
public static DatabaseMap getDatabaseMap() throws TorqueException(Code)
Returns the default database map information. A DatabaseMap.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



getDatabaseMap
public static DatabaseMap getDatabaseMap(String name) throws TorqueException(Code)
Returns the database map information. Name relates to the name of the connection pool to associate with the map.
Parameters:
  name - The name of the database corresponding to theDatabaseMap to retrieve. The named DatabaseMap.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



getDatabases
public static Map getDatabases() throws TorqueException(Code)
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.
Note that in the very special case where a new database which is not configured in Torque's configuration gets known to Torque at a later time, the returned map may change, and there is no way to protect you against this. However, Databases should be initialized in the init() method, so this will not happen if Torque is used properly. a Map containing all Databases known to Torque, never null.
throws:
  TorqueException - if Torque is not yet initialized.



getDefaultDB
public static String getDefaultDB()(Code)
Returns the name of the default database. name of the default DB, or null if Torque is not initialized yet



getInstance
public static TorqueInstance getInstance()(Code)
Retrieves the single org.apache.torque.TorqueInstance used by this class. Our singleton.



getManager
public static AbstractBaseManager getManager(String name)(Code)
This method returns a Manager for the given name.
Parameters:
  name - name of the manager a Manager



getManager
public static AbstractBaseManager getManager(String name, String defaultClassName)(Code)
This methods returns either the Manager from the configuration file, or the default one provided by the generated code.
Parameters:
  name - name of the manager
Parameters:
  defaultClassName - the class to use if name has not been configured a Manager



getMapBuilder
public static MapBuilder getMapBuilder(String className) throws TorqueException(Code)
Get a MapBuilder
Parameters:
  className - of the MapBuilder A MapBuilder, not null
throws:
  TorqueException - if the Map Builder cannot be instantiated



getSchema
public static String getSchema(String name) throws TorqueException(Code)
This method returns the current schema for a database connection
Parameters:
  name - The database name. The current schema name. Null means, no schema has been set.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



init
public static void init(String configFile) throws TorqueException(Code)
Initialization of Torque with a properties file.
Parameters:
  configFile - The absolute path to the configuration file.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



init
public static void init(Configuration conf) throws TorqueException(Code)
Initialization of Torque with a properties file.
Parameters:
  conf - The Torque configuration.
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



isInit
public static boolean isInit()(Code)
Determine whether Torque has already been initialized. true if Torque is already initialized



registerMapBuilder
public static void registerMapBuilder(String className)(Code)
Register a MapBuilder
Parameters:
  className - the MapBuilder



registerMapBuilder
public static void registerMapBuilder(MapBuilder builder)(Code)
Register a MapBuilder
Parameters:
  builder - the instance of the MapBuilder



setConfiguration
public static void setConfiguration(Configuration conf)(Code)
Sets the configuration for Torque and all dependencies.
Parameters:
  conf - the Configuration



setInstance
public static synchronized void setInstance(TorqueInstance instance)(Code)
Sets the single org.apache.torque.TorqueInstance used by this class. This is used by the Avalon component to make sure that only one instance of Torque exists
Parameters:
  instance - Our singleton.



setSchema
public static void setSchema(String name, String schema) throws TorqueException(Code)
Sets the current schema for a database connection
Parameters:
  name - The database name.
Parameters:
  schema - The current schema name
throws:
  TorqueException - Any exceptions caught during processing will berethrown wrapped into a TorqueException.



shutdown
public static void shutdown() throws TorqueException(Code)
Shuts down the service. This method halts the IDBroker's daemon thread in all of the DatabaseMap's. It also closes all SharedPoolDataSourceFactories and PerUserPoolDataSourceFactories initialized by Torque.
exception:
  TorqueException - if a DataSourceFactory could not be closedcleanly. Only the first exception is rethrown, any followingexceptions are logged but ignored.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.