Class ManagedConnectionImpl

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

    public class ManagedConnectionImpl
    extends Object
    implements javax.resource.spi.ManagedConnection
    Implementation of ManagedConnection persistence manager Handle is the Object Instance of the API the user application is interacting with.
    • Constructor Detail

      • ManagedConnectionImpl

        public ManagedConnectionImpl​(ManagedConnectionFactoryImpl mcf,
                                     javax.resource.spi.security.PasswordCredential credential)
                              throws javax.resource.ResourceException
        Constructor.
        Parameters:
        mcf - the ManagedConnectionFactory
        credential - the PasswordCredential
        Throws:
        javax.resource.ResourceException - if error occurs
    • Method Detail

      • begin

        public void begin()
        Method to start the Transaction
      • destroy

        public void destroy()
                     throws javax.resource.ResourceException
        Destroy method
        Specified by:
        destroy in interface javax.resource.spi.ManagedConnection
        Throws:
        javax.resource.ResourceException - if error occurs
      • cleanup

        public void cleanup()
                     throws javax.resource.ResourceException
        Cleanup method
        Specified by:
        cleanup in interface javax.resource.spi.ManagedConnection
        Throws:
        javax.resource.ResourceException - if error occurs
      • getPersistenceManager

        public org.datanucleus.api.jdo.JDOPersistenceManager getPersistenceManager()
      • getConnection

        public Object getConnection​(Subject subject,
                                    javax.resource.spi.ConnectionRequestInfo cri)
                             throws javax.resource.ResourceException
        Accessor for the connection
        Specified by:
        getConnection in interface javax.resource.spi.ManagedConnection
        Parameters:
        subject - The subject
        cri - request info
        Returns:
        The connection
        Throws:
        javax.resource.ResourceException - if error occurs
      • getLogWriter

        public PrintWriter getLogWriter()
                                 throws javax.resource.ResourceException
        Accessor for the Log
        Specified by:
        getLogWriter in interface javax.resource.spi.ManagedConnection
        Returns:
        The Log writer
        Throws:
        javax.resource.ResourceException - if error occurs
      • setLogWriter

        public void setLogWriter​(PrintWriter writer)
                          throws javax.resource.ResourceException
        Mutator for the Log
        Specified by:
        setLogWriter in interface javax.resource.spi.ManagedConnection
        Parameters:
        writer - PrintWriter to use for Log
        Throws:
        javax.resource.ResourceException - if error occurs
      • addConnectionEventListener

        public void addConnectionEventListener​(javax.resource.spi.ConnectionEventListener cel)
        Mutator to add a connection listener
        Specified by:
        addConnectionEventListener in interface javax.resource.spi.ManagedConnection
        Parameters:
        cel - event listener
      • removeConnectionEventListener

        public void removeConnectionEventListener​(javax.resource.spi.ConnectionEventListener cel)
        Mutator to remove a connection listener
        Specified by:
        removeConnectionEventListener in interface javax.resource.spi.ManagedConnection
        Parameters:
        cel - event listener
      • associateConnection

        public void associateConnection​(Object c)
                                 throws javax.resource.ResourceException
        Mutator to associate a connection
        Specified by:
        associateConnection in interface javax.resource.spi.ManagedConnection
        Parameters:
        c - connection
        Throws:
        javax.resource.ResourceException - if error occurs
      • getLocalTransaction

        public javax.resource.spi.LocalTransaction getLocalTransaction()
                                                                throws javax.resource.ResourceException
        Accessor for the local transaction
        Specified by:
        getLocalTransaction in interface javax.resource.spi.ManagedConnection
        Returns:
        local txn
        Throws:
        javax.resource.ResourceException - if error occurs
      • getMetaData

        public javax.resource.spi.ManagedConnectionMetaData getMetaData()
                                                                 throws javax.resource.ResourceException
        Accessor for the connection MetaData
        Specified by:
        getMetaData in interface javax.resource.spi.ManagedConnection
        Returns:
        metadata for the connection
        Throws:
        javax.resource.ResourceException - if error occurs
      • getXAResource

        public XAResource getXAResource()
                                 throws javax.resource.ResourceException
        Accessor for the XA resource. The application server enlists this XAResource into a XA transaction This is invoked only once per instance.
        Specified by:
        getXAResource in interface javax.resource.spi.ManagedConnection
        Returns:
        XA resource
        Throws:
        javax.resource.ResourceException - if error occurs