Java Doc for PoolItem.java in  » EJB-Server-resin-3.1.5 » resin » com » caucho » jca » 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 resin 3.1.5 » resin » com.caucho.jca 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.caucho.jca.PoolItem

PoolItem
class PoolItem implements ConnectionEventListener,XAResource(Code)
Implementation of the connection manager manager.


Field Summary
 UserPoolItem_shareHead
    
final  Object_shareLock
    

Constructor Summary
public  PoolItem(ConnectionPool cm, ManagedConnectionFactory mcf, ManagedConnection conn)
    

Method Summary
 voidabortConnection()
     Closes the connection.
 ObjectallocateConnection()
     Returns the user connection.
 UserPoolItemallocateXA(ManagedConnectionFactory mcf, Subject subject, ConnectionRequestInfo info)
     Use the item only if it's already been used for the current transaction and is available.
public  voidcommit(Xid xid, boolean onePhase)
    
public  voidconnectionClosed(ConnectionEvent event)
     Notifies that an application has closed the connection.
public  voidconnectionErrorOccurred(ConnectionEvent event)
     Notifies that a connection error has occurred.
 voiddestroy()
     Closes the connection.
 voidenableLocalTransactionOptimization(boolean enableOptimization)
     Returns the XA resource.
public  voidend(Xid xid, int flags)
     Ends work with the resource.
public  voidforget(Xid xid)
    
public  IllegalStateExceptiongetAllocationStackTrace()
     Returns the allocation stack trace.
public  longgetEventTime()
     Returns the time of the last event.
 ManagedConnectiongetManagedConnection()
     Returns the managed connection.
public  longgetStartTime()
     Returns the time the connection was first used.
public  intgetTransactionTimeout()
     Returns the timeout of the underlying resource.
 XAResourcegetXAResource()
     Returns the XA resource.
 XidgetXid()
     Returns the Xid resource.
public  booleanisActive()
     Returns true if the connection is active.
public  booleanisConnectionError()
     Returns true if there was a connection error.
public  booleanisDead()
    
 booleanisJoin(PoolItem item)
     Returns true if the tested pool item is the Xid leader.
public  booleanisSameRM(XAResource resource)
    
synchronized  booleanisValid()
     Checks if the pool item is still valid.
 booleanisValid(Subject subject, ConnectionRequestInfo requestInfo, UserPoolItem userPoolItem)
     Returns true for a valid connection.
public  voidlocalTransactionCommitted(ConnectionEvent event)
     Notifies that a local transaction has committed.
public  voidlocalTransactionRolledback(ConnectionEvent event)
     Notifies that a local transaction has rolled back.
public  voidlocalTransactionStarted(ConnectionEvent event)
     Notifies that a local transaction has started.
public  intprepare(Xid xid)
     Vote using phase-1 of the 2-phase commit.
public  Xid[]recover(int flag)
    
public  voidrollback(Xid xid)
    
public  voidsetConnectionError()
     Notifies that a connection error has occurred.
public  voidsetInfo(ConnectionRequestInfo info)
     Sets the info.
public  voidsetSubject(Subject subject)
     Sets the subject.
 voidsetTransaction(UserTransactionImpl transaction)
     Sets the item's transaction.
public  booleansetTransactionTimeout(int seconds)
    
 booleanshare(UserPoolItem userPoolItem)
     Try to share the connection.
public  voidstart(Xid xid, int flags)
    
 booleansupportsTransaction()
     Returns true if the pooled connection supports transactions.
synchronized  UserPoolItemtoActive(Subject subject, ConnectionRequestInfo info, UserPoolItem userPoolItem)
     Make this connection active.
 voidtoIdle()
     Changes the state to idle.
public  StringtoString()
    

Field Detail
_shareHead
UserPoolItem _shareHead(Code)



_shareLock
final Object _shareLock(Code)




Constructor Detail
PoolItem
public PoolItem(ConnectionPool cm, ManagedConnectionFactory mcf, ManagedConnection conn)(Code)




Method Detail
abortConnection
void abortConnection()(Code)
Closes the connection.



allocateConnection
Object allocateConnection() throws ResourceException(Code)
Returns the user connection.



allocateXA
UserPoolItem allocateXA(ManagedConnectionFactory mcf, Subject subject, ConnectionRequestInfo info)(Code)
Use the item only if it's already been used for the current transaction and is available. allocateXA returns the same connection for the following case:
 UserTransaction.begin();
 conn = ds.getConnection();
 ...
 conn.close();
 conn = ds.getConnection();
 ...
 conn.close();
 

Nested connections are not reused.
Parameters:
  xid - the current transaction id true if the pool item has been allocated




commit
public void commit(Xid xid, boolean onePhase) throws XAException(Code)
commit the resource



connectionClosed
public void connectionClosed(ConnectionEvent event)(Code)
Notifies that an application has closed the connection.



connectionErrorOccurred
public void connectionErrorOccurred(ConnectionEvent event)(Code)
Notifies that a connection error has occurred.



destroy
void destroy() throws ResourceException(Code)
Closes the connection.



enableLocalTransactionOptimization
void enableLocalTransactionOptimization(boolean enableOptimization)(Code)
Returns the XA resource.



end
public void end(Xid xid, int flags) throws XAException(Code)
Ends work with the resource. Called before commit/rollback.



forget
public void forget(Xid xid) throws XAException(Code)
forget about the transaction



getAllocationStackTrace
public IllegalStateException getAllocationStackTrace()(Code)
Returns the allocation stack trace.



getEventTime
public long getEventTime()(Code)
Returns the time of the last event.



getManagedConnection
ManagedConnection getManagedConnection()(Code)
Returns the managed connection.



getStartTime
public long getStartTime()(Code)
Returns the time the connection was first used.



getTransactionTimeout
public int getTransactionTimeout() throws XAException(Code)
Returns the timeout of the underlying resource.



getXAResource
XAResource getXAResource()(Code)
Returns the XA resource.



getXid
Xid getXid()(Code)
Returns the Xid resource.



isActive
public boolean isActive()(Code)
Returns true if the connection is active.



isConnectionError
public boolean isConnectionError()(Code)
Returns true if there was a connection error.



isDead
public boolean isDead()(Code)
Returns true if the connection is dead



isJoin
boolean isJoin(PoolItem item)(Code)
Returns true if the tested pool item is the Xid leader.



isSameRM
public boolean isSameRM(XAResource resource) throws XAException(Code)
identity of resources



isValid
synchronized boolean isValid()(Code)
Checks if the pool item is still valid. true if the pool item is valid, false if it should be removed.



isValid
boolean isValid(Subject subject, ConnectionRequestInfo requestInfo, UserPoolItem userPoolItem)(Code)
Returns true for a valid connection.



localTransactionCommitted
public void localTransactionCommitted(ConnectionEvent event)(Code)
Notifies that a local transaction has committed.



localTransactionRolledback
public void localTransactionRolledback(ConnectionEvent event)(Code)
Notifies that a local transaction has rolled back.



localTransactionStarted
public void localTransactionStarted(ConnectionEvent event)(Code)
Notifies that a local transaction has started.



prepare
public int prepare(Xid xid) throws XAException(Code)
Vote using phase-1 of the 2-phase commit.



recover
public Xid[] recover(int flag) throws XAException(Code)
recover the transaction



rollback
public void rollback(Xid xid) throws XAException(Code)
rollback the resource



setConnectionError
public void setConnectionError()(Code)
Notifies that a connection error has occurred.



setInfo
public void setInfo(ConnectionRequestInfo info)(Code)
Sets the info.



setSubject
public void setSubject(Subject subject)(Code)
Sets the subject.



setTransaction
void setTransaction(UserTransactionImpl transaction)(Code)
Sets the item's transaction.



setTransactionTimeout
public boolean setTransactionTimeout(int seconds) throws XAException(Code)
Sets the transaction timeout



share
boolean share(UserPoolItem userPoolItem)(Code)
Try to share the connection.



start
public void start(Xid xid, int flags) throws XAException(Code)
starts work on a transaction branch



supportsTransaction
boolean supportsTransaction()(Code)
Returns true if the pooled connection supports transactions.



toActive
synchronized UserPoolItem toActive(Subject subject, ConnectionRequestInfo info, UserPoolItem userPoolItem) throws ResourceException(Code)
Make this connection active. true if the pool item is valid, false if it should be removed.



toIdle
void toIdle()(Code)
Changes the state to idle.



toString
public String toString()(Code)



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.