Class JCAManagedConnection

  • All Implemented Interfaces:
    javax.resource.spi.ManagedConnection, javax.resource.spi.ManagedConnectionMetaData

    public class JCAManagedConnection
    extends Object
    implements javax.resource.spi.ManagedConnection, javax.resource.spi.ManagedConnectionMetaData
    This class implements the managed connection for this resource adapter.
    • Method Detail

      • getManagedConnectionFactory

        public JCAManagedConnectionFactory getManagedConnectionFactory()
        Return the managed connection factory.
      • getConnectionRequestInfo

        public JCAConnectionRequestInfo getConnectionRequestInfo()
        Return the connection request info.
      • getLogWriter

        public PrintWriter getLogWriter()
        Get the log writer.
        Specified by:
        getLogWriter in interface javax.resource.spi.ManagedConnection
      • setLogWriter

        public void setLogWriter​(PrintWriter logWriter)
                          throws javax.resource.ResourceException
        Set the log writer.
        Specified by:
        setLogWriter in interface javax.resource.spi.ManagedConnection
        Throws:
        javax.resource.ResourceException
      • getConnection

        public Object getConnection​(Subject subject,
                                    javax.resource.spi.ConnectionRequestInfo cri)
                             throws javax.resource.ResourceException
        Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance.
        Specified by:
        getConnection in interface javax.resource.spi.ManagedConnection
        Throws:
        javax.resource.ResourceException
      • destroy

        public void destroy()
                     throws javax.resource.ResourceException
        Destroys the physical connection to the underlying resource manager.
        Specified by:
        destroy in interface javax.resource.spi.ManagedConnection
        Throws:
        javax.resource.ResourceException
      • cleanup

        public void cleanup()
                     throws javax.resource.ResourceException
        Application server calls this method to force any cleanup on the ManagedConnection instance.
        Specified by:
        cleanup in interface javax.resource.spi.ManagedConnection
        Throws:
        javax.resource.ResourceException
      • associateConnection

        public void associateConnection​(Object connection)
                                 throws javax.resource.ResourceException
        Used by the container to change the association of an application-level connection handle with a ManagedConneciton instance.
        Specified by:
        associateConnection in interface javax.resource.spi.ManagedConnection
        Throws:
        javax.resource.ResourceException
      • getXAResource

        public XAResource getXAResource()
                                 throws javax.resource.ResourceException
        Returns an javax.transaction.xa.XAresource instance.
        Specified by:
        getXAResource in interface javax.resource.spi.ManagedConnection
        Throws:
        javax.resource.ResourceException
      • getLocalTransaction

        public javax.resource.spi.LocalTransaction getLocalTransaction()
                                                                throws javax.resource.ResourceException
        Returns an javax.resource.spi.LocalTransaction instance.
        Specified by:
        getLocalTransaction in interface javax.resource.spi.ManagedConnection
        Throws:
        javax.resource.ResourceException
      • getMetaData

        public javax.resource.spi.ManagedConnectionMetaData getMetaData()
                                                                 throws javax.resource.ResourceException
        Gets the metadata information for this connection's underlying EIS resource manager instance.
        Specified by:
        getMetaData in interface javax.resource.spi.ManagedConnection
        Throws:
        javax.resource.ResourceException
      • closeHandle

        public void closeHandle​(JCASessionHandle handle)
        Close the handle.
      • getEISProductName

        public String getEISProductName()
                                 throws javax.resource.ResourceException
        Return the product name.
        Specified by:
        getEISProductName in interface javax.resource.spi.ManagedConnectionMetaData
        Throws:
        javax.resource.ResourceException
      • getEISProductVersion

        public String getEISProductVersion()
                                    throws javax.resource.ResourceException
        Return the product version.
        Specified by:
        getEISProductVersion in interface javax.resource.spi.ManagedConnectionMetaData
        Throws:
        javax.resource.ResourceException
      • getMaxConnections

        public int getMaxConnections()
                              throws javax.resource.ResourceException
        Return number of max connections.
        Specified by:
        getMaxConnections in interface javax.resource.spi.ManagedConnectionMetaData
        Throws:
        javax.resource.ResourceException
      • getUserName

        public String getUserName()
                           throws javax.resource.ResourceException
        Return the user name.
        Specified by:
        getUserName in interface javax.resource.spi.ManagedConnectionMetaData
        Throws:
        javax.resource.ResourceException
      • log

        public void log​(String message)
        Log a message.
      • log

        public void log​(String message,
                        Throwable exception)
        Log a message.
      • addConnectionEventListener

        public void addConnectionEventListener​(javax.resource.spi.ConnectionEventListener listener)
        Adds a listener.
        Specified by:
        addConnectionEventListener in interface javax.resource.spi.ManagedConnection
      • removeConnectionEventListener

        public void removeConnectionEventListener​(javax.resource.spi.ConnectionEventListener listener)
        Remove a listener.
        Specified by:
        removeConnectionEventListener in interface javax.resource.spi.ManagedConnection
      • sendTxCommittedEvent

        public void sendTxCommittedEvent​(JCASessionHandle handle)
        Send transaction committed event.
      • sendTxRolledbackEvent

        public void sendTxRolledbackEvent​(JCASessionHandle handle)
        Send transaction rolledback event.
      • sendTxStartedEvent

        public void sendTxStartedEvent​(JCASessionHandle handle)
        Send transaction started event.