Java Doc for TxConnectionManager.java in  » EJB-Server-JBoss-4.2.1 » connector » org » jboss » resource » connectionmanager » 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 » EJB Server JBoss 4.2.1 » connector » org.jboss.resource.connectionmanager 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.jboss.resource.connectionmanager.BaseConnectionManager2
   org.jboss.resource.connectionmanager.TxConnectionManager

TxConnectionManager
public class TxConnectionManager extends BaseConnectionManager2 implements TxConnectionManagerMBean(Code)
The TxConnectionManager is a JBoss ConnectionManager implementation for jca adapters implementing LocalTransaction and XAResource support. It implements a ConnectionEventListener that implements XAResource to manage transactions through the Transaction Manager. To assure that all work in a local transaction occurs over the same ManagedConnection, it includes a xid to ManagedConnection map. When a Connection is requested or a transaction started with a connection handle in use, it checks to see if a ManagedConnection already exists enrolled in the global transaction and uses it if found. Otherwise a free ManagedConnection has its LocalTransaction started and is used. From the BaseConnectionManager2, it includes functionality to obtain managed connections from a ManagedConnectionPool mbean, find the Subject from a SubjectSecurityDomain, and interact with the CachedConnectionManager for connections held over transaction and method boundaries. Important mbean references are to a ManagedConnectionPool supplier (typically a JBossManagedConnectionPool), and a RARDeployment representing the ManagedConnectionFactory. This connection manager has to perform the following operations: 1. When an application component requests a new ConnectionHandle, it must find a ManagedConnection, and make sure a ConnectionEventListener is registered. It must inform the CachedConnectionManager that a connection handle has been given out. It needs to count the number of handles for each ManagedConnection. If there is a current transaction, it must enlist the ManagedConnection's LocalTransaction in the transaction using the ConnectionEventListeners XAResource XAResource implementation. Entry point: ConnectionManager.allocateConnection. written. 2. When a ConnectionClosed event is received from the ConnectionEventListener, it must reduce the handle count. If the handle count is zero, the XAResource should be delisted from the Transaction, if any. The CachedConnectionManager must be notified that the connection is closed. Entry point: ConnectionEventListener.ConnectionClosed. written 3. When a transaction begun notification is received from the UserTransaction (via the CachedConnectionManager, all managedConnections associated with the current object must be enlisted in the transaction. Entry point: (from CachedConnectionManager) ConnectionCacheListener.transactionStarted(Transaction, Collection). The collection is of ConnectionRecord objects. written. 5. When an "entering object" notification is received from the CachedConnectionInterceptor, all the connections for the current object must be associated with a ManagedConnection. if there is a Transaction, the XAResource must be enlisted with it. Entry point: ConnectionCacheListener.reconnect(Collection conns) The Collection is of ConnectionRecord objects. written. 6. When a "leaving object" notification is received from the CachedConnectionInterceptor, all the managedConnections for the current object must have their XAResources delisted from the current Transaction, if any, and cleanup called on each ManagedConnection. Entry point: ConnectionCacheListener.disconnect(Collection conns). written.
author:
   David Jencks
author:
   Adrian Brock
version:
   $Revision: 59870 $

Inner Class :protected class TxConnectionEventListener extends BaseConnectionManager2.BaseConnectionEventListener


Constructor Summary
public  TxConnectionManager()
     Default managed TxConnectionManager constructor for mbean instances.
public  TxConnectionManager(CachedConnectionManager ccm, ManagedConnectionPool poolingStrategy, TransactionManager tm)
     Creates a new TxConnectionManager instance.

Method Summary
public  ConnectionListenercreateConnectionListener(ManagedConnection mc, Object context)
    
public  BooleangetIsSameRMOverrideValue()
    
public  ConnectionListenergetManagedConnection(Subject subject, ConnectionRequestInfo cri)
    
public  longgetTimeLeftBeforeTransactionTimeout(boolean errorRollback)
    
public  StringgetTransactionManager()
    
public  TransactionManagergetTransactionManagerInstance()
    
public  ObjectNamegetTransactionManagerService()
    
public  intgetXAResourceTransactionTimeout()
    
public  booleanisLocalTransactions()
    
public  booleanisTrackConnectionByTx()
    
public  booleanisTransactional()
    
protected  voidmanagedConnectionDisconnected(ConnectionListener cl)
    
protected  voidmanagedConnectionReconnected(ConnectionListener cl)
    
protected static  voidrethrowAsSystemException(String context, Transaction tx, Throwable t)
    
public  voidsetIsSameRMOverrideValue(Boolean isSameRMOverride)
    
public  voidsetLocalTransactions(boolean localTransactions)
    
public  voidsetTrackConnectionByTx(boolean trackConnectionByTx)
    
public  voidsetTransactionManager(String tmName)
    
public  voidsetTransactionManagerInstance(TransactionManager tm)
    
public  voidsetTransactionManagerService(ObjectName transactionManagerService)
    
public  voidsetXAResourceTransactionTimeout(int timeout)
    
protected  voidstartService()
    
protected  voidstopService()
    
public  voidtransactionStarted(Collection crs)
    


Constructor Detail
TxConnectionManager
public TxConnectionManager()(Code)
Default managed TxConnectionManager constructor for mbean instances.



TxConnectionManager
public TxConnectionManager(CachedConnectionManager ccm, ManagedConnectionPool poolingStrategy, TransactionManager tm)(Code)
Creates a new TxConnectionManager instance. for TESTING ONLY!!! not a managed constructor!!
Parameters:
  ccm - a CachedConnectionManager value
Parameters:
  poolingStrategy - a ManagedConnectionPool value
Parameters:
  tm - a TransactionManager value




Method Detail
createConnectionListener
public ConnectionListener createConnectionListener(ManagedConnection mc, Object context) throws ResourceException(Code)



getIsSameRMOverrideValue
public Boolean getIsSameRMOverrideValue()(Code)



getManagedConnection
public ConnectionListener getManagedConnection(Subject subject, ConnectionRequestInfo cri) throws ResourceException(Code)



getTimeLeftBeforeTransactionTimeout
public long getTimeLeftBeforeTransactionTimeout(boolean errorRollback) throws RollbackException(Code)



getTransactionManager
public String getTransactionManager()(Code)



getTransactionManagerInstance
public TransactionManager getTransactionManagerInstance()(Code)



getTransactionManagerService
public ObjectName getTransactionManagerService()(Code)



getXAResourceTransactionTimeout
public int getXAResourceTransactionTimeout()(Code)



isLocalTransactions
public boolean isLocalTransactions()(Code)



isTrackConnectionByTx
public boolean isTrackConnectionByTx()(Code)



isTransactional
public boolean isTransactional()(Code)



managedConnectionDisconnected
protected void managedConnectionDisconnected(ConnectionListener cl) throws ResourceException(Code)



managedConnectionReconnected
protected void managedConnectionReconnected(ConnectionListener cl) throws ResourceException(Code)



rethrowAsSystemException
protected static void rethrowAsSystemException(String context, Transaction tx, Throwable t) throws SystemException(Code)



setIsSameRMOverrideValue
public void setIsSameRMOverrideValue(Boolean isSameRMOverride)(Code)



setLocalTransactions
public void setLocalTransactions(boolean localTransactions)(Code)



setTrackConnectionByTx
public void setTrackConnectionByTx(boolean trackConnectionByTx)(Code)



setTransactionManager
public void setTransactionManager(String tmName)(Code)



setTransactionManagerInstance
public void setTransactionManagerInstance(TransactionManager tm)(Code)



setTransactionManagerService
public void setTransactionManagerService(ObjectName transactionManagerService)(Code)



setXAResourceTransactionTimeout
public void setXAResourceTransactionTimeout(int timeout)(Code)



startService
protected void startService() throws Exception(Code)



stopService
protected void stopService() throws Exception(Code)



transactionStarted
public void transactionStarted(Collection crs) throws SystemException(Code)



Fields inherited from org.jboss.resource.connectionmanager.BaseConnectionManager2
final public static String STOPPING_NOTIFICATION(Code)(Java Doc)
protected CachedConnectionManager ccm(Code)(Java Doc)
protected ObjectName ccmName(Code)(Java Doc)
protected ObjectName jaasSecurityManagerService(Code)(Java Doc)
protected String jndiName(Code)(Java Doc)
protected ObjectName managedConnectionPoolName(Code)(Java Doc)
protected ManagedConnectionPool poolingStrategy(Code)(Java Doc)
protected SubjectSecurityManager securityDomain(Code)(Java Doc)
protected String securityDomainJndiName(Code)(Java Doc)
protected boolean trace(Code)(Java Doc)

Methods inherited from org.jboss.resource.connectionmanager.BaseConnectionManager2
public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cri) throws ResourceException(Code)(Java Doc)
public void disconnect(Collection crs, Set unsharableResources) throws ResourceException(Code)(Java Doc)
protected void disconnectManagedConnection(ConnectionListener cl)(Code)(Java Doc)
public ObjectName getCachedConnectionManager()(Code)(Java Doc)
final protected CachedConnectionManager getCcm()(Code)(Java Doc)
public int getConnectionCount()(Code)(Java Doc)
public BaseConnectionManager2 getInstance()(Code)(Java Doc)
public ObjectName getJaasSecurityManagerService()(Code)(Java Doc)
public String getJndiName()(Code)(Java Doc)
public ConnectionListener getManagedConnection(Subject subject, ConnectionRequestInfo cri) throws ResourceException(Code)(Java Doc)
protected ConnectionListener getManagedConnection(Transaction transaction, Subject subject, ConnectionRequestInfo cri) throws ResourceException(Code)(Java Doc)
public ManagedConnectionFactory getManagedConnectionFactory()(Code)(Java Doc)
public ObjectName getManagedConnectionPool()(Code)(Java Doc)
public MBeanNotificationInfo[] getNotificationInfo()(Code)(Java Doc)
public ManagedConnectionPool getPoolingStrategy()(Code)(Java Doc)
public String getSecurityDomainJndiName()(Code)(Java Doc)
public long getTimeLeftBeforeTransactionTimeout(boolean errorRollback) throws RollbackException(Code)(Java Doc)
public TransactionManager getTransactionManagerInstance()(Code)(Java Doc)
public int getTransactionTimeout() throws SystemException(Code)(Java Doc)
public boolean isTransactional()(Code)(Java Doc)
protected void managedConnectionDisconnected(ConnectionListener cl) throws ResourceException(Code)(Java Doc)
protected void managedConnectionReconnected(ConnectionListener cl) throws ResourceException(Code)(Java Doc)
public void reconnect(Collection conns, Set unsharableResources) throws ResourceException(Code)(Java Doc)
protected void reconnectManagedConnection(ConnectionListener cl) throws ResourceException(Code)(Java Doc)
protected static void rethrowAsResourceException(String message, Throwable t) throws ResourceException(Code)(Java Doc)
public void returnManagedConnection(ConnectionListener cl, boolean kill)(Code)(Java Doc)
public void setCachedConnectionManager(ObjectName ccmName)(Code)(Java Doc)
public void setJaasSecurityManagerService(ObjectName jaasSecurityManagerService)(Code)(Java Doc)
public void setJndiName(String jndiName)(Code)(Java Doc)
public void setManagedConnectionPool(ObjectName newManagedConnectionPool)(Code)(Java Doc)
public void setSecurityDomainJndiName(String securityDomainJndiName)(Code)(Java Doc)
protected void startService() throws Exception(Code)(Java Doc)
protected void stopService() throws Exception(Code)(Java Doc)
public void transactionStarted(Collection conns) throws SystemException(Code)(Java Doc)
protected void unregisterAssociation(ConnectionListener cl, Object c) throws ResourceException(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.