Public Member Functions | |
SimpleConnectionManager (String backendUrl, String backendName, String login, String password, String driverPath, String driverClassName) | |
void | initializeConnections () throws SQLException |
void | finalizeConnections () throws SQLException |
Connection | getConnection () throws UnreachableBackendException |
void | releaseConnection (Connection connection) |
void | deleteConnection (Connection c) |
int | getCurrentNumberOfConnections () |
String | getXmlImpl () |
Protected Member Functions | |
Object | clone () throws CloneNotSupportedException |
Connection
every time the getConnectionmethod is called.
Definition at line 42 of file SimpleConnectionManager.java.
|
Creates a new
Definition at line 62 of file SimpleConnectionManager.java. Referenced by org.objectweb.cjdbc.controller.connection.SimpleConnectionManager.clone(). 00064 { 00065 super(backendUrl, backendName, login, password, driverPath, driverClassName); 00066 }
|
|
Implements org.objectweb.cjdbc.controller.connection.AbstractConnectionManager. Definition at line 71 of file SimpleConnectionManager.java. References org.objectweb.cjdbc.controller.connection.SimpleConnectionManager.SimpleConnectionManager(). 00072 { 00073 return new SimpleConnectionManager(backendUrl, backendName, rLogin, 00074 rPassword, driverPath, driverClassName); 00075 }
|
|
Implements org.objectweb.cjdbc.controller.connection.AbstractConnectionManager. Definition at line 148 of file SimpleConnectionManager.java. 00149 { 00150 }
|
|
Does nothing.
Implements org.objectweb.cjdbc.controller.connection.AbstractConnectionManager. Definition at line 92 of file SimpleConnectionManager.java. 00093 { 00094 initialized = false; 00095 }
|
|
Gets a new connection from the underlying driver.
Implements org.objectweb.cjdbc.controller.connection.AbstractConnectionManager. Definition at line 102 of file SimpleConnectionManager.java. References org.objectweb.cjdbc.common.log.Trace.error(), and org.objectweb.cjdbc.controller.connection.AbstractConnectionManager.getConnectionFromDriver(). 00103 { 00104 if (!initialized) 00105 { 00106 logger 00107 .error("Requesting a connection from a non-initialized connection manager"); 00108 return null; 00109 } 00110 00111 addConnection(); 00112 Connection c = getConnectionFromDriver(); 00113 if (c == null) 00114 { 00115 removeConnection(); 00116 logger.error("Unable to get connection from " + backendUrl); 00117 if (nbOfConnections == 0) 00118 { 00119 logger.error("Backend '" + backendUrl + "' is considered unreachable. " 00120 + "(No active connection and none can be opened)"); 00121 throw new UnreachableBackendException(); 00122 } 00123 } 00124 return c; 00125 }
|
|
Implements org.objectweb.cjdbc.controller.connection.AbstractConnectionManager. Definition at line 155 of file SimpleConnectionManager.java. 00156 {
00157 return nbOfConnections;
00158 }
|
|
Implements org.objectweb.cjdbc.controller.connection.AbstractConnectionManager. Definition at line 173 of file SimpleConnectionManager.java. 00174 { 00175 return "<" + DatabasesXmlTags.ELT_SimpleConnectionManager + "/>"; 00176 }
|
|
Does nothing.
Implements org.objectweb.cjdbc.controller.connection.AbstractConnectionManager. Definition at line 82 of file SimpleConnectionManager.java. 00083 { 00084 initialized = true; 00085 }
|
|
Closes the connection.
Implements org.objectweb.cjdbc.controller.connection.AbstractConnectionManager. Definition at line 132 of file SimpleConnectionManager.java. References org.objectweb.cjdbc.common.log.Trace.error(). 00133 { 00134 removeConnection(); 00135 try 00136 { 00137 connection.close(); 00138 } 00139 catch (SQLException e) 00140 { 00141 logger.error("Failed to close connection for '" + backendUrl + "'", e); 00142 } 00143 }
|