[teiid-commits] teiid SVN: r705 - in trunk: client/src/main/java/com/metamatrix/common/comm/platform/socket/client and 14 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Apr 3 15:51:37 EDT 2009


Author: shawkins
Date: 2009-04-03 15:51:36 -0400 (Fri, 03 Apr 2009)
New Revision: 705

Modified:
   trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java
   trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/AdminApiServerDiscovery.java
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServerDiscovery.java
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java
   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/SocketServerInstance.java
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/UrlServerDiscovery.java
   trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java
   trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.java
   trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestAdminApiServerDiscovery.java
   trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java
   trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java
   trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsPanel.java
   trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionPanel.java
   trunk/embedded/src/main/java/com/metamatrix/jdbc/transport/LocalServerConnection.java
   trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
   trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/LogonImpl.java
   trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java
   trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketClientInstance.java
   trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java
   trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionServiceInterface.java
   trunk/server/src/main/java/com/metamatrix/platform/security/session/service/SessionServiceImpl.java
   trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java
   trunk/server/src/test/java/com/metamatrix/common/comm/platform/socket/server/TestLogonImpl.java
   trunk/server/src/test/java/com/metamatrix/platform/security/session/service/TestSessionServiceImpl.java
Log:
TEIID-458, TEIID-454, TEIID-445 changing back to using a separate pool for socket work, removing the retry logic from console relogons and properly display queue information

Modified: trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/api/ServerConnection.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -25,6 +25,8 @@
 import com.metamatrix.platform.security.api.LogonResult;
 
 public interface ServerConnection {
+	
+	public static final int PING_INTERVAL = 120000;
 
 	<T> T getService(Class<T> iface);
 	

Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/AdminApiServerDiscovery.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/AdminApiServerDiscovery.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/AdminApiServerDiscovery.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -24,7 +24,10 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 
 import com.metamatrix.admin.api.exception.AdminException;
@@ -36,7 +39,6 @@
 
 /**
  * Will discover hosts based upon an anon admin api call.
- * TODO: perform active polling
  */
 public class AdminApiServerDiscovery extends UrlServerDiscovery {
 	
@@ -46,62 +48,56 @@
 	 */
 	public static final String USE_URL_HOST = "AdminApiServerDiscovery.useUrlHost"; //$NON-NLS-1$
 	
-	private volatile List<HostInfo> knownHosts;
+	public static final int DISCOVERY_TIMEOUT = 120000;
 	
-	private volatile boolean discoveredHosts;
-	private volatile boolean authenticated;
+	static class ClusterInfo {
+		volatile long lastDiscoveryTime;
+		volatile List<HostInfo> knownHosts = new ArrayList<HostInfo>();
+	}
 	
-	private HostInfo lastHostInfo;
-	private SocketServerInstance lastServerInstance;
+	private static Map<String, ClusterInfo> clusterInfo = Collections.synchronizedMap(new HashMap<String, ClusterInfo>());
 	
 	private boolean useUrlHost;
 	
 	@Override
-	public List<HostInfo> getKnownHosts() {
-		if (!discoveredHosts) {
-			return super.getKnownHosts();
-		}
-		return knownHosts;
-	}
-	
-	@Override
 	public void init(MMURL url, Properties p) {
 		super.init(url, p);
+		//TODO: this could be on a per cluster basis
 		useUrlHost = Boolean.valueOf(p.getProperty(USE_URL_HOST)).booleanValue();
 	}
-		
+	
 	@Override
-	public synchronized void connectionSuccessful(HostInfo info, SocketServerInstance instance) {
-		super.connectionSuccessful(info, instance);
-		this.lastHostInfo = info;
-		this.lastServerInstance = instance;
-		discoverHosts();
-	}
-
-	private synchronized void discoverHosts() {
-		if (discoveredHosts || !authenticated) {
-			return;
+	public List<HostInfo> getKnownHosts(LogonResult result,
+			SocketServerInstance instance) {
+		if (result == null) {
+			return super.getKnownHosts(result, instance);
 		}
-		ServerAdmin serverAdmin = lastServerInstance.getService(ServerAdmin.class);
-		try {
-			Collection<ProcessObject> processes = serverAdmin.getProcesses("*");
-			this.knownHosts = new ArrayList<HostInfo>(processes.size());
-			for (ProcessObject processObject : processes) {
-				if (!processObject.isEnabled()) {
-					continue;
+		ClusterInfo info = clusterInfo.get(result.getClusterName());
+		if (info == null) {
+			info = new ClusterInfo();
+		}
+		synchronized (info) {
+			if (instance != null 
+					&& (info.lastDiscoveryTime < System.currentTimeMillis() - DISCOVERY_TIMEOUT || info.knownHosts.isEmpty())) {
+				ServerAdmin serverAdmin = instance.getService(ServerAdmin.class);
+				try {
+					Collection<ProcessObject> processes = serverAdmin.getProcesses("*");
+					info.knownHosts.clear();
+					for (ProcessObject processObject : processes) {
+						if (!processObject.isEnabled() || !processObject.isRunning()) {
+							continue;
+						}
+						info.knownHosts.add(new HostInfo(useUrlHost?instance.getHostInfo().getHostName():processObject.getInetAddress().getHostName(), processObject.getPort()));
+					}
+					info.lastDiscoveryTime = System.currentTimeMillis();
+				} catch (AdminException e) {
+					//ignore - will get an update on the next successful connection
 				}
-				this.knownHosts.add(new HostInfo(useUrlHost?lastHostInfo.getHostName():processObject.getInetAddress().getHostName(), processObject.getPort()));
 			}
-			discoveredHosts = true;
-		} catch (AdminException e) {
-			//ignore - will get an update on the next successful connection
+			if (info.knownHosts.size() == 0) {
+				return super.getKnownHosts(result, instance);
+			}
+			return new ArrayList<HostInfo>(info.knownHosts);
 		}
 	}
-	
-	@Override
-	public boolean setLogonResult(LogonResult result) {
-		this.authenticated = true;
-		discoverHosts();
-		return this.discoveredHosts;
-	}
 }

Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServerDiscovery.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServerDiscovery.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/ServerDiscovery.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -31,27 +31,39 @@
 
 /**
  * Customizable ServerDiscovery interface
- * 
- * TODO: add knowledge of the cluster/ServerConnection in the getKnownHosts calls 
  */
 public interface ServerDiscovery {
 	
+	/**
+	 * Initialize the {@link ServerDiscovery}
+	 * @param url
+	 * @param p
+	 */
 	void init(MMURL url, Properties p);
 	
-	List<HostInfo> getKnownHosts();
+	/**
+	 * Get the currently known hosts. 
+	 * @param result, the current {@link LogonResult} - may be null if unauthenticated 
+	 * @param instance, the currently connected instance - may be null if not connected
+	 * @return
+	 */
+	List<HostInfo> getKnownHosts(LogonResult result, SocketServerInstance instance);
 	
-	void connectionSuccessful(HostInfo info, SocketServerInstance instance);
+	/**
+	 * Indicates that a connection was made successfully to the given host.
+	 * @param info
+	 */
+	void connectionSuccessful(HostInfo info);
 	
+	/**
+	 * Indicates that a connection could not be made to the given host.
+	 * @param info
+	 */
 	void markInstanceAsBad(HostInfo info);
 	
-	void shutdown();
-	
 	/**
-	 * Sets the {@link LogonResult} after authentication.  The {@link LogonResult} will contain information
-	 * such as the cluster name that can be used for more efficient discovery.
-	 * @param result
-	 * @return <code>true</code> if the connection should select another instance after logon.
+	 * Shutdown this {@link ServerDiscovery}
 	 */
-	boolean setLogonResult(LogonResult result);
-	
+	void shutdown();
+		
 }

Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -94,8 +94,27 @@
         authenticate(); 
         
         this.pingTimer = pingTimer;
-        if (this.pingTimer != null && logonResult.getPingInterval() > 0) {
-        	schedulePing();
+        schedulePing();
+	}
+
+	private void schedulePing() {
+		if (this.pingTimer != null) {
+        	this.pingTimer.schedule(new TimerTask() {
+    			@Override
+    			public void run() {
+    				try {
+    					if (isOpen()) {
+    						logon.ping();
+    						return;
+    					} 
+    				} catch (InvalidSessionException e) {
+    					shutdown();
+    				} catch (MetaMatrixComponentException e) {
+    					shutdown();
+    				} 
+    				this.cancel();
+    			}
+        	}, PING_INTERVAL, PING_INTERVAL);
         }
 	}
 	
@@ -113,9 +132,9 @@
 			if (this.serverInstance.isOpen()) {
 				return this.serverInstance;
 			}
-			closeServerInstance();
 		}
-		List<HostInfo> hostKeys = new ArrayList<HostInfo>(this.serverDiscovery.getKnownHosts());
+		List<HostInfo> hostKeys = new ArrayList<HostInfo>(this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance));
+		closeServerInstance();
 		List<HostInfo> hostCopy = new ArrayList<HostInfo>(hostKeys);
 		int knownHosts = hostKeys.size();
 		while (hostKeys.size() > 0) {
@@ -128,7 +147,7 @@
 					ILogon newLogon = instance.getService(ILogon.class);
 					newLogon.assertIdentity(logonResult.getSessionID());
 				}
-				this.serverDiscovery.connectionSuccessful(hostInfo, instance);
+				this.serverDiscovery.connectionSuccessful(hostInfo);
 				this.serverInstance = instance;
 				return this.serverInstance;
 			} catch (IOException e) {
@@ -158,7 +177,8 @@
         // Log on to server
         try {
             this.logonResult = logon.logon(connProps);
-            if (this.serverDiscovery.setLogonResult(this.logonResult)) {
+            if (this.serverDiscovery.getKnownHosts(logonResult, this.serverInstance).size() > 1) {
+            	//if there are multiple instances, allow for load-balancing
             	closeServerInstance();
             }
             return;
@@ -174,25 +194,6 @@
         } 	
 	}
 	
-	private void schedulePing() {
-		this.pingTimer.schedule(new TimerTask() {
-
-			@Override
-			public void run() {
-				try {
-					if (isOpen()) {
-						logon.ping();
-						schedulePing();
-					}
-				} catch (InvalidSessionException e) {
-					shutdown();
-				} catch (MetaMatrixComponentException e) {
-					shutdown();
-				}
-				
-			}}, logonResult.getPingInterval());
-	}
-	
 	class ServerConnectionInvocationHandler implements InvocationHandler {
 		
 		private Class<?> targetClass;

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-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -38,11 +38,10 @@
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
-import com.metamatrix.admin.api.exception.security.InvalidSessionException;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.common.api.HostInfo;
 import com.metamatrix.common.api.MMURL;
 import com.metamatrix.common.comm.api.ServerConnectionFactory;
@@ -67,7 +66,8 @@
 	private static final String URL = "URL"; //$NON-NLS-1$
 	
 	private static SocketServerConnectionFactory INSTANCE;
-	
+	private static Logger log = Logger.getLogger("org.teiid.client.sockets"); //$NON-NLS-1$
+
 	private final class ShutdownHandler implements InvocationHandler {
 		private final CachedInstance key;
 
@@ -200,11 +200,8 @@
 					Future<?> success = logon.ping();
 					success.get(this.channelFactory.getSoTimeout(), TimeUnit.MICROSECONDS);
 					valid = true;
-				} catch (MetaMatrixComponentException e) {
-				} catch (InvalidSessionException e) {
-				} catch (InterruptedException e) {
-				} catch (ExecutionException e) {
-				} catch (TimeoutException e) {
+				} catch (Exception e) {
+					log.log(Level.FINE, "Error performing ping, will select another instance", e); //$NON-NLS-1$
 				}
 				if (valid) {
 					return instance.proxy;

Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstance.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstance.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstance.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -24,6 +24,7 @@
 
 import java.net.SocketAddress;
 
+import com.metamatrix.common.api.HostInfo;
 import com.metamatrix.common.util.crypto.Cryptor;
 
 public interface SocketServerInstance {
@@ -34,6 +35,8 @@
 
 	SocketAddress getRemoteAddress();
 	
+	HostInfo getHostInfo();
+	
 	boolean isOpen();
 	
 	Cryptor getCryptor();

Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerInstanceImpl.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -106,6 +106,11 @@
     }
     
     @Override
+    public HostInfo getHostInfo() {
+    	return this.hostInfo;
+    }
+    
+    @Override
     public SocketAddress getRemoteAddress() {
     	return this.socketChannel.getRemoteAddress();
     }

Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/UrlServerDiscovery.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/UrlServerDiscovery.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/UrlServerDiscovery.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -44,7 +44,8 @@
 	}
 	
 	@Override
-	public List<HostInfo> getKnownHosts() {
+	public List<HostInfo> getKnownHosts(LogonResult result,
+			SocketServerInstance instance) {
 		return url.getHostInfo();
 	}
 
@@ -52,10 +53,9 @@
 	public void init(MMURL url, Properties p) {
 		this.url = url;
 	}
-
+	
 	@Override
-	public void connectionSuccessful(HostInfo info,
-			SocketServerInstance instance) {
+	public void connectionSuccessful(HostInfo info) {
 		
 	}
 
@@ -63,13 +63,8 @@
 	public void markInstanceAsBad(HostInfo info) {
 		
 	}
-
+		
 	@Override
-	public boolean setLogonResult(LogonResult result) {
-		return false;
-	}
-	
-	@Override
 	public void shutdown() {
 		
 	}

Modified: trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/platform/security/api/LogonResult.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -40,7 +40,6 @@
     private TimeZone timeZone = TimeZone.getDefault();
     private final Properties productInfo;
     private String userName;
-    private long pingInterval;
     private String clusterName;
 
     public LogonResult() {
@@ -48,11 +47,10 @@
 	}
     
     public LogonResult(MetaMatrixSessionID sessionID,
-			String userName, Properties productInfo, long pingInterval, String clusterName) {
+			String userName, Properties productInfo, String clusterName) {
 		this.sessionID = sessionID;
 		this.userName = userName;
 		this.productInfo = productInfo;
-		this.pingInterval = pingInterval;
 		this.clusterName = clusterName;
 	}
 
@@ -77,10 +75,6 @@
 		return userName;
 	}
 
-	public long getPingInterval() {
-		return pingInterval;
-	}
-
 	public String getClusterName() {
 		return clusterName;
 	}

Modified: trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/main/java/com/metamatrix/platform/security/api/MetaMatrixSessionInfo.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -36,9 +36,7 @@
     private SessionToken sessionToken;  // immutable
     private long lastPingTime;
     private long timeCreated;
-    private long timeStateChanged;
     private String applicationName;
-    private int state;
     private String product;
     private Properties productInfo;
     private String clientIp;
@@ -49,11 +47,10 @@
      * Master constructor, allows a MetaMatrixSessionInfo to be created with
      * any state and any timestamps.
      */
-    public MetaMatrixSessionInfo(MetaMatrixSessionID sessionID, String userName, long timeCreated, String applicationName, int state, String clusterName, Properties productInfo, String product, String clientIp, String clientHostname){
+    public MetaMatrixSessionInfo(MetaMatrixSessionID sessionID, String userName, long timeCreated, String applicationName, Properties productInfo, String product, String clientIp, String clientHostname){
         this.timeCreated = timeCreated;
         this.lastPingTime = timeCreated;
         this.applicationName = applicationName;
-        this.state = state;
         this.product = product;
         this.sessionToken = new SessionToken(sessionID, userName);
         this.productInfo = productInfo;
@@ -100,18 +97,10 @@
         return this.product;
     }
 
-    public boolean isOpen() {
-        return (this.state == MetaMatrixSessionState.ACTIVE);
-    }
-
     public SessionToken getSessionToken(){
         return this.sessionToken;
     }
 
-    public int getState(){
-        return this.state;
-    }
-
     /**
      * Return a cloned instance of this object.
      * @return the object that is the clone of this instance.
@@ -135,12 +124,8 @@
         s.append(", "); //$NON-NLS-1$
         s.append("application:"); //$NON-NLS-1$
         s.append(this.applicationName);
-        s.append(", state:"); //$NON-NLS-1$
-        s.append(this.state);
         s.append(", created:"); //$NON-NLS-1$
         s.append(this.timeCreated);
-        s.append(", state changed:"); //$NON-NLS-1$
-        s.append(this.timeStateChanged);
         s.append(", last pinged server:"); //$NON-NLS-1$
         s.append(this.lastPingTime);
         s.append("]"); //$NON-NLS-1$

Modified: trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestAdminApiServerDiscovery.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestAdminApiServerDiscovery.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestAdminApiServerDiscovery.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -22,6 +22,7 @@
 
 package com.metamatrix.common.comm.platform.socket.client;
 
+import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
@@ -42,33 +43,36 @@
 		AdminApiServerDiscovery discovery = new AdminApiServerDiscovery();
 		Properties p = new Properties();
 		p.setProperty(AdminApiServerDiscovery.USE_URL_HOST, Boolean.TRUE.toString());
-		MMURL mmurl = new MMURL("foo", 1, false);
+		MMURL mmurl = new MMURL("foo", 1, false); //$NON-NLS-1$
 		discovery.init(mmurl, p);
-		
+		HostInfo knownHost = mmurl.getHostInfo().get(0);
 		//we will start off using the url host
-		assertEquals(1, discovery.getKnownHosts().size()); 
+		assertEquals(1, discovery.getKnownHosts(null, null).size()); 
 		
 		SocketServerInstance instance = Mockito.mock(SocketServerInstance.class);
 		ServerAdmin serverAdmin = Mockito.mock(ServerAdmin.class);
 		
 		List<ProcessObject> processes = new ArrayList<ProcessObject>();
 		ProcessObject p1 = Mockito.mock(ProcessObject.class);
-		Mockito.stub(p1.isEnabled()).toReturn(false);
 		Mockito.stub(p1.getPort()).toReturn(5);
 		processes.add(p1);
 		ProcessObject p2 = Mockito.mock(ProcessObject.class);
 		Mockito.stub(p2.isEnabled()).toReturn(true);
+		Mockito.stub(p2.isRunning()).toReturn(true);
 		Mockito.stub(p2.getPort()).toReturn(6);
+		Mockito.stub(p2.getInetAddress()).toReturn(InetAddress.getByName("0.0.0.0")); //$NON-NLS-1$
 		processes.add(p2);
+		Mockito.stub(serverAdmin.getProcesses("*")).toReturn(processes); //$NON-NLS-1$
+		Mockito.stub(instance.getService(ServerAdmin.class)).toReturn(serverAdmin);
+		Mockito.stub(instance.getHostInfo()).toReturn(knownHost);
 		
-		Mockito.stub(serverAdmin.getProcesses("*")).toReturn(processes);
-		Mockito.stub(instance.getService(ServerAdmin.class)).toReturn(serverAdmin);
-		discovery.connectionSuccessful(discovery.getKnownHosts().get(0), instance);
-		discovery.setLogonResult(new LogonResult());
-		List<HostInfo> knownHosts = discovery.getKnownHosts();
+		discovery.connectionSuccessful(knownHost);
+		List<HostInfo> knownHosts = discovery.getKnownHosts(new LogonResult(), instance);
+		
 		assertEquals(1, knownHosts.size());
 		HostInfo h = knownHosts.get(0);
-		assertEquals("foo", h.getHostName());
+		//the returned host should have the url name, but the process port
+		assertEquals("foo", h.getHostName()); //$NON-NLS-1$
 		assertEquals(6, h.getPortNumber());
 	}
 	

Modified: trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client/src/test/java/com/metamatrix/common/comm/platform/socket/client/TestSocketServerConnection.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -78,7 +78,7 @@
 				Properties connectionProperties)
 				throws LogonException,
 				MetaMatrixComponentException {
-			return new LogonResult(new MetaMatrixSessionID(1), "fooUser", new Properties(), 1, "fake"); //$NON-NLS-1$ //$NON-NLS-2$
+			return new LogonResult(new MetaMatrixSessionID(1), "fooUser", new Properties(), "fake"); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 
 		@Override

Modified: trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java
===================================================================
--- trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMConnection.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -45,10 +45,9 @@
 
     public TestMMConnection(String name) {
         super(name);
-        System.setProperty("metamatrix.config.none", "true");
     }
     
-    public static MMServerConnection getMMConnection() throws SQLException {
+    public static MMServerConnection getMMConnection() {
     	ServerConnection mock = mock(ServerConnection.class);
     	stub(mock.getService(ClientSideDQP.class)).toReturn(mock(ClientSideDQP.class));
     	Properties props = new Properties();
@@ -58,7 +57,7 @@
     	Properties productInfo = new Properties();
     	productInfo.setProperty(ProductInfoConstants.VIRTUAL_DB, STD_DATABASE_NAME);
     	productInfo.setProperty(ProductInfoConstants.VDB_VERSION, STD_DATABASE_VERSION);
-    	stub(mock.getLogonResult()).toReturn(new LogonResult(new MetaMatrixSessionID(1), "metamatrixadmin", productInfo, 1, "fake")); //$NON-NLS-1$
+    	stub(mock.getLogonResult()).toReturn(new LogonResult(new MetaMatrixSessionID(1), "metamatrixadmin", productInfo, "fake")); //$NON-NLS-1$
     	return new MMServerConnection(mock, props, serverUrl);
     }
 

Modified: trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/common-core/src/main/java/com/metamatrix/api/exception/MultipleException.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -44,43 +44,7 @@
     /** An error code. */
     private String code;
     
-    /** Construct a default instance of this class. */
-    public MultipleException() {
-        super();
-    }
-
     /**
-     * Construct an instance with the error message specified.
-     *
-     * @param message The error message
-     */
-    public MultipleException( String message ) {
-        super( message );
-    }
-
-    /**
-     * Construct an instance with an error code and message specified.
-     *
-     * @param message The error message
-     * @param code    The error code
-     */
-    public MultipleException( String code, String message ) {
-        super( message );
-        setCode( code );
-    }
-
-    /**
-     * Construct an instance with the set of exceptions specified.
-     *
-     * @param throwables the set of exceptions that is to comprise
-     * this exception
-     */
-    public MultipleException( Collection throwables ) {
-        super();
-        setExceptions(throwables);
-    }
-
-    /**
      * Construct an instance with the set of exceptions and error message
      * specified.
      *
@@ -89,8 +53,7 @@
      * @param message The error message
      */
     public MultipleException( Collection throwables, String message ) {
-        super( message );
-        setExceptions(throwables);
+        this( throwables, null, message );
     }
 
     /**
@@ -102,9 +65,9 @@
      * @param message The error message
      * @param code    The error code
      */
-    public MultipleException( Collection throwables, String code, String message ) {
+    public MultipleException( Collection<Throwable> throwables, String code, String message ) {
         super( message );
-        setExceptions(throwables);
+        this.throwablesList = Collections.unmodifiableList(new ArrayList<Throwable>(throwables));
         setCode( code );
     }
 
@@ -132,15 +95,6 @@
     	return this.throwablesList;
     }
 
-    /**
-     * Set the exceptions that comprise this exception.
-     * @param throwables the set of exceptions that is to comprise
-     * this exception
-     */
-    public void setExceptions( Collection throwables ){
-        this.throwablesList = new ArrayList(throwables);
-    }
-
 	@Override
 	public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException {
 		this.code = (String)in.readObject();

Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsPanel.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsPanel.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -42,6 +42,7 @@
     private QueueStatisticsRefreshRequestHandler controller;
     private ProcessStatistics vmStatistics;
     private ProcessVMStatisticsPanel processPanel;
+    private SingleQueueStatisticsPanel queuePanel;
     private SocketVMStatisticsPanel socketPanel;
     private AbstractButton closeButton;
     
@@ -83,10 +84,13 @@
         JPanel statsPanel = new JPanel(statsLayout);
         processPanel = new ProcessVMStatisticsPanel(vmStatistics.name);
         processPanel.populate(vmStatistics);
+        queuePanel = new SingleQueueStatisticsPanel("Socket Worker");
+        queuePanel.populate(vmStatistics.processPoolStats);
         socketPanel = new SocketVMStatisticsPanel();
         socketPanel.populate(vmStatistics);
         
         statsPanel.add(processPanel);
+        statsPanel.add(queuePanel);
         statsPanel.add(socketPanel);
         
         this.add(statsPanel);
@@ -100,6 +104,9 @@
         statsLayout.setConstraints(processPanel, new GridBagConstraints(0, 0, 1, 1,
             1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
             new Insets(4, 4, 4, 4), 0, 0));
+        statsLayout.setConstraints(queuePanel, new GridBagConstraints(0, 1, 1, 1,
+            0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+            new Insets(4, 4, 4, 4), 0, 0));        
         statsLayout.setConstraints(socketPanel, new GridBagConstraints(0, 2, 1, 1,
             0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
             new Insets(4, 4, 4, 4), 0, 0));
@@ -116,6 +123,7 @@
     public void repopulate(ProcessStatistics vmStat) {
         vmStatistics = vmStat;
         processPanel.populate(vmStatistics);
+        queuePanel.populate(vmStatistics.processPoolStats);
         socketPanel.populate(vmStatistics);
     }
 
@@ -166,8 +174,6 @@
         "Message Packets Written",
         "Num. Sockets",
         "Highest Num. Sockets",
-        "Current Thread Count",
-        "Highest Thread Count",
     };
     
     
@@ -192,8 +198,6 @@
         textFieldWidgets[1].setText(Long.toString(listenerStats.objectsWritten));
         textFieldWidgets[2].setText(Integer.toString(listenerStats.sockets));
         textFieldWidgets[3].setText(Integer.toString(listenerStats.maxSockets));
-        textFieldWidgets[4].setText(Integer.toString(vmStats.processPoolStats.getActiveThreads()));
-        textFieldWidgets[5].setText(Integer.toString(vmStats.processPoolStats.getHighestActiveThreads()));
     }
 
 }
\ No newline at end of file

Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionPanel.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/sessions/SessionPanel.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -76,7 +76,6 @@
 import com.metamatrix.console.util.StaticUtilities;
 import com.metamatrix.platform.security.api.MetaMatrixSessionID;
 import com.metamatrix.platform.security.api.MetaMatrixSessionInfo;
-import com.metamatrix.platform.security.api.MetaMatrixSessionState;
 import com.metamatrix.platform.util.ProductInfoConstants;
 import com.metamatrix.toolbox.ui.widget.TableWidget;
 import com.metamatrix.toolbox.ui.widget.table.EnhancedTableColumn;
@@ -400,23 +399,7 @@
             }
 		    
 		    data[i][SessionTableModel.VDB_VERSION_COLUMN_NUM] = vdbVersStr;
-		    String sessionState;
-		    switch (u.getState()){
-		        case MetaMatrixSessionState.EXPIRED:
-		            sessionState = EXPIRED_TEXT; 
-		            break;
-		        case MetaMatrixSessionState.ACTIVE:
-		            sessionState = ACTIVE_TEXT; 
-		            break;
-		        case MetaMatrixSessionState.CLOSED:
-		            sessionState = CLOSED_TEXT; 
-		            break;
-		        case MetaMatrixSessionState.TERMINATED:
-		            sessionState = TERMINATED_TEXT; 
-		            break;
-		        default:
-		            sessionState = DEFAULT_TEXT; 
-		    }
+		    String sessionState = ACTIVE_TEXT;  
 		    data[i][SessionTableModel.STATE_COLUMN_NUM] = sessionState;
 		    data[i][SessionTableModel.PRODUCT_COLUMN_NUM]= u.getProductName();
 		

Modified: trunk/embedded/src/main/java/com/metamatrix/jdbc/transport/LocalServerConnection.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/jdbc/transport/LocalServerConnection.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/embedded/src/main/java/com/metamatrix/jdbc/transport/LocalServerConnection.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -49,7 +49,7 @@
 	private ServerConnectionListener listener;
 
 	public LocalServerConnection(MetaMatrixSessionID sessionId, Properties connectionProperties, ClientSideDQP dqp, ServerConnectionListener listener) {
-		result = new LogonResult(sessionId, connectionProperties.getProperty(MMURL.CONNECTION.USER_NAME), connectionProperties, -1, "local"); //$NON-NLS-1$
+		result = new LogonResult(sessionId, connectionProperties.getProperty(MMURL.CONNECTION.USER_NAME), connectionProperties, "local"); //$NON-NLS-1$
 		
 		//Initialize the workContext
 		workContext = new DQPWorkContext();

Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -92,6 +92,7 @@
 import com.metamatrix.platform.registry.ClusteredRegistryState;
 import com.metamatrix.platform.registry.ServiceRegistryBinding;
 import com.metamatrix.platform.security.api.MetaMatrixSessionInfo;
+import com.metamatrix.platform.security.api.MetaMatrixSessionState;
 import com.metamatrix.platform.security.api.SessionToken;
 import com.metamatrix.platform.service.api.exception.ServiceException;
 import com.metamatrix.platform.util.ProductInfoConstants;
@@ -920,7 +921,7 @@
 			        session.setVDBVersion(vdbVersionString); 
 			        session.setProductName(info.getProductName()); 
 			        session.setLastPingTime(info.getLastPingTime());
-			        session.setSessionState(info.getState());
+			        session.setSessionState(MetaMatrixSessionState.ACTIVE);
 			        session.setIPAddress(info.getClientIp());
 			        session.setHostName(info.getClientHostname());
 			        results.add(session);

Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/LogonImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/LogonImpl.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/LogonImpl.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -91,7 +91,7 @@
 			MetaMatrixSessionID sessionID = updateDQPContext(sessionInfo);
 			LogManager.logDetail(LogSecurityConstants.CTX_SESSION, new Object[] {
 					"Logon successful for \"", user, "\" - created SessionID \"", "" + sessionID, "\"" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-			return new LogonResult(sessionID, sessionInfo.getUserName(), sessionInfo.getProductInfo(), service.getPingInterval(), clusterName);
+			return new LogonResult(sessionID, sessionInfo.getUserName(), sessionInfo.getProductInfo(), clusterName);
 		} catch (MetaMatrixAuthenticationException e) {
 			throw new LogonException(e, e.getMessage());
 		} catch (ServiceException e) {

Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -40,12 +40,10 @@
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
 import com.metamatrix.common.comm.ClientServiceRegistry;
 import com.metamatrix.common.comm.api.Message;
-import com.metamatrix.common.comm.platform.socket.SocketVMController;
 import com.metamatrix.common.comm.platform.socket.client.ServiceInvocationStruct;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.common.util.crypto.CryptoException;
 import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.core.log.MessageLevel;
 import com.metamatrix.core.util.ReflectionHelper;
 import com.metamatrix.dqp.client.ResultsFuture;
 import com.metamatrix.platform.PlatformPlugin;

Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketClientInstance.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketClientInstance.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketClientInstance.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -37,6 +37,7 @@
 import com.metamatrix.common.comm.platform.socket.ObjectChannel;
 import com.metamatrix.common.comm.platform.socket.SocketVMController;
 import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.queue.WorkerPool;
 import com.metamatrix.common.util.crypto.CryptoException;
 import com.metamatrix.common.util.crypto.Cryptor;
 import com.metamatrix.common.util.crypto.DhKeyGenerator;
@@ -55,6 +56,7 @@
 public class SocketClientInstance implements ChannelListener, ClientInstance {
 	
 	private final ObjectChannel objectSocket;
+    private final WorkerPool workerPool;
     private final ClientServiceRegistry server;
     private Cryptor cryptor;
     private boolean usingEncryption; 
@@ -62,8 +64,9 @@
     private DQPWorkContext workContext = new DQPWorkContext();
     private SessionServiceInterface sessionService;
         
-    public SocketClientInstance(ObjectChannel objectSocket, ClientServiceRegistry server, boolean isClientEncryptionEnabled, SessionServiceInterface sessionService) {
+    public SocketClientInstance(ObjectChannel objectSocket, WorkerPool workerPool, ClientServiceRegistry server, boolean isClientEncryptionEnabled, SessionServiceInterface sessionService) {
         this.objectSocket = objectSocket;
+        this.workerPool = workerPool;
         this.server = server;
         this.usingEncryption = isClientEncryptionEnabled;
         this.sessionService = sessionService;
@@ -143,7 +146,7 @@
 		if (LogManager.isMessageToBeRecorded(SocketVMController.SOCKET_CONTEXT, MessageLevel.DETAIL)) { 
 			LogManager.logDetail(SocketVMController.SOCKET_CONTEXT, "processing message:" + packet); //$NON-NLS-1$
         }
-		new ServerWorkItem(this, packet.getMessageKey(), packet, this.server, this.sessionService).run();
+		workerPool.execute(new ServerWorkItem(this, packet.getMessageKey(), packet, this.server, this.sessionService));
 	}
 
 	public void shutdown() throws CommunicationException {

Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -25,6 +25,7 @@
 import java.net.InetSocketAddress;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
 
 import javax.net.ssl.SSLEngine;
 
@@ -58,7 +59,7 @@
     private boolean isClientEncryptionEnabled;
     private SessionServiceInterface sessionService;
     private WorkerPool workerPool;
-    private ExecutorService bossService;
+    private ExecutorService nettyPool;
     
     /**
      * 
@@ -81,12 +82,12 @@
 
        	this.server = server;
         this.workerPool = WorkerPoolFactory.newWorkerPool("SocketWorker", maxWorkers, 120000); //$NON-NLS-1$
-        this.bossService = Executors.newCachedThreadPool();
+        this.nettyPool = Executors.newCachedThreadPool();
         if (LogManager.isMessageToBeRecorded(SocketVMController.SOCKET_CONTEXT, MessageLevel.DETAIL)) { 
             LogManager.logDetail(SocketVMController.SOCKET_CONTEXT, "server = " + this.server + "binding to port:" + port); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 		
-        ChannelFactory factory = new NioServerSocketChannelFactory(bossService, workerPool, maxWorkers);
+        ChannelFactory factory = new NioServerSocketChannelFactory(nettyPool, nettyPool, Math.min(Runtime.getRuntime().availableProcessors(), maxWorkers));
         
         ServerBootstrap bootstrap = new ServerBootstrap(factory);
         this.channelHandler = new SSLAwareChannelHandler(this, engine, Thread.currentThread().getContextClassLoader());
@@ -117,7 +118,7 @@
     public void stop() {
     	this.serverChanel.close();
     	this.workerPool.shutdownNow();
-    	this.bossService.shutdownNow();
+    	this.nettyPool.shutdownNow();
     }
    
     public SocketListenerStats getStats() {
@@ -130,7 +131,7 @@
     }
 
 	public ChannelListener createChannelListener(ObjectChannel channel) {
-		return new SocketClientInstance(channel, this.server, this.isClientEncryptionEnabled, this.sessionService);
+		return new SocketClientInstance(channel, this.workerPool, this.server, this.isClientEncryptionEnabled, this.sessionService);
 	}
 
 }
\ No newline at end of file

Modified: trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionServiceInterface.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionServiceInterface.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/api/service/SessionServiceInterface.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -55,7 +55,7 @@
  * </p>
  */
 public interface SessionServiceInterface extends ServiceInterface {
-    public static String NAME = "SessionService";
+    public static String NAME = "SessionService"; //$NON-NLS-1$
 
     /**
      * Create a session for the given user authenticating against the given <code>Credentials</code>.
@@ -154,5 +154,4 @@
      */
     public void pingServer(MetaMatrixSessionID sessionID) throws InvalidSessionException;
     
-    public long getPingInterval();
 }

Modified: trunk/server/src/main/java/com/metamatrix/platform/security/session/service/SessionServiceImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/session/service/SessionServiceImpl.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/session/service/SessionServiceImpl.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -44,6 +44,7 @@
 import com.metamatrix.cache.CacheFactory;
 import com.metamatrix.cache.CacheConfiguration.Policy;
 import com.metamatrix.common.api.MMURL;
+import com.metamatrix.common.comm.api.ServerConnection;
 import com.metamatrix.common.config.CurrentConfiguration;
 import com.metamatrix.common.config.api.Configuration;
 import com.metamatrix.common.log.LogManager;
@@ -62,7 +63,6 @@
 import com.metamatrix.platform.security.api.MetaMatrixPrincipalName;
 import com.metamatrix.platform.security.api.MetaMatrixSessionID;
 import com.metamatrix.platform.security.api.MetaMatrixSessionInfo;
-import com.metamatrix.platform.security.api.MetaMatrixSessionState;
 import com.metamatrix.platform.security.api.service.MembershipServiceInterface;
 import com.metamatrix.platform.security.api.service.SessionServiceInterface;
 import com.metamatrix.platform.security.api.service.SessionTerminationHandler;
@@ -91,13 +91,10 @@
     private static final String SESSION_TIME_LIMIT = "metamatrix.session.time.limit"; //$NON-NLS-1$
     public static final String SESSION_MONITOR_ACTIVITY_INTERVAL = "metamatrix.session.sessionMonitor.ActivityInterval"; //$NON-NLS-1$
 
-    private static long CLIENT_PING_INTERVAL = 600000;
-
     private MembershipServiceInterface membershipService;
     private Cache<MetaMatrixSessionID, MetaMatrixSessionInfo> sessionCache;
     private long sessionMaxLimit;
     private long sessionTimeLimit;
-    private String clusterName;
     
     // Product name -> ServiceTerminationHandler
     private Map<String, SessionTerminationHandler> terminationHandlerMap = new HashMap<String, SessionTerminationHandler>();
@@ -128,21 +125,20 @@
         Properties nextProperties = config.getProperties();
         this.sessionMaxLimit = PropertiesUtils.getIntProperty(nextProperties, MAX_ACTIVE_SESSIONS, 0);
         this.sessionTimeLimit = PropertiesUtils.getIntProperty(nextProperties, SESSION_TIME_LIMIT, 0) * 60000;
-        this.clusterName = CurrentConfiguration.getInstance().getClusterName();
         this.sessionMonitor = new Timer("SessionMonitor", true); //$NON-NLS-1$
         this.sessionMonitor.schedule(new TimerTask() {
         	@Override
         	public void run() {
         		monitorSessions();
         	}
-        }, this.sessionTimeLimit > 0 ? this.sessionTimeLimit : CLIENT_PING_INTERVAL * 4, CLIENT_PING_INTERVAL);
+        }, 0, ServerConnection.PING_INTERVAL * 5);
     }
 
     private void monitorSessions() {
 		long currentTime = System.currentTimeMillis();
 		for (MetaMatrixSessionInfo info : sessionCache.values()) {
 			try {
-    			if (currentTime - info.getLastPingTime() > CLIENT_PING_INTERVAL * 4) {
+    			if (currentTime - info.getLastPingTime() > ServerConnection.PING_INTERVAL * 5) {
     				LogManager.logInfo(LogSecurityConstants.CTX_SESSION, PlatformPlugin.Util.getString( "SessionServiceImpl.keepaliveFailed", info.getSessionID())); //$NON-NLS-1$
     				closeSession(info.getSessionID());
     			} else if (sessionTimeLimit > 0 && currentTime - info.getTimeCreated() > sessionTimeLimit) {
@@ -269,11 +265,9 @@
         										authenticatedUserName,
         										creationTime,
         										applicationName,
-        										MetaMatrixSessionState.ACTIVE,
-                                                clusterName,
-                                                productInfo,
-        										productName, 
-        										properties.getProperty(MMURL.CONNECTION.CLIENT_IP_ADDRESS), 
+        										productInfo,
+                                                productName,
+                                                properties.getProperty(MMURL.CONNECTION.CLIENT_IP_ADDRESS),
         										properties.getProperty(MMURL.CONNECTION.CLIENT_HOSTNAME));
         newSession.setTrustedToken(trustedToken);
         if (this.sessionCache.put(newSession.getSessionID(), newSession) != null) {
@@ -348,11 +342,6 @@
 	}
 
 	@Override
-	public long getPingInterval() {
-		return CLIENT_PING_INTERVAL;
-	}
-
-	@Override
 	public MetaMatrixPrincipal getPrincipal(MetaMatrixSessionID sessionID)
 			throws InvalidSessionException, SessionServiceException {
         
@@ -430,8 +419,4 @@
 		this.sessionCache = sessionCache;
 	}
 
-	void setClusterName(String clusterName) {
-		this.clusterName = clusterName;
-	}
-
 }

Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -91,8 +91,8 @@
         Properties productInfo1 = new Properties();
         productInfo1.put(ProductInfoConstants.VIRTUAL_DB, "vdb1"); //$NON-NLS-1$
         productInfo1.put(ProductInfoConstants.VDB_VERSION, "1");//$NON-NLS-1$
-        MetaMatrixSessionInfo info1 = new MetaMatrixSessionInfo(id1, "user1", 1, "app1", 1, "cluster1",  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                                                                productInfo1, "product1", null, null); //$NON-NLS-1$
+        MetaMatrixSessionInfo info1 = new MetaMatrixSessionInfo(id1, "user1", 1, "app1", productInfo1, "product1",  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                                                                null, null); //$NON-NLS-1$
         sessions.add(info1);
 
         
@@ -100,8 +100,8 @@
         Properties productInfo2 = new Properties();
         productInfo2.put(ProductInfoConstants.VIRTUAL_DB, "vdb2"); //$NON-NLS-1$
         productInfo2.put(ProductInfoConstants.VDB_VERSION, "2"); //$NON-NLS-1$
-        MetaMatrixSessionInfo info2 = new MetaMatrixSessionInfo(id2, "user2", 2, "app2", 2, "cluster2",  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        		productInfo2, "product2", null, null); //$NON-NLS-1$
+        MetaMatrixSessionInfo info2 = new MetaMatrixSessionInfo(id2, "user2", 2, "app2", productInfo2, "product2",  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        		null, null); //$NON-NLS-1$
         sessions.add(info2);
         
         return sessions;

Modified: trunk/server/src/test/java/com/metamatrix/common/comm/platform/socket/server/TestLogonImpl.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/common/comm/platform/socket/server/TestLogonImpl.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/test/java/com/metamatrix/common/comm/platform/socket/server/TestLogonImpl.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -51,8 +51,8 @@
 		p.setProperty(MMURL.CONNECTION.PRODUCT_NAME, productName);
 
 		MetaMatrixSessionInfo resultInfo = new MetaMatrixSessionInfo(
-				new MetaMatrixSessionID(1), userName, 0, applicationName, 0,
-				"bar", new Properties(), "product", null, null); //$NON-NLS-1$ //$NON-NLS-2$
+				new MetaMatrixSessionID(1), userName, 0, applicationName, new Properties(),
+				"product", null, null); //$NON-NLS-1$ //$NON-NLS-2$
 
 		Mockito.stub(ssi.createSession(userName, null, null, applicationName,
 								productName, p)).toReturn(resultInfo);

Modified: trunk/server/src/test/java/com/metamatrix/platform/security/session/service/TestSessionServiceImpl.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/platform/security/session/service/TestSessionServiceImpl.java	2009-04-03 19:47:52 UTC (rev 704)
+++ trunk/server/src/test/java/com/metamatrix/platform/security/session/service/TestSessionServiceImpl.java	2009-04-03 19:51:36 UTC (rev 705)
@@ -17,7 +17,6 @@
 	
 	public void testValidateSession() throws Exception {
 		SessionServiceImpl ssi = new SessionServiceImpl();
-		ssi.setClusterName("test"); //$NON-NLS-1$
 		ssi.setSessionCache(new FakeCache<MetaMatrixSessionID, MetaMatrixSessionInfo>());
 		MembershipServiceInterface msi = Mockito.mock(MembershipServiceInterface.class);
 		Mockito.stub(msi.authenticateUser("steve", null, null, "foo")).toReturn(new SuccessfulAuthenticationToken(null, "steve at somedomain")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$




More information about the teiid-commits mailing list