Class ECIManagedConnection

java.lang.Object
com.ibm.jakarta.connector2.cics.CICSManagedConnection
com.ibm.jakarta.connector2.cics.ECIManagedConnection
All Implemented Interfaces:
jakarta.resource.spi.DissociatableManagedConnection, jakarta.resource.spi.LazyEnlistableManagedConnection, jakarta.resource.spi.ManagedConnection

public final class ECIManagedConnection extends CICSManagedConnection implements jakarta.resource.spi.DissociatableManagedConnection, jakarta.resource.spi.LazyEnlistableManagedConnection

ECIManagedConnection is class that interfaces directly with the CICS EIS. All execute() requests on ECIInteractions go through the respective ECIManagedConnection

In a managed environment the system will also interface with the ECIManagedConnection to control Transactions within the ECI Connector.

  • Field Details

  • Method Details

    • associateConnection

      public void associateConnection(Object conn) throws jakarta.resource.ResourceException
      This function allows an ECIConnection object to be associated with this ManagedConnection. Upon association the new ECIConnection will become the current active Connection. Association with a new ECIManagedConnecion causes the ECIConnection to be dis-associated from its current ECIManagedConnection.
      Specified by:
      associateConnection in interface jakarta.resource.spi.ManagedConnection
      Overrides:
      associateConnection in class CICSManagedConnection
      Parameters:
      conn - The ECIConnection to be associated with this ECIManagedConnection.
      Throws:
      jakarta.resource.ResourceException - Thrown if an error occurs in the association or if conn is not of the correct type or null.
    • cleanup

      public void cleanup() throws jakarta.resource.ResourceException
      Clean-up method. This method prepares the ECIManagedConnection for re-use by the environment.
      Specified by:
      cleanup in interface jakarta.resource.spi.ManagedConnection
      Overrides:
      cleanup in class CICSManagedConnection
      Throws:
      jakarta.resource.ResourceException - Thrown if cleanup does not complete successfully
    • destroy

      public void destroy() throws jakarta.resource.ResourceException
      Destructor. This method destroys any resources being used by the ECIManagedConnection and disables any further interaction with it.
      Specified by:
      destroy in interface jakarta.resource.spi.ManagedConnection
      Overrides:
      destroy in class CICSManagedConnection
      Throws:
      jakarta.resource.ResourceException - Thrown if destruction does not complete successfully
    • toString

      public String toString()
      toString() method for use in tracing
      Overrides:
      toString in class CICSManagedConnection
      Returns:
      A String representation
    • getConnection

      public Object getConnection(Subject security, jakarta.resource.spi.ConnectionRequestInfo request) throws jakarta.resource.ResourceException
      The custom connection mechanism. This method provides an ECIConnection object that uses additional properties supplied in the parameters to re-authenticate the connection to CICS. Re-authentication only takes place when this is the first getConnection() call after the MC has been created or requested from the pool.
      Specified by:
      getConnection in interface jakarta.resource.spi.ManagedConnection
      Parameters:
      security - A Subject object containing a PasswordCredential to be used as the security credentials by the Connection.
      request - An ECIConnectionRequestInfo object containing a set of credentials to be used for the Connection.
      Returns:
      An ECIConnection handle for this ECIManagedConnection
      Throws:
      jakarta.resource.ResourceException - Thrown if the connection request fails.
    • getLocalTransaction

      public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws jakarta.resource.ResourceException
      SPI version of Local Transaction interface returns an SPILocalTransaction object for use by the J2EE environment.
      Specified by:
      getLocalTransaction in interface jakarta.resource.spi.ManagedConnection
      Returns:
      The SPI Local Transaction object for this ECIManagedConnection
      Throws:
      jakarta.resource.ResourceException
    • getXAResource

      public XAResource getXAResource() throws jakarta.resource.ResourceException
      Accessor for this ECIManagedConnections XA Resource interface object. Using the returned XAResource, transactions on the ECIManagedConnection can be controlled.
      Specified by:
      getXAResource in interface jakarta.resource.spi.ManagedConnection
      Returns:
      The XAResource handle for this ECIManagedConnection
      Throws:
      jakarta.resource.ResourceException
    • getMetaData

      public jakarta.resource.spi.ManagedConnectionMetaData getMetaData()
      returns a ManagedConnection MetaData Object for this resource adapter.
      Specified by:
      getMetaData in interface jakarta.resource.spi.ManagedConnection
      Overrides:
      getMetaData in class CICSManagedConnection
      Returns:
      ManagedConnectionMetaData
    • dissociateConnections

      public void dissociateConnections() throws jakarta.resource.ResourceException
      Dissociates all the ECI Connections from this managed connection instance. This allows the application server to associate the managed connection with another ECI Connection via lazy connection association.
      Specified by:
      dissociateConnections in interface jakarta.resource.spi.DissociatableManagedConnection
      Throws:
      jakarta.resource.ResourceException - If any connection instance isn't an instance of ECIConnection
    • setAuth

      public void setAuth(String caller, Subject security, jakarta.resource.spi.ConnectionRequestInfo request)
    • testConnection

      public boolean testConnection() throws jakarta.resource.NotSupportedException
      Gets the status of the connection to CICS when configured to use a local mode IPIC connection. This method can be used to determine whether a subsquent interaction on this connection is likely to succeed. If this connection does not use a local mode IPIC connection to CICS, or the IPIC connection status cannot reliably be determined, a NotSupportedException is thrown. This method is only called when resource adapter is deployed in Traditional WAS.
      Returns:
      true if the IPIC connection to CICS is available; false if the connection is not available
      Throws:
      jakarta.resource.NotSupportedException - if this connection does not use a local mode IPIC connection or the connection status cannot reliably be determined