Java Doc for Broker.java in  » Database-ORM » ORBroker » net » sourceforge » orbroker » 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 » ORBroker » net.sourceforge.orbroker 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sourceforge.orbroker.Broker

Broker
final public class Broker (Code)
The Broker between the JDBC data source and an application. The Broker holds the configuration and initiates Queries and Transactions.
author:
   Nils Kilden-Pedersen
version:
   2.0
See Also:   net.sourceforge.orbroker.Query
See Also:   net.sourceforge.orbroker.Transaction



Constructor Summary
public  Broker(DataSource dataSource)
     Create Broker without a configuration.
public  Broker(DataSource dataSource, String username, String password)
     Create Broker without a configuration.
public  Broker(InputStream configuration, DataSource dataSource)
     The Broker is configured by passing an InputStream containing an XML file and a data source.
public  Broker(InputStream configuration, DataSource dataSource, String username, String password)
     The Broker is configured by passing an InputStream containing an XML file and a data source with username and password.

Method Summary
public static  voidaddLoggingHandler(Handler handler)
     Add logging handler.
public static  voidaddLoggingHandler(Handler handler, boolean keepDefaultHandler)
     Add logging handler.
public  voidaddStatement(String id, String sql)
     Add statement to Broker.
public  voidaddStatement(String id, String sql, String resultObjectId)
     Add statement to Broker.
 ResultObjectDefinitionfindResultObjectDefinition(String resultObjectID)
    
 StatementfindStatement(String statementID)
    
static  MapgetCachedObjects(Connection con)
    
public  DataSourcegetDataSource()
     Get the data source used by Broker.
 ExceptionEvaluatorgetExceptionEvaluator()
    
 ConnectiongetFreshConnection(Integer isolationLevel)
     Get fresh connection from data source.
public  StringgetName()
     Get brokerName of Broker.
static  intgetResultSetType(boolean scrollableSupport)
    
 TextReplacementsgetTextReplacements()
    
static  StringgetTransactionIsolationLevel(int isolationLevel)
    
static  booleanisLoggable(Level level)
    
public static  voidlog(Level level, String message)
     Log a message.
public  ExecutableobtainExecutable(Connection connection)
     Obtain an Executable.
public  voidreleaseExecutable(Executable executable)
     Release Executable.
public  voidsetCatalog(String catalog)
     Set the catalog.
public  voidsetDataSource(DataSource dataSource)
     Set the data source.
public  voidsetDataSource(DataSource dataSource, String username, String password)
     Set data source and username/password.
public  voidsetExceptionEvaluator(ExceptionEvaluator evaluator)
     Set a new exception evaluator.
public static  voidsetLoggingLevel(Level level)
     Set the logging level.
public static  voidsetLoggingLevel(String level)
     Set the logging level.
public  voidsetTextReplacement(String key, String value)
     Set a text replacement value.
public  voidsetTextReplacements(Properties textReplacements)
     Set text replacement values.
public  QuerystartQuery()
     Start a read-only query.
public  QuerystartQuery(int isolationLevel)
     Start a read-only query with a given transaction isolation level.
public  TransactionstartTransaction()
     Start a new transaction.
public  TransactionstartTransaction(int isolationLevel)
     Start a new transaction with a given transaction isolation level.
 booleansupportsBatch()
    
 booleansupportsScrollable()
    
public  StringtoString()
    


Constructor Detail
Broker
public Broker(DataSource dataSource)(Code)
Create Broker without a configuration.
Parameters:
  dataSource - A data source
See Also:   Broker.addStatement(String,String)



Broker
public Broker(DataSource dataSource, String username, String password)(Code)
Create Broker without a configuration.
Parameters:
  dataSource - A data source
Parameters:
  username - Username to use that is different than on data source
Parameters:
  password - Password for username
See Also:   Broker.addStatement(String,String)



Broker
public Broker(InputStream configuration, DataSource dataSource) throws BrokerException(Code)
The Broker is configured by passing an InputStream containing an XML file and a data source.
Parameters:
  configuration - The XML configuration
Parameters:
  dataSource - A data source
throws:
  BrokerException -



Broker
public Broker(InputStream configuration, DataSource dataSource, String username, String password) throws BrokerException(Code)
The Broker is configured by passing an InputStream containing an XML file and a data source with username and password.
Parameters:
  configuration - The XML configuration
Parameters:
  dataSource - A data source
Parameters:
  username - Username to use that is different than on data source
Parameters:
  password - Password for username
throws:
  BrokerException -




Method Detail
addLoggingHandler
public static void addLoggingHandler(Handler handler)(Code)
Add logging handler. When adding a logging handler, the default console log handler is automatically removed. Previously added handlers remain.
Parameters:
  handler - Logging handler.
See Also:   Handler
See Also:   Broker.addLoggingHandler(Handler,boolean)



addLoggingHandler
public static void addLoggingHandler(Handler handler, boolean keepDefaultHandler)(Code)
Add logging handler. Previously added handlers remain.
Parameters:
  handler - Logging handler.
Parameters:
  keepDefaultHandler - true, if default console log handler should remain
See Also:   Handler
See Also:   Broker.addLoggingHandler(Handler)



addStatement
public void addStatement(String id, String sql) throws BrokerException, ConfigurationException(Code)
Add statement to Broker.
Parameters:
  id - The statement id.
Parameters:
  sql - The SQL statement
throws:
  BrokerException -
throws:
  ConfigurationException -



addStatement
public void addStatement(String id, String sql, String resultObjectId) throws BrokerException, ConfigurationException(Code)
Add statement to Broker.
Parameters:
  id - The statement id.
Parameters:
  sql - The SQL statement
Parameters:
  resultObjectId - The result-object id as defined in the XMLconfiguration file.
throws:
  BrokerException -
throws:
  ConfigurationException -



findResultObjectDefinition
ResultObjectDefinition findResultObjectDefinition(String resultObjectID) throws BrokerException(Code)



findStatement
Statement findStatement(String statementID) throws BrokerException(Code)



getCachedObjects
static Map getCachedObjects(Connection con)(Code)



getDataSource
public DataSource getDataSource()(Code)
Get the data source used by Broker. The datasource used.



getExceptionEvaluator
ExceptionEvaluator getExceptionEvaluator()(Code)



getFreshConnection
Connection getFreshConnection(Integer isolationLevel)(Code)
Get fresh connection from data source.
Parameters:
  isolationLevel - Fresh connection



getName
public String getName()(Code)
Get brokerName of Broker. Name of broker



getResultSetType
static int getResultSetType(boolean scrollableSupport)(Code)

Parameters:
  scrollableSupport - result set type



getTextReplacements
TextReplacements getTextReplacements()(Code)
Returns the text replacements.



getTransactionIsolationLevel
static String getTransactionIsolationLevel(int isolationLevel)(Code)



isLoggable
static boolean isLoggable(Level level)(Code)



log
public static void log(Level level, String message)(Code)
Log a message.
Parameters:
  level - Log level
Parameters:
  message - Log message



obtainExecutable
public Executable obtainExecutable(Connection connection)(Code)
Obtain an Executable. An Executable instance must be released again by calling Broker.releaseExecutable(Executable) , or unpredictable behavior can occur.
Parameters:
  connection - An externally managed connection. Executable
See Also:   Broker.releaseExecutable(Executable)
See Also:   Transaction.obtainExecutable



releaseExecutable
public void releaseExecutable(Executable executable)(Code)
Release Executable. This will drop the internal Connection and prevent other processes, which may hold a reference to the Executable, from executing statements on a Connection that may have been returned to a DataSource connection pool.

Releasing the Executable will not close the connection.


Parameters:
  executable - The Executable to release
throws:
  BrokerException - if the Executable was not obtained from this Broker
See Also:   Broker.obtainExecutable(Connection)



setCatalog
public void setCatalog(String catalog)(Code)
Set the catalog.
Parameters:
  catalog - The catalog name



setDataSource
public void setDataSource(DataSource dataSource)(Code)
Set the data source. Uses default username and password.
Parameters:
  dataSource - The data source



setDataSource
public void setDataSource(DataSource dataSource, String username, String password)(Code)
Set data source and username/password.
Parameters:
  dataSource - The data source
Parameters:
  username - Username to use that is different than on data source
Parameters:
  password - Password for username



setExceptionEvaluator
public void setExceptionEvaluator(ExceptionEvaluator evaluator)(Code)
Set a new exception evaluator.
Parameters:
  evaluator - The exception evaluator instance



setLoggingLevel
public static void setLoggingLevel(Level level)(Code)
Set the logging level. Log level definitions:
  • WARNING: Used for internally caught exceptions not considered severe.
  • INFO: Shows transaction boundaries and SQL statements executed.
  • CONFIG: Information about driver support and configuration setup
  • FINE: Shows dynamic SQL statement after parsing.

Parameters:
  level - Logging level



setLoggingLevel
public static void setLoggingLevel(String level)(Code)
Set the logging level. See log level definitions on Broker.setLoggingLevel(Level) .
Parameters:
  level - Logging level
See Also:   Level



setTextReplacement
public void setTextReplacement(String key, String value)(Code)
Set a text replacement value. This will replace a {{key}} string with the specific parameter value.
Parameters:
  key - Text replacement key
Parameters:
  value - Text replacement value
See Also:   Broker.setTextReplacements(Properties)



setTextReplacements
public void setTextReplacements(Properties textReplacements)(Code)
Set text replacement values. This will replace all {{key}} type properties in an sql-statement with the values.
Parameters:
  textReplacements - The replacement values to set.
See Also:   Broker.setTextReplacement(String,String)



startQuery
public Query startQuery()(Code)
Start a read-only query. Query



startQuery
public Query startQuery(int isolationLevel)(Code)
Start a read-only query with a given transaction isolation level. JDBC transaction isolation levels:
Parameters:
  isolationLevel - The isolation level Query



startTransaction
public Transaction startTransaction() throws BrokerException(Code)
Start a new transaction. Transaction
throws:
  BrokerException -



startTransaction
public Transaction startTransaction(int isolationLevel) throws BrokerException(Code)
Start a new transaction with a given transaction isolation level. JDBC transaction isolation levels:
Parameters:
  isolationLevel - The isolation level Transaction
throws:
  BrokerException -



supportsBatch
boolean supportsBatch()(Code)



supportsScrollable
boolean supportsScrollable()(Code)
Returns scrollable support.



toString
public String toString()(Code)

See Also:   java.lang.Object.toString



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.