Java Doc for ConnectionManagerImpl.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » resource » 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 » J2EE » JOnAS 4.8.6 » org.objectweb.jonas.resource 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.objectweb.jonas.resource.ConnectionManagerImpl

ConnectionManagerImpl
public class ConnectionManagerImpl implements ConnectionEventListener,ConnectionManager,PoolMatchFactory,SQLManager,TransactionResourceManager(Code)
Description of the ConnectionManagerImpl
author:
   chassand
author:
   created 15 novembre 2001


Field Summary
final public static  intJDBC_CHECK_CONNECTION
    
final public static  intJDBC_KEEP_ALIVE
    
final public static  intJDBC_NO_TEST
    
final public static  intJDBC_SEND_STATEMENT
    
final public static  StringJNDINAME
    
final public static  StringLOCAL_TRANS_SUPPORT
    
final public static  StringLOGGER
    
final public static  StringLOGGER_FACTORY
    
final static  intMAX_PSTMT_SIZE
     The default max pool size of pstmts per ManagedConnection.
final public static  StringNO_TRANS_SUPPORT
    
final public static  StringPOOL_LOGGER
    
final public static  StringPRINT_WRITER
    
final public static  intPSWRAP_1
    
final public static  intPSWRAP_2
    
final public static  intPSWRAP_3
    
final public static  intPSWRAP_4
    
final public static  intPSWRAP_5
    
final public static  StringRESOURCE_ADAPTER
    
final public static  StringRESOURCE_BUNDLE_NAME
    
final public static  StringRESOURCE_MANAGER_EVENT_LISTENER
    
final public static  StringTRANSACTION_MANAGER
    
final public static  StringXA_TRANS_SUPPORT
    
protected static  LoggerconTrace
    
protected  Stringjndiname
    
protected  Hashtablemc2mci
    
protected  Vectormcs
    
protected  PoolpoolMCs
     The pool of ManagedConnections associated to a ManagedConnectionFactory There's one instance of pool by instance for one instance of this class (ConnectionManagerImpl). The synchronization of the methods of this are ensured through synchronized blocks on the poolMCs instance.
protected static  LoggerpoolTrace
    
protected  ResourceManagerEventListenerrmel
    
protected  Vectorsynchros
    
protected  TransactionManagertm
    
protected static  Loggertrace
    
protected  HashtableusedMCs
    

Constructor Summary
public  ConnectionManagerImpl(String transSupport)
    

Method Summary
public  ObjectallocateConnection(ManagedConnectionFactory pMcf, ConnectionRequestInfo cxRequestInfo)
     The method allocateConnection gets called by the resource adapter's connection factory instance.
public  voidcleanResourceAdapter()
    
public  voidconnectionClosed(ConnectionEvent event)
     IMPLEMENTATION OF INTERFACE ConnectionEventListener * A ManagedConnection instance calls the connectionClosed method to notify its registered set of listeners when an application component closes a connection handle.
public  voidconnectionErrorOccurred(ConnectionEvent event)
     The connectionErrorOccurred method indicates that the associated ManagedConnection instance is now invalid and unusable.
public  ObjectcreateResource(Object hints)
     Call the ManagedConnectionFactory in order to create a new instance.
public  voiddestroyPStmts(MCInfo mcinfo)
    
public  intgetCheckLevel()
    
public  intgetCurrentInTx()
    
public  intgetMaxPstmtPoolSize()
    
public  PreparedStatementgetPStatement(MCInfo mcinfo, Object conn, String user, String sql)
    
public  PreparedStatementgetPStatement(MCInfo mcinfo, Object conn, String user, String sql, int resultSetType, int resultSetConcurrency)
    
public  PreparedStatementgetPStatement(MCInfo mcinfo, Object conn, String user, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
    
public  PreparedStatementgetPStatement(MCInfo mcinfo, Object conn, String user, String sql, int autoGeneratedKeys)
    
public  PreparedStatementgetPStatement(MCInfo mcinfo, Object conn, String user, String sql, int[] columnIndexes)
    
public  PreparedStatementgetPStatement(MCInfo mcinfo, Object conn, String user, String sql, String[] columnNames)
    
public  PoolgetPool()
    
protected  StringgetState(String prefix)
    
public  StringgetTestStatement()
    
public  StringgetXAName()
    
public  voidinit(Context ctx)
     This method permits to initialize the ConnectionManager with the following parameter: RESOURCE_BUNDLE_NAME: The name of the resource bundle in order to internationalize the logging LOGGER: The logger instance where events are logged LOGGER_FACTORY: A logger factory to obtain a logger PRINT_WRITER: The printwriter where event are logged TRANSACTION_MANAGER: The Transaction manager linked to this resource manager RESOURCE_MANAGER_EVENT_LISTENER: The resource manage event listener which subscribed to later connection enlistement.
public  voidlocalTransactionCommitted(ConnectionEvent event)
     Notifies that a Resource Manager Local Transaction was committed on the ManagedConnection instance.
public  voidlocalTransactionRolledback(ConnectionEvent event)
     Notifies that a Resource Manager Local Transaction was rolled back on the ManagedConnection instance.
public  voidlocalTransactionStarted(ConnectionEvent event)
     Notifies that a Resource Manager Local Transaction was started on the ManagedConnection instance.
public  booleanmatchResource(Object res, Object hints)
     All method of the pool match to the right type of ManagedConnection because there is one pool by ManagedConnectionFactory.
public  ObjectmatchResource(Set res, Object hints)
     All method of the pool match to the right type of ManagedConnection because there is one pool by ManagedConnectionFactory.
public  voidregisterXAResource(Properties tmProp)
    
public  voidreleaseResource(Object rMc)
    
public  voidreturnXAResource(String rmName, XAResource rmXares)
    
public  voidsetCheckLevel(int level)
    
public  voidsetLogger(Logger l)
    
public  voidsetLoggerFactory(LoggerFactory lf)
    
public  voidsetMaxPstmtPoolSize(int maxPstmtPoolSize)
    
public  voidsetPrintWriter(PrintWriter pw)
    
public  voidsetResourceAdapter(ManagedConnectionFactory tmcf)
    
public  voidsetResourceAdapter(ManagedConnectionFactory tmcf, ConnectionManagerPoolParams cmpp)
    
public  voidsetResourceManagerEventListener(ResourceManagerEventListener rmel)
    
public  voidsetTestStatement(String stmt)
    
public  voidsetTransactionManager(TransactionManager tm)
    
public  voidsetXAName(String xanm)
    
public  StringtoString()
    
public  voidvalidateResource(Set res)
    

Field Detail
JDBC_CHECK_CONNECTION
final public static int JDBC_CHECK_CONNECTION(Code)



JDBC_KEEP_ALIVE
final public static int JDBC_KEEP_ALIVE(Code)



JDBC_NO_TEST
final public static int JDBC_NO_TEST(Code)
Constants for use with JDBC connection level



JDBC_SEND_STATEMENT
final public static int JDBC_SEND_STATEMENT(Code)



JNDINAME
final public static String JNDINAME(Code)
This constant is used in the by the init method



LOCAL_TRANS_SUPPORT
final public static String LOCAL_TRANS_SUPPORT(Code)
Rar supports local transactions



LOGGER
final public static String LOGGER(Code)
This constant is used in the by the init method



LOGGER_FACTORY
final public static String LOGGER_FACTORY(Code)
This constant is used in the by the init method



MAX_PSTMT_SIZE
final static int MAX_PSTMT_SIZE(Code)
The default max pool size of pstmts per ManagedConnection.



NO_TRANS_SUPPORT
final public static String NO_TRANS_SUPPORT(Code)
Rar doesn't support transactions



POOL_LOGGER
final public static String POOL_LOGGER(Code)
This constant is used in the by the init method



PRINT_WRITER
final public static String PRINT_WRITER(Code)
This constant is used in the by the init method



PSWRAP_1
final public static int PSWRAP_1(Code)
Constants to determine which PreparedStatement types to call



PSWRAP_2
final public static int PSWRAP_2(Code)



PSWRAP_3
final public static int PSWRAP_3(Code)



PSWRAP_4
final public static int PSWRAP_4(Code)



PSWRAP_5
final public static int PSWRAP_5(Code)



RESOURCE_ADAPTER
final public static String RESOURCE_ADAPTER(Code)
This constant is used in the by the init method



RESOURCE_BUNDLE_NAME
final public static String RESOURCE_BUNDLE_NAME(Code)
This constant is used in the by the init method



RESOURCE_MANAGER_EVENT_LISTENER
final public static String RESOURCE_MANAGER_EVENT_LISTENER(Code)
This constant is used in the by the init method



TRANSACTION_MANAGER
final public static String TRANSACTION_MANAGER(Code)
This constant is used in the by the init method



XA_TRANS_SUPPORT
final public static String XA_TRANS_SUPPORT(Code)
Rar supports XA transactions



conTrace
protected static Logger conTrace(Code)
Connection Management logger



jndiname
protected String jndiname(Code)
The jndiname of the associated factory



mc2mci
protected Hashtable mc2mci(Code)
This hashtable allows to find the list of connection handle associated to a ManagedConnection



mcs
protected Vector mcs(Code)
The list of managedConnection used without transaction



poolMCs
protected Pool poolMCs(Code)
The pool of ManagedConnections associated to a ManagedConnectionFactory There's one instance of pool by instance for one instance of this class (ConnectionManagerImpl). The synchronization of the methods of this are ensured through synchronized blocks on the poolMCs instance. Thus, the lock are shared between the two objects and that avoids deadlock issues when the poolMCs.getRessource() is waiting for a connection releasing (max nb of instances is reached in the pool).



poolTrace
protected static Logger poolTrace(Code)
Pool infomation logger



rmel
protected ResourceManagerEventListener rmel(Code)
Used by the server to register connections when no transactionnal context exists



synchros
protected Vector synchros(Code)
The list of Synchronisation instance managed in this ConnectionManager



tm
protected TransactionManager tm(Code)
The transaction manager in server



trace
protected static Logger trace(Code)
Main logger



usedMCs
protected Hashtable usedMCs(Code)
The list of used ManagedConnections key = transaction reference value = MCInfo




Constructor Detail
ConnectionManagerImpl
public ConnectionManagerImpl(String transSupport)(Code)
ConnectionManagerImpl constructor
Parameters:
  transSupport - String defining level of support needed




Method Detail
allocateConnection
public Object allocateConnection(ManagedConnectionFactory pMcf, ConnectionRequestInfo cxRequestInfo) throws ResourceException(Code)
The method allocateConnection gets called by the resource adapter's connection factory instance.
See Also:   javax.resource.cci.ConnectionManager



cleanResourceAdapter
public void cleanResourceAdapter() throws ResourceException(Code)
Description of the Method
exception:
  ResourceException - Description of Exception



connectionClosed
public void connectionClosed(ConnectionEvent event)(Code)
IMPLEMENTATION OF INTERFACE ConnectionEventListener * A ManagedConnection instance calls the connectionClosed method to notify its registered set of listeners when an application component closes a connection handle. The application server uses this connection close event to make a decision on whether or not to put the ManagedConnection instance back into the connection pool.
See Also:   javax.resource.spi.ConnectionEventListener



connectionErrorOccurred
public void connectionErrorOccurred(ConnectionEvent event)(Code)
The connectionErrorOccurred method indicates that the associated ManagedConnection instance is now invalid and unusable. The application server handles the connection error event notification by initiating application server-specific cleanup (for example, removing ManagedConnection instance from the connection pool) and then calling ManagedConnection.destroy method to destroy the physical connection..
See Also:   javax.resource.spi.ConnectionEventListener



createResource
public Object createResource(Object hints) throws Exception(Code)
Call the ManagedConnectionFactory in order to create a new instance. of ManagedConnection. The Object is a ManagedConnection instance. The hints is a local structure: ResourceSpec
See Also:   org.objectweb.util.pool.api.PoolMatchFactory



destroyPStmts
public void destroyPStmts(MCInfo mcinfo) throws Exception(Code)
Destroying of the PreparedStatement objects of the Pool
Parameters:
  mcinfo - ManagedConnection information
throws:
  Exception - Exception



getCheckLevel
public int getCheckLevel()(Code)



getCurrentInTx
public int getCurrentInTx()(Code)



getMaxPstmtPoolSize
public int getMaxPstmtPoolSize()(Code)
Returns the maxPstmtPoolSize.



getPStatement
public PreparedStatement getPStatement(MCInfo mcinfo, Object conn, String user, String sql) throws SQLException(Code)
IMPLEMENTATION OF INTERFACE SQLManager



getPStatement
public PreparedStatement getPStatement(MCInfo mcinfo, Object conn, String user, String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code)



getPStatement
public PreparedStatement getPStatement(MCInfo mcinfo, Object conn, String user, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException(Code)



getPStatement
public PreparedStatement getPStatement(MCInfo mcinfo, Object conn, String user, String sql, int autoGeneratedKeys) throws SQLException(Code)



getPStatement
public PreparedStatement getPStatement(MCInfo mcinfo, Object conn, String user, String sql, int[] columnIndexes) throws SQLException(Code)



getPStatement
public PreparedStatement getPStatement(MCInfo mcinfo, Object conn, String user, String sql, String[] columnNames) throws SQLException(Code)



getPool
public Pool getPool()(Code)



getState
protected String getState(String prefix)(Code)
Gets the State attribute of the ConnectionManagerImpl object
Parameters:
  prefix - Description of Parameter The State value



getTestStatement
public String getTestStatement()(Code)



getXAName
public String getXAName()(Code)
Get the XAName to use String of XA Name



init
public void init(Context ctx) throws Exception(Code)
This method permits to initialize the ConnectionManager with the following parameter: RESOURCE_BUNDLE_NAME: The name of the resource bundle in order to internationalize the logging LOGGER: The logger instance where events are logged LOGGER_FACTORY: A logger factory to obtain a logger PRINT_WRITER: The printwriter where event are logged TRANSACTION_MANAGER: The Transaction manager linked to this resource manager RESOURCE_MANAGER_EVENT_LISTENER: The resource manage event listener which subscribed to later connection enlistement. RESOURCE_ADAPTER: The managedConnectionFactory instance of the resource which must be maneged by this connectionManager JNDINAME: JndiName from the factory associated with this ConnectionManager
Parameters:
  ctx - Description of Parameter
exception:
  Exception - Description of Exception



localTransactionCommitted
public void localTransactionCommitted(ConnectionEvent event)(Code)
Notifies that a Resource Manager Local Transaction was committed on the ManagedConnection instance.
See Also:   javax.resource.spi.ConnectionEventListener



localTransactionRolledback
public void localTransactionRolledback(ConnectionEvent event)(Code)
Notifies that a Resource Manager Local Transaction was rolled back on the ManagedConnection instance.
See Also:   javax.resource.spi.ConnectionEventListener



localTransactionStarted
public void localTransactionStarted(ConnectionEvent event)(Code)
Notifies that a Resource Manager Local Transaction was started on the ManagedConnection instance.
See Also:   javax.resource.spi.ConnectionEventListener



matchResource
public boolean matchResource(Object res, Object hints)(Code)
All method of the pool match to the right type of ManagedConnection because there is one pool by ManagedConnectionFactory.
See Also:   org.objectweb.util.pool.api.PoolMatchFactory



matchResource
public Object matchResource(Set res, Object hints) throws Exception(Code)
All method of the pool match to the right type of ManagedConnection because there is one pool by ManagedConnectionFactory.
See Also:   org.objectweb.util.pool.api.PoolMatchFactory



registerXAResource
public void registerXAResource(Properties tmProp)(Code)
Register an XAResource with JOTM for recovery



releaseResource
public void releaseResource(Object rMc) throws Exception(Code)
Release the ManagedConnection object resource
Parameters:
  rMc - Object to release
throws:
  Exception - if an Exception occurs



returnXAResource
public void returnXAResource(String rmName, XAResource rmXares)(Code)
Called from JOTM to free the XAResource and associated Managed Connection when recovery is complete
Parameters:
  rmName - The Resource Manager to be unregistered.
Parameters:
  rmXares - XAResource to be returned



setCheckLevel
public void setCheckLevel(int level)(Code)



setLogger
public void setLogger(Logger l)(Code)
Setters method to initialize the ConnectionManager The logger instance where events are logged
Parameters:
  l - The new Logger value



setLoggerFactory
public void setLoggerFactory(LoggerFactory lf)(Code)
Setters method to initialize the ConnectionManager A logger factory to obtain a logger
Parameters:
  lf - The new LoggerFactory value



setMaxPstmtPoolSize
public void setMaxPstmtPoolSize(int maxPstmtPoolSize)(Code)

Parameters:
  maxPstmtPoolSize - The maxPstmtPoolSize to set.



setPrintWriter
public void setPrintWriter(PrintWriter pw)(Code)
Setters method to initialize the ConnectionManager The printwriter where event are logged
Parameters:
  pw - The new PrintWriter value



setResourceAdapter
public void setResourceAdapter(ManagedConnectionFactory tmcf) throws Exception(Code)
Setters method to initialize the ConnectionManager The managedConnectionFactory instance of the resource which must be managed by this connectionManager
Parameters:
  tmcf - The new ResourceAdapter value
exception:
  Exception - Description of Exception



setResourceAdapter
public void setResourceAdapter(ManagedConnectionFactory tmcf, ConnectionManagerPoolParams cmpp) throws Exception(Code)
Setters method to initialize the ConnectionManager The managedConnectionFactory instance of the resource which must be maneged by this connectionManager
Parameters:
  tmcf - The ManagedConnectionFactory object
Parameters:
  cmpp - The pool parameters
exception:
  Exception - Description of Exception



setResourceManagerEventListener
public void setResourceManagerEventListener(ResourceManagerEventListener rmel)(Code)
Setters method to initialize the ConnectionManager The logger instance where events are logged
Parameters:
  rmel - The new ResourceManagerEventListener value



setTestStatement
public void setTestStatement(String stmt)(Code)



setTransactionManager
public void setTransactionManager(TransactionManager tm)(Code)
Setters method to initialize the ConnectionManager The Transaction manager linked to this resource managed
Parameters:
  tm - TransactionManager value



setXAName
public void setXAName(String xanm)(Code)
Set the XAName to use
Parameters:
  xanm - String of XA Name



toString
public String toString()(Code)
Description of the Method Description of the Returned Value



validateResource
public void validateResource(Set res) throws Exception(Code)
If supported, call the ManagedConnectionFactory to validate the ManagedConnections
See Also:   org.objectweb.util.pool.api.PoolMatchFactory



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.