Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.adapter.cci
Class AbstractConnection

    java.lang.Object
      com.bea.adapter.cci.AbstractConnection

All Implemented Interfaces:
  IProxiedConnection, javax.resource.cci.Connection

    public abstract class AbstractConnection

extends Object
implements javax.resource.cci.Connection, IProxiedConnection

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 (c) 1998-2000 by 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.
`javax.resource.cci.Connection` | `getAdapterConnection()` Used to gain access to the real javax.resource.Connection from the proxy returned in weblogic.
`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()`
`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.
`boolean` | `isClosed()`
`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`

Methods inherited from interface javax.resource.cci.Connection
`createInteraction`

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
  Throws:
    `javax.resource.ResourceException`

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.

  Throws:
    `javax.resource.ResourceException`

### 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.

### isClosed

    public boolean isClosed()

  Returns:
    true if this connection is closed

### close

    public void close()
               throws javax.resource.ResourceException

  Closes this application-level connection handle.

  Specified by:
    `close` in interface `javax.resource.cci.Connection`
  Throws:
    `javax.resource.ResourceException`

### invalidate

    public void invalidate()

  Invalidates this handle.

### getAutoCommit

    public boolean getAutoCommit()
                          throws javax.resource.ResourceException

  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
  Throws:
    `javax.resource.ResourceException`

### 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`. Note, this method will attempt to enable local TX event notifications as per the JCA 1.0 spec. By default LocalTransaction objects obtained directly from the managed connection (by the Connector container) should not send local TX event notifications. If the LocalTransaction object returned by the managed connection is a subclass of AbstractLocalTransaction, this method will call the AbstractLocalTransaction.setNotifyEnabled(true) method.

  Specified by:
    `getLocalTransaction` in interface `javax.resource.cci.Connection`
  Throws:
    `javax.resource.ResourceException`

### getAdapterConnection

    public javax.resource.cci.Connection getAdapterConnection()

  Used to gain access to the real javax.resource.Connection from the proxy returned in weblogic. The ConnectionFactory. getConnection() method returns a proxy for the connection and can only be cast to Interfaces implemented in the derivation tree.

  Specified by:
    `getAdapterConnection` in interface `IProxiedConnection`
  Returns:
    javax.resource.Connection -- the real Connection class.

### 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`
  Throws:
    `javax.resource.ResourceException`

### 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`
  Throws:
    `javax.resource.ResourceException`

### 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.

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

### getPhysicalConnection

    public Object getPhysicalConnection()
                                 throws javax.resource.ResourceException

  This method returns the physical database connection of our managed connection member.

  Throws:
    `javax.resource.ResourceException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD