com.metamatrix.common.connection
Class SimpleManagedConnection

java.lang.Object
  extended by com.metamatrix.common.connection.ManagedConnection
      extended by com.metamatrix.common.connection.SimpleManagedConnection

public final class SimpleManagedConnection
extends ManagedConnection

A trivial implementation of a ManagedConnection - all the abstract methods of ManagedConnection are simply implemented as no-ops here. This class is useful for testing or for use with a spi implementation involving a data source that doesn't support transactions, such as a file or file system.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.metamatrix.common.connection.ManagedConnection
ManagedConnection.ConnectionStatistics
 
Field Summary
 
Fields inherited from class com.metamatrix.common.connection.ManagedConnection
DATABASE, DRIVER, PASSWORD, PROTOCOL, USERNAME
 
Constructor Summary
SimpleManagedConnection(java.util.Properties env)
          Create a new instance of a connection.
SimpleManagedConnection(java.util.Properties env, java.lang.String userName)
           
 
Method Summary
protected  void closeConnection()
          This method is invoked by the pool to notify the specialized class that the connection is to be terminated.
protected  void openConnection()
          This method is invoked by the pool to notify the specialized class that the connection is to be established.
protected  void performCommit()
          Make all changes made since the previous commit/rollback permanent, and release any data source locks currently held by the Connection.
protected  void performRollback()
          Make all changes made since the previous commit/rollback permanent, and release any data source locks currently held by the Connection.
protected  void prepareForRead()
          Prepare this connection for read-only transactions.
protected  void prepareForWrite()
          Prepare this connection for write transactions.
 
Methods inherited from class com.metamatrix.common.connection.ManagedConnection
close, commit, finalize, getEnvironment, getStats, getUserName, open, rollback, setForRead, setForWrite, setUserName
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleManagedConnection

public SimpleManagedConnection(java.util.Properties env)
Create a new instance of a connection.

Parameters:
env - the environment properties for the new connection.

SimpleManagedConnection

public SimpleManagedConnection(java.util.Properties env,
                               java.lang.String userName)
Method Detail

openConnection

protected void openConnection()
This method is invoked by the pool to notify the specialized class that the connection is to be established. This method is implemented as a no-op.

Specified by:
openConnection in class ManagedConnection
Throws:
ManagedConnectionException - if there is an error establishing the connection.

closeConnection

protected void closeConnection()
This method is invoked by the pool to notify the specialized class that the connection is to be terminated. This method is implemented as a no-op.

Specified by:
closeConnection in class ManagedConnection
Throws:
ManagedConnectionException - if there is an error terminating the connection.

prepareForRead

protected void prepareForRead()
Prepare this connection for read-only transactions. This method is implemented as a no-op.

Specified by:
prepareForRead in class ManagedConnection
Throws:
ManagedConnectionException - if an error occurred within or during communication with this connection.

prepareForWrite

protected void prepareForWrite()
Prepare this connection for write transactions. This method is implemented as a no-op.

Specified by:
prepareForWrite in class ManagedConnection
Throws:
ManagedConnectionException - if an error occurred within or during communication with this connection.

performCommit

protected void performCommit()
Make all changes made since the previous commit/rollback permanent, and release any data source locks currently held by the Connection. This method is implemented as a no-op.

Specified by:
performCommit in class ManagedConnection
Throws:
ManagedConnectionException - if an error occurred within or during communication with this connection.

performRollback

protected void performRollback()
Make all changes made since the previous commit/rollback permanent, and release any data source locks currently held by the Connection. This method is implemented as a no-op.

Specified by:
performRollback in class ManagedConnection
Throws:
ManagedConnectionException - if an error occurred within or during communication with this connection.


Copyright © 2009. All Rights Reserved.