WebLogic Integration


com.bea.adapter.cci
Class AbstractConnection

java.lang.Object
  |
  +--com.bea.adapter.cci.AbstractConnection

public abstract class AbstractConnection
extends java.lang.Object
implements javax.resource.cci.Connection

A simple implementation of the CCI Connection interface. Provides logging support and basic state management (i.e. whether this handle has been closed, etc.). Adapter developers will need to implement the createInteraction method to return a concrete Interaction.

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.

Constructor Summary
AbstractConnection(AbstractManagedConnection managedConnection)
          Creates an object that represents an application-level connection handle to an EIS.
 
Method Summary
protected  void checkIfClosed()
          Checks to see if the client has already called the "close" on this instance.
 void close()
          Closes this application-level connection handle.
 boolean getAutoCommit()
           
 javax.resource.cci.LocalTransaction getLocalTransaction()
          This method delegates the retrieval of a local transaction instance to its ManagedConnection.
 LogContext getLogContext()
          Retrieves an object that determines the logging configuration for this instance in the logging framework.
 ILogger getLogger()
          Retrieves an object used to log information to.
 AbstractManagedConnection getManagedConnection()
          Get the managed connection for this connection.
 javax.resource.cci.ConnectionMetaData getMetaData()
           
 java.lang.Object getPhysicalConnection()
          This method returns the physical database connection of our managed connection member.
 javax.resource.cci.ResultSetInfo getResultSetInfo()
          This method is not supported by default; adapter providers should override this method to return result set info.
 void invalidate()
          Invalidates this handle.
 void setAutoCommit(boolean bAutoCommit)
          This method gets the current physical (jdbc) connection of our managed connection and checks to make sure that it supports local transactions.
 void setManagedConnection(AbstractManagedConnection managedConnection)
          Sets the managed connection for this connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConnection

public AbstractConnection(AbstractManagedConnection managedConnection)
                   throws javax.resource.ResourceException
Creates an object that represents an application-level connection handle to an EIS.

Parameters:
managedConnection - - the underlying physical connection to the EIS
Method Detail

getManagedConnection

public AbstractManagedConnection getManagedConnection()
Get the managed connection for this connection.


setManagedConnection

public void setManagedConnection(AbstractManagedConnection managedConnection)
                          throws javax.resource.ResourceException
Sets the managed connection for this connection.


checkIfClosed

protected void checkIfClosed()
                      throws javax.resource.spi.IllegalStateException
Checks to see if the client has already called the "close" on this instance.

Throws:
javax.resource.spi.IllegalStateException - - the destoy has already been called on this instance.

close

public void close()
           throws javax.resource.ResourceException
Closes this application-level connection handle.
Specified by:
close in interface javax.resource.cci.Connection


invalidate

public void invalidate()
Invalidates this handle.


getAutoCommit

public boolean getAutoCommit()
                      throws javax.resource.ResourceException
Specified by:
getAutoCommit in interface javax.resource.cci.Connection

Returns:
true if the connection is in auto-commit mode; false otherwise. This value is 'false' by default per the J2EE Connector Architecture specification pg. 105

getLocalTransaction

public javax.resource.cci.LocalTransaction getLocalTransaction()
                                                        throws javax.resource.ResourceException
This method delegates the retrieval of a local transaction instance to its ManagedConnection. Consequently, this assumes that the local transaction object supplied by the ManagedConnection implements javax.resource.cci.LocalTransaction as well as javax.resource.spi.LocalTransaction.
Specified by:
getLocalTransaction in interface javax.resource.cci.Connection


getLogContext

public LogContext getLogContext()
Retrieves an object that determines the logging configuration for this instance in the logging framework.

Returns:
an object that determines the logging configuration for this instance.

getLogger

public ILogger getLogger()
Retrieves an object used to log information to.

Returns:
an object used to log information to.

getMetaData

public javax.resource.cci.ConnectionMetaData getMetaData()
                                                  throws javax.resource.ResourceException
Specified by:
getMetaData in interface javax.resource.cci.Connection


getResultSetInfo

public javax.resource.cci.ResultSetInfo getResultSetInfo()
                                                  throws javax.resource.ResourceException
This method is not supported by default; adapter providers should override this method to return result set info.
Specified by:
getResultSetInfo in interface javax.resource.cci.Connection


setAutoCommit

public void setAutoCommit(boolean bAutoCommit)
                   throws javax.resource.ResourceException
This method gets the current physical (jdbc) connection of our managed connection and checks to make sure that it supports local transactions. If it does, it then sets autocommit to the value passed as the arg bAutoCommit. It also sets our local member m_bAutoCommit.
Specified by:
setAutoCommit in interface javax.resource.cci.Connection

Parameters:
bAutoCommit - is a boolean indicating whether or not autocommit should be turned on (true) or turned off (false).

getPhysicalConnection

public java.lang.Object getPhysicalConnection()
                                       throws javax.resource.ResourceException
This method returns the physical database connection of our managed connection member.


WebLogic Integration

WebLogic Integration (WLI)