|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.logicalcobwebs.proxool.ProxyFactory
class ProxyFactory
A central place to build proxy objects. It will also provide the original object given a proxy.
| Field Summary | |
|---|---|
private static java.util.Map |
interfaceMap
|
private static Log |
LOG
|
| Constructor Summary | |
|---|---|
ProxyFactory()
|
|
| Method Summary | |
|---|---|
protected static java.sql.DatabaseMetaData |
getDatabaseMetaData(java.sql.DatabaseMetaData databaseMetaData,
java.sql.Connection wrappedConnection)
Create a new DatabaseMetaData from a connection |
protected static java.sql.Connection |
getDelegateConnection(java.sql.Connection connection)
Gets the real Connection that we got from the delegate driver. |
protected static java.sql.Statement |
getDelegateStatement(java.sql.Statement statement)
Gets the real Statement that we got from the delegate driver. |
private static java.lang.Class[] |
getInterfaces(java.lang.Class clazz,
ConnectionPoolDefinitionIF cpd)
Get all the interfaces that a class implements. |
private static java.lang.Object |
getProxy(java.lang.Object delegate,
Callback callback,
ConnectionPoolDefinitionIF def)
|
protected static java.sql.Statement |
getStatement(java.sql.Statement delegate,
ConnectionPool connectionPool,
ProxyConnectionIF proxyConnection,
java.lang.String sqlStatement)
Proxies a statement inside a ProxyStatement. |
static WrappedConnection |
getWrappedConnection(java.sql.Connection connection)
Get the WrappedConnection behind this proxy connection. |
protected static java.sql.Connection |
getWrappedConnection(ProxyConnection proxyConnection)
Wraps up a proxyConnection inside a WrappedConnection and then proxies it as a
simple Connection. |
private static void |
traverseInterfacesRecursively(java.util.Set interfaces,
java.lang.Class clazz)
Recursively looks at all interfaces for a class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Log LOG
private static java.util.Map interfaceMap
| Constructor Detail |
|---|
ProxyFactory()
| Method Detail |
|---|
protected static java.sql.Connection getWrappedConnection(ProxyConnection proxyConnection)
WrappedConnection and then proxies it as a
simple Connection. You should call this immediately before the connection is served
to the user. The WrappedConnection is disposable (it is thrown away when the connection
is returned to the pool).
proxyConnection - the pooled connection we are wrapping up
protected static java.sql.Statement getStatement(java.sql.Statement delegate,
ConnectionPool connectionPool,
ProxyConnectionIF proxyConnection,
java.lang.String sqlStatement)
ProxyStatement.
delegate - the real statementconnectionPool - the pool it belongs toproxyConnection - the connection it was built fromsqlStatement - Can be null?
protected static java.sql.DatabaseMetaData getDatabaseMetaData(java.sql.DatabaseMetaData databaseMetaData,
java.sql.Connection wrappedConnection)
databaseMetaData - the meta data we use to delegate all calls to (except getConnection())wrappedConnection - the connection we return if asked for the connection
private static java.lang.Object getProxy(java.lang.Object delegate,
Callback callback,
ConnectionPoolDefinitionIF def)
protected static java.sql.Statement getDelegateStatement(java.sql.Statement statement)
statement - proxy statement
ProxoolFacade.getDelegateStatement(java.sql.Statement)protected static java.sql.Connection getDelegateConnection(java.sql.Connection connection)
connection - proxy connection
ProxoolFacade.getDelegateConnection(java.sql.Connection)
private static java.lang.Class[] getInterfaces(java.lang.Class clazz,
ConnectionPoolDefinitionIF cpd)
clazz - the class to examine.
private static void traverseInterfacesRecursively(java.util.Set interfaces,
java.lang.Class clazz)
interfaces - this set is populated with all interfaceMap it findsclazz - the base class to analyzepublic static WrappedConnection getWrappedConnection(java.sql.Connection connection)
connection - the connection that was served
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||