クラス org.objectweb.cjdbc.controller.connection.VariablePoolConnectionManager.RemoveIdleConnectionsThread

すべてのメンバ一覧

説明

Allows to remove idle free connections after the idleTimeout timeout. idleTimeout

作者:
Mathieu Peltier

VariablePoolConnectionManager.java502 行で定義されています。

Public メソッド

void run ()

Protected メソッド

 RemoveIdleConnectionsThread (String pBackendName)

Private 変数

boolean isKilled = false


コンストラクタとデストラクタ

org.objectweb.cjdbc.controller.connection.VariablePoolConnectionManager.RemoveIdleConnectionsThread.RemoveIdleConnectionsThread String  pBackendName  )  [protected]
 

VariablePoolConnectionManager.java506 行で定義されています。

00507 { 00508 super("RemoveIdleConnectionsThread for backend:" + pBackendName); 00509 }


メソッド

void org.objectweb.cjdbc.controller.connection.VariablePoolConnectionManager.RemoveIdleConnectionsThread.run  ) 
 

参照:
java.lang.Runnable#run()
VariablePoolConnectionManager.java514 行で定義されています。

参照先 org.objectweb.cjdbc.controller.connection.VariablePoolConnectionManager.RemoveIdleConnectionsThread.isKilled.

00515 { 00516 long idleTime, releaseTime; 00517 synchronized (this) 00518 { 00519 try 00520 { 00521 while (!isKilled) 00522 { 00523 // the thread is not launched if idleTimeout equals to 0 (the 00524 // connections are never released in this case) 00525 if (freeConnections.isEmpty() 00526 || (freeConnections.size() == minPoolSize)) 00527 { 00528 wait(); 00529 } 00530 00531 Connection c = null; 00532 synchronized (freeConnections) 00533 { 00534 if (releaseTimes.isEmpty()) 00535 continue; // Sanity check 00536 00537 releaseTime = ((Long) releaseTimes.get(0)).longValue(); 00538 idleTime = System.currentTimeMillis() - releaseTime; 00539 00540 if (idleTime >= idleTimeout) 00541 c = (Connection) freeConnections.remove(0); 00542 } 00543 00544 if (c == null) 00545 { // Nothing to free, wait for next deadline 00546 wait(idleTimeout - idleTime); 00547 } 00548 else 00549 { // Free the connection out of the synchronized block 00550 try 00551 { 00552 c.close(); 00553 } 00554 catch (SQLException e) 00555 { 00556 String msg = "An error occured while closing idle connection after the timeout: " 00557 + e; 00558 logger.error(msg); 00559 } 00560 finally 00561 { 00562 releaseTimes.remove(0); 00563 poolSize--; 00564 } 00565 logger.debug("Released idle connection (idle timeout reached)"); 00566 continue; 00567 00568 } 00569 } 00570 } 00571 catch (InterruptedException e) 00572 { 00573 logger 00574 .error("Wait on removeIdleConnectionsThread interrupted in VariablePoolConnectionManager: " 00575 + e); 00576 } 00577 } 00578 }


変数

boolean org.objectweb.cjdbc.controller.connection.VariablePoolConnectionManager.RemoveIdleConnectionsThread.isKilled = false [private]
 

VariablePoolConnectionManager.java504 行で定義されています。

参照元 org.objectweb.cjdbc.controller.connection.VariablePoolConnectionManager.finalizeConnections(), と org.objectweb.cjdbc.controller.connection.VariablePoolConnectionManager.RemoveIdleConnectionsThread.run().


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0.4に対してTue Oct 12 15:16:40 2004に生成されました。 doxygen 1.3.8