Class CICSManagedConnection

java.lang.Object
com.ibm.jakarta.connector2.cics.CICSManagedConnection
All Implemented Interfaces:
jakarta.resource.spi.ManagedConnection
Direct Known Subclasses:
ECIManagedConnection, EPIManagedConnection

public abstract class CICSManagedConnection extends Object implements jakarta.resource.spi.ManagedConnection
Abstract class for the CICS managed connection This class handles all the generic stuff such as registering/removing connection Listeners. It provides a method to fire events to these listeners.

This class also owns and controls the Java Gateway instance.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addConnectionEventListener(jakarta.resource.spi.ConnectionEventListener newListener)
    Add a connectionEvent listener to the collection
    void
    This method should be called from the subclasses associateConnection method once it has determined that the object passed to it is of the right class type.
    void
    This method should be called by all subclasses cleanup method before they initiate their own specific cleanup.
    void
    This method is the final stage of destroying the Managed Connection.
    return the Current Logwriter for this instance
    jakarta.resource.spi.ManagedConnectionMetaData
    returns a ManagedConnection MetaData Object
    void
    removeConnectionEventListener(jakarta.resource.spi.ConnectionEventListener Listener)
    Remove a Connection Event Listener from the collection
    void
    set the logwriter to be used by this object.
    return a string representation of this object.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface jakarta.resource.spi.ManagedConnection

    getConnection, getLocalTransaction, getXAResource
  • Field Details

  • Method Details

    • getLogWriter

      public PrintWriter getLogWriter()
      return the Current Logwriter for this instance
      Specified by:
      getLogWriter in interface jakarta.resource.spi.ManagedConnection
      Returns:
      the log writer
    • setLogWriter

      public void setLogWriter(PrintWriter newLog)
      set the logwriter to be used by this object. Setting this to null will switch off logging. Setting it to a PrintWriter Object will turn logging on.
      Specified by:
      setLogWriter in interface jakarta.resource.spi.ManagedConnection
      Parameters:
      newLog - The PrintWriter to use
    • associateConnection

      public void associateConnection(Object Connection) throws jakarta.resource.ResourceException
      This method should be called from the subclasses associateConnection method once it has determined that the object passed to it is of the right class type.

      This method will get the connection removed from it's current Managed Connection Stack (it may not be the current connection, or even be in the stack anymore) and make it the current Connection for this managed Connection

      If this Managed Connection is Dirty then we throw an exception

      This method name may change as it restricts the subclass from being specific about the exceptions it can throw. all subclasses must implement a cleanup as it is unlikely that this method will do all that is required...

      Specified by:
      associateConnection in interface jakarta.resource.spi.ManagedConnection
      Parameters:
      Connection - The Connection to Associate
      Throws:
      jakarta.resource.ResourceException - if Managed Connection Dirty.
    • addConnectionEventListener

      public void addConnectionEventListener(jakarta.resource.spi.ConnectionEventListener newListener)
      Add a connectionEvent listener to the collection
      Specified by:
      addConnectionEventListener in interface jakarta.resource.spi.ManagedConnection
      Parameters:
      newListener - ConnectionEventListener
    • removeConnectionEventListener

      public void removeConnectionEventListener(jakarta.resource.spi.ConnectionEventListener Listener)
      Remove a Connection Event Listener from the collection
      Specified by:
      removeConnectionEventListener in interface jakarta.resource.spi.ManagedConnection
      Parameters:
      Listener - ConnectionEventListener
    • cleanup

      public void cleanup() throws jakarta.resource.ResourceException
      This method should be called by all subclasses cleanup method before they initiate their own specific cleanup.

      This will handle invalidating of open connections and interactions and in the future will ask the gateway to clean itself up. It then resets all the references.

      This method name may change as it restricts the subclass from being specific about the exceptions it can throw. all subclasses must implement a cleanup as it is unlikely that this method will do all that is required. "cleanupCICS"

      Specified by:
      cleanup in interface jakarta.resource.spi.ManagedConnection
      Throws:
      jakarta.resource.ResourceException
    • destroy

      public void destroy() throws jakarta.resource.ResourceException
      This method is the final stage of destroying the Managed Connection. It will managed the JavaGateway destruction.

      This method doesn't invoke cleanup. It is upto the subclasses to invoke the right type of cleanup (either their level cleanup or a framework level cleanup. They should not invoke any cleanup if cleanup has already been initiated.

      This method name may change as it restricts the subclass from being specific about the exceptions it can throw. all subclasses must implement a destroy as it is unlikely that this method will do all that is required. "destroyCICS"

      Specified by:
      destroy in interface jakarta.resource.spi.ManagedConnection
      Throws:
      jakarta.resource.ResourceException
    • getMetaData

      public jakarta.resource.spi.ManagedConnectionMetaData getMetaData()
      returns a ManagedConnection MetaData Object
      Specified by:
      getMetaData in interface jakarta.resource.spi.ManagedConnection
      Returns:
      ManagedConnectionMetaData
    • toString

      public String toString()
      return a string representation of this object. It is made up of the super toString + the properties held in this object.
      Overrides:
      toString in class Object
      Returns:
      A String representation