remove unused @Internal methods
This commit is contained in:
parent
a6996ee2d8
commit
77fe5fe445
|
@ -74,11 +74,11 @@ public class C3P0ConnectionProvider
|
|||
private static final String C3P0_STYLE_MAX_STATEMENTS = "c3p0.maxStatements";
|
||||
private static final String C3P0_STYLE_ACQUIRE_INCREMENT = "c3p0.acquireIncrement";
|
||||
private static final String C3P0_STYLE_IDLE_CONNECTION_TEST_PERIOD = "c3p0.idleConnectionTestPeriod";
|
||||
|
||||
//swaldman 2006-08-28: define c3p0-style configuration parameters for initialPoolSize, which
|
||||
// hibernate sensibly lets default to minPoolSize, but we'll let users
|
||||
// override it with the c3p0-style property if they want.
|
||||
//swaldman 2006-08-28: define c3p0-style configuration parameters for initialPoolSize,
|
||||
// which hibernate sensibly lets default to minPoolSize, but we'll
|
||||
// let users override it with the c3p0-style property if they want.
|
||||
private static final String C3P0_STYLE_INITIAL_POOL_SIZE = "c3p0.initialPoolSize";
|
||||
|
||||
private DataSource dataSource;
|
||||
private Integer isolation;
|
||||
private boolean autocommit;
|
||||
|
@ -161,7 +161,7 @@ public class C3P0ConnectionProvider
|
|||
jdbcDriverClass,
|
||||
dialect.getVersion(),
|
||||
Boolean.toString( autocommit ),
|
||||
isolation != null ? ConnectionProviderInitiator.toIsolationNiceName( isolation ) : null,
|
||||
isolation == null ? null : ConnectionProviderInitiator.toIsolationNiceName( isolation ),
|
||||
requireNonNullElse( getInteger( C3P0_STYLE_MIN_POOL_SIZE.substring( 5 ), poolSettings ),
|
||||
DEFAULT_MIN_POOL_SIZE ),
|
||||
requireNonNullElse( getInteger( C3P0_STYLE_MAX_POOL_SIZE.substring( 5 ), poolSettings ),
|
||||
|
|
|
@ -21,7 +21,6 @@ import java.util.concurrent.locks.ReadWriteLock;
|
|||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.Internal;
|
||||
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
|
||||
import org.hibernate.cfg.AvailableSettings;
|
||||
import org.hibernate.dialect.Database;
|
||||
|
@ -338,7 +337,6 @@ public class DriverManagerConnectionProviderImpl
|
|||
}
|
||||
}
|
||||
|
||||
//CHECKSTYLE:START_ALLOW_FINALIZER
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
if ( state != null ) {
|
||||
|
@ -346,26 +344,12 @@ public class DriverManagerConnectionProviderImpl
|
|||
}
|
||||
super.finalize();
|
||||
}
|
||||
//CHECKSTYLE:END_ALLOW_FINALIZER
|
||||
|
||||
/**
|
||||
* Exposed to facilitate testing only.
|
||||
*/
|
||||
public Properties getConnectionProperties() {
|
||||
BasicConnectionCreator connectionCreator = (BasicConnectionCreator) this.state.pool.connectionCreator;
|
||||
return connectionCreator.getConnectionProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(Connection connection) throws SQLException {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Internal
|
||||
public void releasePooledConnections() {
|
||||
state.pool.releasePooledConnections();
|
||||
}
|
||||
|
||||
public static class PooledConnections {
|
||||
|
||||
private final ConcurrentLinkedQueue<Connection> allConnections = new ConcurrentLinkedQueue<>();
|
||||
|
@ -438,7 +422,7 @@ public class DriverManagerConnectionProviderImpl
|
|||
return null;
|
||||
}
|
||||
|
||||
public Connection poll() throws SQLException {
|
||||
public Connection poll() {
|
||||
Connection conn;
|
||||
do {
|
||||
conn = availableConnections.poll();
|
||||
|
@ -526,13 +510,6 @@ public class DriverManagerConnectionProviderImpl
|
|||
return connectionCreator.getUrl();
|
||||
}
|
||||
|
||||
@Internal
|
||||
public void releasePooledConnections() {
|
||||
for ( Connection connection : allConnections ) {
|
||||
closeConnection( connection, null );
|
||||
}
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private final ConnectionCreator connectionCreator;
|
||||
private ConnectionValidator connectionValidator;
|
||||
|
@ -641,7 +618,7 @@ public class DriverManagerConnectionProviderImpl
|
|||
}
|
||||
}
|
||||
|
||||
public Connection getConnection() throws SQLException {
|
||||
public Connection getConnection() {
|
||||
startIfNeeded();
|
||||
statelock.readLock().lock();
|
||||
try {
|
||||
|
@ -704,7 +681,6 @@ public class DriverManagerConnectionProviderImpl
|
|||
}
|
||||
|
||||
private static class ValidationThreadFactory implements ThreadFactory {
|
||||
|
||||
@Override
|
||||
public Thread newThread(Runnable runnable) {
|
||||
Thread thread = new Thread( runnable );
|
||||
|
|
Loading…
Reference in New Issue