|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jonas.jdbc.ManagedConnectionImpl
Represent an underlying Connection
Field Summary | |
protected java.util.HashSet |
cels
Connection Event Listeners |
protected javax.sql.DataSource |
factory
|
protected boolean |
inLocalTransaction
|
protected java.io.PrintWriter |
out
|
org.objectweb.util.monolog.api.Logger |
trace
|
Constructor Summary | |
ManagedConnectionImpl(ManagedConnectionFactoryImpl _mcf,
javax.resource.spi.security.PasswordCredential _pc,
java.sql.Connection _con,
javax.sql.PooledConnection _pcon,
javax.sql.XAConnection _xa,
org.objectweb.jonas.jdbc.DriverWrapper wrp)
Constructor |
Method Summary | |
void |
addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Adds a connection event listener. |
void |
addSignature(long sig)
|
void |
associateConnection(java.lang.Object con)
Change the association of a connection handle. |
void |
begin()
start a new local transaction. |
void |
cleanup()
Cleanup the ManagedConnection instance. |
void |
clearSignature()
|
void |
clearSignature(long sig,
boolean clear)
|
void |
close(ConnectionImpl ch)
The Connection Handler has been closed by its user. |
void |
commit()
commit the local transaction. |
void |
destroy()
Destroys the physical connection. |
boolean |
getAutoCommit()
|
java.lang.Object |
getConnection(javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
Create a connection handle for user purpose. |
javax.resource.spi.LocalTransaction |
getLocalTransaction()
Returns an javax.resource.spi.LocalTransaction instance. |
java.io.PrintWriter |
getLogWriter()
Gets the log writer for this ManagedConnection instance. |
javax.resource.spi.ManagedConnectionMetaData |
getMetaData()
Gets the metadata information for this connection's underlying EIS resource manager instance. |
long |
getNewSignature(boolean setSig)
Gets the next signature value |
long |
getSignature()
Gets the current signature value |
long |
getSignature(long sig)
Gets the signature value passed in if found in the signature hash table |
javax.transaction.xa.XAResource |
getXAResource()
Get an XAResource to enlist with the Transaction Manager. |
boolean |
isValid()
Check if Connection is still valid |
void |
removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Removes an already registered connection event listener from the ManagedConnection instance |
void |
rollback()
rollback the local transaction. |
void |
setAutoCommit(boolean ac)
set the autocommit |
void |
setLogWriter(java.io.PrintWriter _out)
Sets the log writer for this ManagedConnection instance. |
void |
setSignature(long sig)
|
void |
signalEvent(int code,
java.lang.Object ch,
java.lang.Exception ex)
Signal an event to all the registered listeners. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public org.objectweb.util.monolog.api.Logger trace
protected java.io.PrintWriter out
protected javax.sql.DataSource factory
protected java.util.HashSet cels
protected boolean inLocalTransaction
Constructor Detail |
public ManagedConnectionImpl(ManagedConnectionFactoryImpl _mcf, javax.resource.spi.security.PasswordCredential _pc, java.sql.Connection _con, javax.sql.PooledConnection _pcon, javax.sql.XAConnection _xa, org.objectweb.jonas.jdbc.DriverWrapper wrp)
_mcf
- The calling factory_pc
- username and password._con
- physical Connection_pcon
- PooledConnection in case of CP, or null._xa
- XAConnection in case of XA, or null.wrp
- DriverWrapper in case of DM, or null.Method Detail |
public void signalEvent(int code, java.lang.Object ch, java.lang.Exception ex)
code
- type of event (CONNECTION_ERROR_OCCURRED, CONNECTION_CLOSED, ...)ch
- may be a connection handler or null.ex
- exception if CONNECTION_ERROR_OCCURREDpublic boolean getAutoCommit() throws javax.resource.ResourceException
javax.resource.ResourceException
public void setAutoCommit(boolean ac) throws javax.resource.ResourceException
javax.resource.ResourceException
- could not set autocommit.public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
addConnectionEventListener
in interface javax.resource.spi.ManagedConnection
public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
removeConnectionEventListener
in interface javax.resource.spi.ManagedConnection
public void associateConnection(java.lang.Object con) throws javax.resource.ResourceException
associateConnection
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
public void cleanup() throws javax.resource.ResourceException
cleanup
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- Error while cleaning up.
java.lang.IllegalStateException
- A transaction is not ended.public void destroy() throws javax.resource.ResourceException
destroy
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
public java.lang.Object getConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo) throws javax.resource.ResourceException
getConnection
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- Cannot create Handlepublic void close(ConnectionImpl ch) throws javax.resource.ResourceException
ch
- Connection Handler
javax.resource.ResourceException
- error while signaling the event to listenerspublic javax.resource.spi.LocalTransaction getLocalTransaction() throws javax.resource.ResourceException
getLocalTransaction
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
public java.io.PrintWriter getLogWriter()
getLogWriter
in interface javax.resource.spi.ManagedConnection
public javax.resource.spi.ManagedConnectionMetaData getMetaData() throws javax.resource.ResourceException
getMetaData
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
public javax.transaction.xa.XAResource getXAResource() throws javax.resource.ResourceException
getXAResource
in interface javax.resource.spi.ManagedConnection
javax.resource.ResourceException
- cannot get it.public void setLogWriter(java.io.PrintWriter _out)
setLogWriter
in interface javax.resource.spi.ManagedConnection
public void addSignature(long sig)
public void clearSignature()
public void clearSignature(long sig, boolean clear)
public void setSignature(long sig)
public long getSignature(long sig)
sig
- value to find in signature table
public long getSignature()
public long getNewSignature(boolean setSig)
public void begin() throws javax.resource.ResourceException
begin
in interface javax.resource.spi.LocalTransaction
javax.resource.ResourceException
public void commit() throws javax.resource.ResourceException
commit
in interface javax.resource.spi.LocalTransaction
javax.resource.ResourceException
public void rollback() throws javax.resource.ResourceException
rollback
in interface javax.resource.spi.LocalTransaction
javax.resource.ResourceException
public boolean isValid()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |