org.objectweb.cjdbc.driver
Class ConnectionClosingThread

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.objectweb.cjdbc.driver.ConnectionClosingThread
All Implemented Interfaces:
java.lang.Runnable

public class ConnectionClosingThread
extends java.lang.Thread

The ConnectionClosingThread wakes up every 5 seconds when close() has been called on a connection and it frees the connection if it has not been reused.

Version:
1.0
Author:
Emmanuel Cecchet

Field Summary
private  Driver driver
           
private  java.util.ArrayList pendingConnectionClosing
           
private static int WAIT_TIME
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ConnectionClosingThread(Driver driver)
          Builds a new ConnectionClosingThread
 
Method Summary
private  void closeConnection(Connection c)
          Closes a connection.
 void run()
          The connection closing thread wakes up every WAIT_TIME seconds when close() has been called on a connection and it frees the connection if it has not been reused.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WAIT_TIME

private static final int WAIT_TIME
See Also:
Constant Field Values

driver

private Driver driver

pendingConnectionClosing

private java.util.ArrayList pendingConnectionClosing
Constructor Detail

ConnectionClosingThread

public ConnectionClosingThread(Driver driver)
Builds a new ConnectionClosingThread

Parameters:
driver - The driver that created us
Method Detail

run

public void run()
The connection closing thread wakes up every WAIT_TIME seconds when close() has been called on a connection and it frees the connection if it has not been reused.


closeConnection

private void closeConnection(Connection c)
Closes a connection. This cleanup should belong to the underlying class.

Parameters:
c - the connection to close


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.