FileDocCategorySizeDatePackage
ConnectionProxyHandler.javaAPI DocGlassfish v2 API3393Tue May 22 16:54:24 BST 2007oracle.toplink.essentials.internal.ejb.cmp3.jdbc.base

ConnectionProxyHandler

public class ConnectionProxyHandler extends Object implements InvocationHandler
A simple invocation handler for the proxied connection. Connections are proxied only when they are obtained from a transactional data source and within the context of a JTA transaction.

Fields Summary
Connection
connection
Constructors Summary
public ConnectionProxyHandler(Connection connection)
/ private void debug(String s) { System.out.println(s); } /* Use this constructor

        this.connection = connection;
    
Methods Summary
public java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
/ /* Gateway for method interception

        String methodName = method.getName();
        debug("PROXY method: " + methodName);
        // No-op if any of the following calls
        if (methodName.equals("close") || methodName.equals("commit") || methodName.equals("rollback")) {
            return null;
        }

        // Normal case is just to forward on to the real connection
        return method.invoke(connection, args);