static void createFunctions(Connection cx) throws SQLException { while (cx instanceof DelegatingConnection) { cx = ((DelegatingConnection) cx).getDelegate();
/** * If my underlying {@link Connection} is not a * <tt>DelegatingConnection</tt>, returns it, * otherwise recursively invokes this method on * my delegate. * <p> * Hence this method will return the first * delegate that is not a <tt>DelegatingConnection</tt>, * or <tt>null</tt> when no non-<tt>DelegatingConnection</tt> * delegate can be found by transversing this chain. * <p> * This method is useful when you may have nested * <tt>DelegatingConnection</tt>s, and you want to make * sure to obtain a "genuine" {@link Connection}. */ public Connection getInnermostDelegate() { Connection c = _conn; while(c != null && c instanceof DelegatingConnection) { c = ((DelegatingConnection)c).getDelegate(); if(this == c) { return null; } } return c; }
/** * Unregisters a destroyed connection from {@link TransactionRegistry} * @param connection */ public synchronized void unregisterConnection(Connection connection) { Connection lConnection = connection; if (connection instanceof DelegatingConnection) { lConnection = ((DelegatingConnection) connection).getDelegate(); } xaResources.remove(lConnection); } }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getDelegate() */ public Connection getDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getDelegate(); } else { return null; } }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getDelegate() */ public Connection getDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getDelegate(); } else { return null; } }
/** * Gets the XAResource registered for the connection. * @param connection the connection * @return the XAResource registered for the connection; never null * @throws SQLException if the connection does not have a registered XAResource */ public synchronized XAResource getXAResource(Connection connection) throws SQLException { if (connection == null) throw new NullPointerException("connection is null"); Connection lConnection = connection; if (connection instanceof DelegatingConnection) { lConnection = ((DelegatingConnection) connection).getDelegate(); } XAResource xaResource = (XAResource) xaResources.get(lConnection); if (xaResource == null) { throw new SQLException("Connection does not have a registered XAResource " + connection); } return xaResource; }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getDelegate() */ public Connection getDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getDelegate(); } else { return null; } }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getDelegate() */ public Connection getDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getDelegate(); } else { return null; } }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getDelegate() */ public Connection getDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getDelegate(); } else { return null; } }
/** * @see org.apache.commons.dbcp.DelegatingConnection#getDelegate() */ public Connection getDelegate() { if (isAccessToUnderlyingConnectionAllowed()) { return super.getDelegate(); } else { return null; } }
public void invalidate( DelegatingConnection conn ) throws Exception { conn.getDelegate().close(); pool.invalidateObject( conn ); } }
static void createFunctions(Connection cx) throws SQLException { while (cx instanceof DelegatingConnection) { cx = ((DelegatingConnection) cx).getDelegate();