[teiid-commits] teiid SVN: r1263 - trunk/client/src/main/java/com/metamatrix/common/comm/platform/client.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Aug 19 11:20:26 EDT 2009


Author: rareddy
Date: 2009-08-19 11:20:26 -0400 (Wed, 19 Aug 2009)
New Revision: 1263

Modified:
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java
Log:
TEIID-793: making the call to connection at the time "getAdmin" is called, such that any identy assertion is done during scope of the "getAdmin" call.

Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java	2009-08-18 19:37:24 UTC (rev 1262)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/client/ServerAdminFactory.java	2009-08-19 15:20:26 UTC (rev 1263)
@@ -60,8 +60,9 @@
     	private Properties p;
     	private boolean closed;
     	
-    	public ReconnectingProxy(Properties p) {
+    	public ReconnectingProxy(Properties p) throws ConnectionException, CommunicationException {
     		this.p = p;
+    		this.registry = serverConnectionFactory.createConnection(p);
 		}
     	
     	private synchronized Admin getTarget() throws AdminComponentException, CommunicationException {
@@ -214,14 +215,20 @@
     	return createAdmin(p);
     }
 
-	public Admin createAdmin(Properties p) {
+	public Admin createAdmin(Properties p) throws AdminException {
 		p = PropertiesUtils.clone(p);
 		p.remove(MMURL.JDBC.VDB_NAME);
 		p.remove(MMURL.JDBC.VDB_VERSION);
     	p.setProperty(MMURL.CONNECTION.AUTO_FAILOVER, Boolean.TRUE.toString());
-		Admin serverAdmin = (Admin)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] { Admin.class }, new ReconnectingProxy(p));
     	
-       return serverAdmin;
+		try {
+			Admin serverAdmin = (Admin)Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] { Admin.class }, new ReconnectingProxy(p));
+			return serverAdmin;
+		} catch (ConnectionException e) {				
+			throw new AdminComponentException(e.getMessage());
+		} catch (CommunicationException e) {
+			throw new AdminComponentException(e.getMessage());
+		}
     }
     
 }



More information about the teiid-commits mailing list