Class BaseProxyHandlerClass

java.lang.Object
bitronix.tm.resource.jdbc.BaseProxyHandlerClass
All Implemented Interfaces:
InvocationHandler
Direct Known Subclasses:
JdbcCallableStatementHandle, JdbcConnectionHandle, JdbcPreparedStatementHandle, JdbcResultSetHandle, JdbcStatementHandle, JdbcUncachedPreparedStatementHandle, LrcConnectionHandle, LrcXAConnection

public abstract class BaseProxyHandlerClass extends Object implements InvocationHandler
Base class for Proxy InvocationHandlers. Maintains a method cache for swift delegation to either the overridden methods (implemented in a sub-class of this class) or the underlying delegate class' methods. Makes proxying an interface almost completely painless.

Author:
brettw
  • Constructor Details

    • BaseProxyHandlerClass

      public BaseProxyHandlerClass()
  • Method Details

    • invoke

      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
      Implementation of the InvocationHandler interface.
      Specified by:
      invoke in interface InvocationHandler
      Throws:
      Throwable
      See Also:
    • getProxiedDelegate

      public abstract Object getProxiedDelegate() throws Exception
      Must be implemented by the sub-class of this class. This method should return the "true" object to be delegated to in the case that the method is not overridden by the sub-class.
      Returns:
      the true delegate object
      Throws:
      Exception - can throw any exception if desired