Class CICSManagedConnection
- All Implemented Interfaces:
jakarta.resource.spi.ManagedConnection
- Direct Known Subclasses:
ECIManagedConnection
,EPIManagedConnection
This class also owns and controls the Java Gateway instance.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConnectionEventListener
(jakarta.resource.spi.ConnectionEventListener newListener) Add a connectionEvent listener to the collectionvoid
associateConnection
(Object Connection) 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
cleanup()
This method should be called by all subclasses cleanup method before they initiate their own specific cleanup.void
destroy()
This method is the final stage of destroying the Managed Connection.return the Current Logwriter for this instancejakarta.resource.spi.ManagedConnectionMetaData
returns a ManagedConnection MetaData Objectvoid
removeConnectionEventListener
(jakarta.resource.spi.ConnectionEventListener Listener) Remove a Connection Event Listener from the collectionvoid
setLogWriter
(PrintWriter newLog) set the logwriter to be used by this object.toString()
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
-
CLASS_VERSION
- See Also:
-
-
Method Details
-
getLogWriter
return the Current Logwriter for this instance- Specified by:
getLogWriter
in interfacejakarta.resource.spi.ManagedConnection
- Returns:
- the log writer
-
setLogWriter
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 interfacejakarta.resource.spi.ManagedConnection
- Parameters:
newLog
- The PrintWriter to use
-
associateConnection
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 interfacejakarta.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 interfacejakarta.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 interfacejakarta.resource.spi.ManagedConnection
- Parameters:
Listener
- ConnectionEventListener
-
cleanup
public void cleanup() throws jakarta.resource.ResourceExceptionThis 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 interfacejakarta.resource.spi.ManagedConnection
- Throws:
jakarta.resource.ResourceException
-
destroy
public void destroy() throws jakarta.resource.ResourceExceptionThis 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 interfacejakarta.resource.spi.ManagedConnection
- Throws:
jakarta.resource.ResourceException
-
getMetaData
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData()returns a ManagedConnection MetaData Object- Specified by:
getMetaData
in interfacejakarta.resource.spi.ManagedConnection
- Returns:
- ManagedConnectionMetaData
-
toString
return a string representation of this object. It is made up of the super toString + the properties held in this object.
-