Class PGPooledConnection.ConnectionHandler

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler
    Enclosing class:
    PGPooledConnection

    private class PGPooledConnection.ConnectionHandler
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    Instead of declaring a class implementing Connection, which would have to be updated for every JDK rev, use a dynamic proxy to handle all calls through the Connection interface. This is the part that requires JDK 1.3 or higher, though JDK 1.2 could be supported with a 3rd-party proxy package.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean automatic  
      private java.sql.Connection con  
      private java.sql.Connection proxy  
    • Constructor Summary

      Constructors 
      Constructor Description
      ConnectionHandler​(java.sql.Connection con)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      (package private) java.sql.Connection getProxy()  
      java.lang.Object invoke​(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)  
      boolean isClosed()  
      (package private) void setProxy​(java.sql.Connection proxy)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • con

        private java.sql.Connection con
      • proxy

        private java.sql.Connection proxy
      • automatic

        private boolean automatic
    • Constructor Detail

      • ConnectionHandler

        ConnectionHandler​(java.sql.Connection con)
    • Method Detail

      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable
      • getProxy

        java.sql.Connection getProxy()
      • setProxy

        void setProxy​(java.sql.Connection proxy)
      • close

        public void close()
      • isClosed

        public boolean isClosed()