StatementDecoratorInterceptor.StatementProxy (Apache Tomcat 11.0.23 API Documentation)
Description: declaration: package: org.apache.tomcat.jdbc.pool.interceptor, class: StatementDecoratorInterceptor, class: StatementProxy

# Class StatementDecoratorInterceptor.StatementProxy<T extends Statement>

java.lang.Object
org.apache.tomcat.jdbc.pool.interceptor.StatementDecoratorInterceptor.StatementProxy<T>

Type Parameters:
  `T` - The type of Statement being proxied.

All Implemented Interfaces:
  `InvocationHandler`

Direct Known Subclasses:
  `StatementCache.CachedStatement`

Enclosing class:
  `StatementDecoratorInterceptor`

protected class StatementDecoratorInterceptor.StatementProxy<T extends Statement> extends Object implements InvocationHandler
Class to measure query execute time.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected boolean`
  `closed`
  Indicates whether this statement has been closed.
  `protected T`
  `delegate`
  The delegated statement.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StatementProxy(T delegate, String sql)`
  Constructs a StatementProxy.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `closeInvoked()`
  Called when the close method is invoked on the statement.
  `Object`
  `getActualProxy()`
  Returns the actual proxy object.
  `Object`
  `getConnection()`
  Returns the connection proxy.
  `Constructor<?>`
  `getConstructor()`
  Returns the constructor used to create this proxy.
  `T`
  `getDelegate()`
  Returns the delegated statement.
  `String`
  `getSql()`
  Returns the SQL text.
  `Object`
  `invoke(Object proxy, Method method, Object[] args)`
  `void`
  `setActualProxy(Object proxy)`
  Sets the actual proxy object.
  `void`
  `setConnection(Object proxy)`
  Sets the connection proxy.
  `void`
  `setConstructor(Constructor<?> constructor)`
  Sets the constructor for creating proxies.
  `String`
  `toString()`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### closed

    protected boolean closed
    Indicates whether this statement has been closed.

  - ### delegate

    protected T extends Statement delegate
    The delegated statement.

- ## Constructor Details

  - ### StatementProxy

    public StatementProxy(T delegate, String sql)
    Constructs a StatementProxy.
    Parameters:
      `delegate` - the statement to delegate to
      `sql` - the SQL text

- ## Method Details

  - ### getDelegate

    public T getDelegate()
    Returns the delegated statement.
    Returns:
      the delegated statement

  - ### getSql

    public String getSql()
    Returns the SQL text.
    Returns:
      the SQL text

  - ### setConnection

    public void setConnection(Object proxy)
    Sets the connection proxy.
    Parameters:
      `proxy` - the connection proxy

  - ### getConnection

    public Object getConnection()
    Returns the connection proxy.
    Returns:
      the connection proxy

  - ### setActualProxy

    public void setActualProxy(Object proxy)
    Sets the actual proxy object.
    Parameters:
      `proxy` - the actual proxy

  - ### getActualProxy

    public Object getActualProxy()
    Returns the actual proxy object.
    Returns:
      the actual proxy

  - ### getConstructor

    public Constructor<?> getConstructor()
    Returns the constructor used to create this proxy.
    Returns:
      the constructor

  - ### setConstructor

    public void setConstructor(Constructor<?> constructor)
    Sets the constructor for creating proxies.
    Parameters:
      `constructor` - the constructor

  - ### closeInvoked

    public void closeInvoked()
    Called when the close method is invoked on the statement.

  - ### invoke

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

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`