Java 类com.zaxxer.hikari.proxy.ConnectionProxy 实例源码

项目:HikariCP    文件:HikariPool.java   
/**
 * Fill the pool up to the minimum size.
 */
private void initializeConnections()
{
   if (config.isInitializationFailFast()) {
      try {
         if (!addConnection()) {
            throw lastConnectionFailure.getAndSet(null);
         }

         ConnectionProxy connection = (ConnectionProxy) getConnection();
         connection.getPoolBagEntry().evict = (config.getMinimumIdle() == 0);
         connection.close();
      }
      catch (Throwable e) {
         try {
            shutdown();
         }
         catch (Throwable ex) {
            e.addSuppressed(ex);
         }

         throw new PoolInitializationException(e);
      }
   }

   fillPool();
}
项目:HikariCP    文件:TestElf.java   
public static boolean getConnectionCommitDirtyState(Connection connection)
{
   try {
      Field field = ConnectionProxy.class.getDeclaredField("isCommitStateDirty");
      field.setAccessible(true);
      return field.getBoolean(connection);
   }
   catch (Exception e) {
      throw new RuntimeException(e);
   }      
}
项目:pedal-dialect    文件:HikariConnectionAccessor.java   
/**
 * @see com.eclecticlogic.pedal.connection.ConnectionAccessor#getRawConnection(java.sql.Connection)
 */
@Override
public Connection getRawConnection(Connection providerConnection) {
    try {
        return ((ConnectionProxy) providerConnection).unwrap(Connection.class);
    } catch (SQLException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
}
项目:pedal-dialect    文件:HikariConnectionAccessor.java   
/**
 * @see com.eclecticlogic.pedal.connection.ConnectionAccessor#getRawConnection(java.sql.Connection)
 */
@Override
public Connection getRawConnection(Connection providerConnection) {
    try {
        return ((ConnectionProxy) providerConnection).unwrap(Connection.class);
    } catch (SQLException e) {
        throw new RuntimeException(e.getMessage(), e);
    }
}
项目:cl4pg    文件:HikariCpDataSourceAdapter.java   
@Override
public PGConnection unwrapPgConnection(Connection conn) throws SQLException {
    ConnectionProxy proxy = (ConnectionProxy) conn;
    return proxy.<PGConnection> unwrap(PGConnection.class);
}
项目:pinpoint    文件:HikariCpIT.java   
@BeforeClass
public static void setUp() throws NoSuchMethodException {
    getConnectionMethod1 = HikariDataSource.class.getDeclaredMethod("getConnection");
    getConnectionMethod2 = HikariDataSource.class.getDeclaredMethod("getConnection", String.class, String.class);
    proxyConnectionMethod = ConnectionProxy.class.getDeclaredMethod("close");
}