com.atlassian.confluence.util.db
Class LatencyConnectionProvider
java.lang.Object
com.atlassian.confluence.util.db.LatencyConnectionProvider
- All Implemented Interfaces:
- net.sf.hibernate.connection.ConnectionProvider
public final class LatencyConnectionProvider
- extends Object
- implements net.sf.hibernate.connection.ConnectionProvider
A hibernate connection provider that can be configured to return connections that impose a simulated latency on
db operations.
The desired latency may be configured via the latency.connection.latency.ms property.
*NOTE:* This class was refactored to use a dynamic proxy in an attempt to be backwards
compatible even when Sun decide to change the API for these fundamental JDBC classes. It's
designed to only be used for test environements.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LatencyConnectionProvider
public LatencyConnectionProvider()
configure
public void configure(Properties properties)
throws net.sf.hibernate.HibernateException
- Specified by:
configure
in interface net.sf.hibernate.connection.ConnectionProvider
- Throws:
net.sf.hibernate.HibernateException
getConnection
public Connection getConnection()
throws SQLException
- Specified by:
getConnection
in interface net.sf.hibernate.connection.ConnectionProvider
- Throws:
SQLException
closeConnection
public void closeConnection(Connection connection)
throws SQLException
- Specified by:
closeConnection
in interface net.sf.hibernate.connection.ConnectionProvider
- Throws:
SQLException
close
public void close()
throws net.sf.hibernate.HibernateException
- Specified by:
close
in interface net.sf.hibernate.connection.ConnectionProvider
- Throws:
net.sf.hibernate.HibernateException