Interface UnWrapper

  • All Known Implementing Classes:
    DBCPUnWrapper, LifecycleConnectionUnWrapper

    public interface UnWrapper
    Generic Connection unwrapper. A user can test if the unwrapper is able to unwrap a certain connection, on positive answer he can call unwrap(Connection) to get the native connection
    Author:
    Andrea Aime - TOPP
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canUnwrap​(Connection conn)
      Returns true if this unwrapper knows how to unwrap the specified connection
      boolean canUnwrap​(Statement st)
      Returns tru if this unwrapper knows how to unwrap the specified statement
      Connection unwrap​(Connection conn)
      Returns the unwrapped connection, of throws IllegalArgumentException if the passed Connection is not supported (canUnwrap(Connection) returns false}.
      Statement unwrap​(Statement statement)
      Returns the unwrapped statement, of throws IllegalArgumentException if the passed Statement is not supported (canUnwrap(Statement) returns false}.
    • Method Detail

      • canUnwrap

        boolean canUnwrap​(Connection conn)
        Returns true if this unwrapper knows how to unwrap the specified connection
      • canUnwrap

        boolean canUnwrap​(Statement st)
        Returns tru if this unwrapper knows how to unwrap the specified statement
      • unwrap

        Connection unwrap​(Connection conn)
        Returns the unwrapped connection, of throws IllegalArgumentException if the passed Connection is not supported (canUnwrap(Connection) returns false}.
      • unwrap

        Statement unwrap​(Statement statement)
        Returns the unwrapped statement, of throws IllegalArgumentException if the passed Statement is not supported (canUnwrap(Statement) returns false}.