org.objectweb.joram.client.connector

Class ManagedConnectionImpl

Implemented Interfaces:
javax.jms.ExceptionListener, javax.resource.spi.LocalTransaction, javax.resource.spi.ManagedConnection

public class ManagedConnectionImpl
extends java.lang.Object
implements javax.resource.spi.ManagedConnection, javax.resource.spi.LocalTransaction, javax.jms.ExceptionListener

A ManagedConnectionImpl instance wraps a physical connection to an underlying JORAM server, and provides "handles" for handling this physical connection.

Method Summary

void
addConnectionEventListener(ConnectionEventListener listener)
Adds a connection event listener.
void
associateConnection(Object connection)
Dissociates a given connection handle and associates it to this managed connection.
void
begin()
Notifies that the local transaction is beginning.
void
cleanup()
Invalidates the created handles and prepares the physical connection to be put back into a connection pool.
void
commit()
Commits the local transaction.
void
destroy()
Destroys the physical connection to the underlying JORAM server.
boolean
equals(Object o)
Compares ManagedConnectionImpl instances according to their server and user identification parameters.
Object
getConnection(javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo)
Returns a new OutboundConnection instance for handling the physical connection.
javax.resource.spi.LocalTransaction
getLocalTransaction()
Returns this managed connection instance as a LocalTransaction instance for managing local transactions.
PrintWriter
getLogWriter()
Gets the log writer for this ManagedConnectionImpl instance.
ManagedConnectionMetaData
getMetaData()
Returns the metadata information for the underlying JORAM server.
XAResource
getXAResource()
Provides a XAResource instance for managing distributed transactions.
int
hashCode()
Returns a code based on the JORAM server and user identification parameters.
void
onException(JMSException exc)
Notifies that the wrapped physical connection has been lost.
void
removeConnectionEventListener(ConnectionEventListener listener)
Removes a connection event listener.
void
rollback()
Rollsback the local transaction.
void
setLogWriter(PrintWriter out)
Sets the log writer for this ManagedConnectionImpl instance.

Method Details

addConnectionEventListener

public void addConnectionEventListener(ConnectionEventListener listener)
Adds a connection event listener.


associateConnection

public void associateConnection(Object connection)
            throws ResourceException
Dissociates a given connection handle and associates it to this managed connection.


begin

public void begin()
            throws ResourceException
Notifies that the local transaction is beginning.


cleanup

public void cleanup()
            throws ResourceException
Invalidates the created handles and prepares the physical connection to be put back into a connection pool.


commit

public void commit()
            throws ResourceException
Commits the local transaction.


destroy

public void destroy()
            throws ResourceException
Destroys the physical connection to the underlying JORAM server.


equals

public boolean equals(Object o)
Compares ManagedConnectionImpl instances according to their server and user identification parameters.


getConnection

public Object getConnection(javax.security.auth.Subject subject,
                            ConnectionRequestInfo cxRequestInfo)
            throws ResourceException
Returns a new OutboundConnection instance for handling the physical connection.


getLocalTransaction

public javax.resource.spi.LocalTransaction getLocalTransaction()
            throws ResourceException
Returns this managed connection instance as a LocalTransaction instance for managing local transactions.


getLogWriter

public PrintWriter getLogWriter()
            throws ResourceException
Gets the log writer for this ManagedConnectionImpl instance.


getMetaData

public ManagedConnectionMetaData getMetaData()
            throws ResourceException
Returns the metadata information for the underlying JORAM server.


getXAResource

public XAResource getXAResource()
            throws ResourceException
Provides a XAResource instance for managing distributed transactions.


hashCode

public int hashCode()
Returns a code based on the JORAM server and user identification parameters.


onException

public void onException(JMSException exc)
Notifies that the wrapped physical connection has been lost.


removeConnectionEventListener

public void removeConnectionEventListener(ConnectionEventListener listener)
Removes a connection event listener.


rollback

public void rollback()
            throws ResourceException
Rollsback the local transaction.


setLogWriter

public void setLogWriter(PrintWriter out)
            throws ResourceException
Sets the log writer for this ManagedConnectionImpl instance.


Copyright B) 2004 Scalagent - All rights reserved