org.datanucleus.jdo.connector
Class ManagedConnectionImpl

java.lang.Object
  extended by org.datanucleus.jdo.connector.ManagedConnectionImpl
All Implemented Interfaces:
javax.resource.spi.ManagedConnection

public class ManagedConnectionImpl
extends java.lang.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.

Version:
$Revision: 1.1 $

Constructor Summary
ManagedConnectionImpl(ManagedConnectionFactoryImpl mcf, javax.resource.spi.security.PasswordCredential credential)
          Constructor
 
Method Summary
 void addConnectionEventListener(javax.resource.spi.ConnectionEventListener cel)
          Mutator to add a connection listener
 void associateConnection(java.lang.Object c)
          Mutator to associate a connection
 void begin()
          Method to start the Transaction
 void cleanup()
          Cleanup method
 void destroy()
          Destroy method
 java.lang.Object getConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri)
          Accessor for the connection
 javax.resource.spi.LocalTransaction getLocalTransaction()
          Accessor for the local transaction
 java.io.PrintWriter getLogWriter()
          Accessor for the Log
 javax.resource.spi.ManagedConnectionMetaData getMetaData()
          Accessor for the connection MetaData
 org.datanucleus.jdo.JDOPersistenceManager getPersistenceManager()
           
 javax.transaction.xa.XAResource getXAResource()
          Accessor for the XA resource.
 void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener cel)
          Mutator to remove a connection listener
 void setLogWriter(java.io.PrintWriter writer)
          Mutator for the Log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
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 -

cleanup

public void cleanup()
             throws javax.resource.ResourceException
Cleanup method

Specified by:
cleanup in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException -

getPersistenceManager

public org.datanucleus.jdo.JDOPersistenceManager getPersistenceManager()

getConnection

public java.lang.Object getConnection(javax.security.auth.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 -
cri -
Returns:
Throws:
javax.resource.ResourceException -

getLogWriter

public java.io.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 -

setLogWriter

public void setLogWriter(java.io.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 -

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 -

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 -

associateConnection

public void associateConnection(java.lang.Object c)
                         throws javax.resource.ResourceException
Mutator to associate a connection

Specified by:
associateConnection in interface javax.resource.spi.ManagedConnection
Parameters:
c -
Throws:
javax.resource.ResourceException -

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:
Throws:
javax.resource.ResourceException -

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:
Throws:
javax.resource.ResourceException -

getXAResource

public javax.transaction.xa.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:
Throws:
javax.resource.ResourceException -


Copyright © 2009. All Rights Reserved.