[teiid-commits] teiid SVN: r1270 - in trunk: client/src/main/java/com/metamatrix/common/comm/platform/socket/client and 1 other directories.
teiid-commits at lists.jboss.org
teiid-commits at lists.jboss.org
Mon Aug 24 16:54:32 EDT 2009
Author: rareddy
Date: 2009-08-24 16:54:32 -0400 (Mon, 24 Aug 2009)
New Revision: 1270
Modified:
trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java
Log:
TEIID-795: Added way to check if the connection factory is alive, the embedded profile before making any new connections calls this to make sure the currently configured connection factory is alive, otherwise starts a new connection factory.
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java 2009-08-24 20:39:42 UTC (rev 1269)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnectionFactory.java 2009-08-24 20:54:32 UTC (rev 1270)
@@ -47,6 +47,12 @@
/**
* Shutdown the connection factory, including the DQP and all its existing connections
*/
- public void shutdown(boolean restart);
+ void shutdown(boolean restart);
+
+ /**
+ * Is the connection factory alive
+ * @return true if alive; false otherwise.
+ */
+ boolean isAlive();
}
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java 2009-08-24 20:39:42 UTC (rev 1269)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java 2009-08-24 20:54:32 UTC (rev 1270)
@@ -294,4 +294,10 @@
// only applies in the Embedded scenario.
}
+ @Override
+ public boolean isAlive() {
+ // only applies in the Embedded scenario.
+ return false;
+ }
+
}
Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java 2009-08-24 20:39:42 UTC (rev 1269)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java 2009-08-24 20:54:32 UTC (rev 1270)
@@ -160,7 +160,7 @@
*/
private synchronized static EmbeddedTransport getDQPTransport(URL dqpURL) throws SQLException {
EmbeddedTransport transport = currentTransport;
- if (transport == null || !currentTransport.getURL().equals(dqpURL)) {
+ if (transport == null || !transport.isAlive() || !currentTransport.getURL().equals(dqpURL)) {
// shutdown any previous instance; we do encourage single instance in a given VM
shutdown();
try {
@@ -283,7 +283,7 @@
currentTransport = null;
}
}
-
+
/**
* inner class to hold DQP tansportMap object
* @since 4.3
@@ -417,6 +417,10 @@
this.connectionFactory.shutdown(false);
}
+ boolean isAlive() {
+ return this.connectionFactory.isAlive();
+ }
+
/**
* Create a connection to the DQP defined by this transport object based on
* properties supplied
More information about the teiid-commits
mailing list