org.springframework.jdbc.datasource
Class LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler

java.lang.Object
  extended by org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler
All Implemented Interfaces:
java.lang.reflect.InvocationHandler
Enclosing class:
LazyConnectionDataSourceProxy

private class LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

Invocation handler that defers fetching an actual JDBC Connection until first creation of a Statement.


Field Summary
private  java.lang.Boolean autoCommit
           
private  boolean closed
           
private  java.lang.String password
           
private  java.lang.Boolean readOnly
           
private  java.sql.Connection target
           
private  java.lang.Integer transactionIsolation
           
private  java.lang.String username
           
 
Constructor Summary
LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler()
           
LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler(java.lang.String username, java.lang.String password)
           
 
Method Summary
private  java.sql.Connection getTargetConnection(java.lang.reflect.Method operation)
          Return the target Connection, fetching it and initializing it if necessary.
private  boolean hasTargetConnection()
          Return whether the proxy currently holds a target Connection.
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

username

private java.lang.String username

password

private java.lang.String password

readOnly

private java.lang.Boolean readOnly

transactionIsolation

private java.lang.Integer transactionIsolation

autoCommit

private java.lang.Boolean autoCommit

closed

private boolean closed

target

private java.sql.Connection target
Constructor Detail

LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler

public LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler()

LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler

public LazyConnectionDataSourceProxy.LazyConnectionInvocationHandler(java.lang.String username,
                                                                     java.lang.String password)
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

hasTargetConnection

private boolean hasTargetConnection()
Return whether the proxy currently holds a target Connection.


getTargetConnection

private java.sql.Connection getTargetConnection(java.lang.reflect.Method operation)
                                         throws java.sql.SQLException
Return the target Connection, fetching it and initializing it if necessary.

Throws:
java.sql.SQLException