クラス org.objectweb.cjdbc.controller.connection.FailFastPoolConnectionManager

org.objectweb.cjdbc.controller.connection.FailFastPoolConnectionManagerに対する継承グラフ

Inheritance graph
[凡例]
org.objectweb.cjdbc.controller.connection.FailFastPoolConnectionManagerのコラボレーション図

Collaboration graph
[凡例]
すべてのメンバ一覧

説明

This connection manager returns null when the pool is empty. Therefore all requests fail fast until connections are freed.

作者:
Emmanuel Cecchet

Nicolas Modrzyk

バージョン:
1.0

FailFastPoolConnectionManager.java43 行で定義されています。

Public メソッド

 FailFastPoolConnectionManager (String backendUrl, String backendName, String login, String password, String driverPath, String driverClassName, int poolSize)
Connection getConnection () throws UnreachableBackendException
synchronized void releaseConnection (Connection c)
synchronized void deleteConnection (Connection c)
String getXmlImpl ()

Protected メソッド

Object clone () throws CloneNotSupportedException


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

org.objectweb.cjdbc.controller.connection.FailFastPoolConnectionManager.FailFastPoolConnectionManager String  backendUrl,
String  backendName,
String  login,
String  password,
String  driverPath,
String  driverClassName,
int  poolSize
 

Creates a new FailFastPoolConnectionManager instance.

引数:
backendUrl URL of the DatabaseBackend owning this connection manager
backendName name of the DatabaseBackend owning this connection manager
login backend connection login to be used by this connection manager
password backend connection password to be used by this connection manager
driverPath path for driver
driverClassName class name for driver
poolSize size of the connection pool
FailFastPoolConnectionManager.java63 行で定義されています。
00066 { 00067 super(backendUrl, backendName, login, password, driverPath, 00068 driverClassName, poolSize); 00069 }


メソッド

Object org.objectweb.cjdbc.controller.connection.FailFastPoolConnectionManager.clone  )  throws CloneNotSupportedException [protected, virtual]
 

参照:
java.lang.Object#clone()

org.objectweb.cjdbc.controller.connection.AbstractConnectionManagerを実装しています.

FailFastPoolConnectionManager.java196 行で定義されています。

00197 { 00198 return new FailFastPoolConnectionManager(backendUrl, backendName, rLogin, 00199 rPassword, driverPath, driverClassName, poolSize); 00200 }

synchronized void org.objectweb.cjdbc.controller.connection.FailFastPoolConnectionManager.deleteConnection Connection  c  )  [virtual]
 

参照:
org.objectweb.cjdbc.controller.connection.AbstractPoolConnectionManager.deleteConnection(Connection)

org.objectweb.cjdbc.controller.connection.AbstractConnectionManagerを実装しています.

FailFastPoolConnectionManager.java155 行で定義されています。

00156 { 00157 if (!initialized) 00158 return; // We probably have been disabled 00159 00160 if (activeConnections.remove(c)) 00161 { 00162 Connection newConnection = getConnectionFromDriver(); 00163 if (newConnection == null) 00164 { 00165 if (logger.isDebugEnabled()) 00166 logger.error(Translate 00167 .get("connection.replaced.failed", c.toString())); 00168 } 00169 else 00170 { 00171 freeConnections.push(newConnection); 00172 if (logger.isDebugEnabled()) 00173 logger.debug(Translate.get("connection.replaced.success", c 00174 .toString())); 00175 } 00176 } 00177 else 00178 logger.error(Translate.get("connection.replaced.failed.exception", c 00179 .toString())); 00180 }

Connection org.objectweb.cjdbc.controller.connection.FailFastPoolConnectionManager.getConnection  )  throws UnreachableBackendException [virtual]
 

Gets a connection from the pool. Returns null if the pool is empty.

戻り値:
a connection from the pool or null if the pool is exhausted
例外:
UnreachableBackendException if the backend must be disabled
参照:
org.objectweb.cjdbc.controller.connection.AbstractConnectionManager.getConnection()

org.objectweb.cjdbc.controller.connection.AbstractConnectionManagerを実装しています.

FailFastPoolConnectionManager.java80 行で定義されています。

参照先 org.objectweb.cjdbc.common.log.Trace.error(), org.objectweb.cjdbc.controller.connection.AbstractConnectionManager.getConnectionFromDriver(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isWarnEnabled(), と org.objectweb.cjdbc.common.log.Trace.warn().

00081 { 00082 if (!initialized) 00083 { 00084 logger.error(Translate.get("connection.request.not.initialized")); 00085 return null; 00086 } 00087 00088 try 00089 { // Both freeConnections and activeConnections are synchronized 00090 Connection c = (Connection) freeConnections.pop(); 00091 activeConnections.add(c); 00092 return c; 00093 } 00094 catch (EmptyStackException e) 00095 { 00096 synchronized (this) 00097 { 00098 int missing = poolSize 00099 - (activeConnections.size() + freeConnections.size()); 00100 if (missing > 0) 00101 { // Re-allocate missing connections 00102 logger.info(Translate.get("connection.reallocate.missing", missing)); 00103 Connection connectionToBeReturned = null; 00104 while (missing > 0) 00105 { 00106 Connection c = getConnectionFromDriver(); 00107 if (c == null) 00108 { 00109 if (missing == poolSize) 00110 { 00111 logger.error(Translate.get("connection.backend.unreachable", 00112 backendName)); 00113 throw new UnreachableBackendException(); 00114 } 00115 logger.warn(Translate 00116 .get("connection.reallocate.failed", missing)); 00117 break; 00118 } 00119 else 00120 { 00121 if (connectionToBeReturned == null) 00122 connectionToBeReturned = c; 00123 else 00124 freeConnections.add(c); 00125 } 00126 missing--; 00127 } 00128 return connectionToBeReturned; 00129 } 00130 } 00131 if (logger.isWarnEnabled()) 00132 logger.warn(Translate.get("connection.backend.out.of.connections", 00133 new String[]{backendName, String.valueOf(poolSize)})); 00134 return null; 00135 } 00136 }

String org.objectweb.cjdbc.controller.connection.FailFastPoolConnectionManager.getXmlImpl  )  [virtual]
 

参照:
org.objectweb.cjdbc.controller.connection.AbstractConnectionManager.getXmlImpl()

org.objectweb.cjdbc.controller.connection.AbstractConnectionManagerを実装しています.

FailFastPoolConnectionManager.java185 行で定義されています。

00186 { 00187 StringBuffer info = new StringBuffer(); 00188 info.append("<" + DatabasesXmlTags.ELT_FailFastPoolConnectionManager + " " 00189 + DatabasesXmlTags.ATT_poolSize + "=\"" + poolSize / 1000 + "\"/>"); 00190 return info.toString(); 00191 }

synchronized void org.objectweb.cjdbc.controller.connection.FailFastPoolConnectionManager.releaseConnection Connection  c  )  [virtual]
 

参照:
org.objectweb.cjdbc.controller.connection.AbstractPoolConnectionManager.releaseConnection(Connection)

org.objectweb.cjdbc.controller.connection.AbstractConnectionManagerを実装しています.

FailFastPoolConnectionManager.java141 行で定義されています。

00142 { 00143 if (!initialized) 00144 return; // We probably have been disabled 00145 00146 if (activeConnections.remove(c)) 00147 freeConnections.push(c); 00148 else 00149 logger.error(Translate.get("connection.release.failed", c.toString())); 00150 }


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