[teiid-commits] teiid SVN: r696 - in trunk: client/src/main/java/com/metamatrix/admin/objects and 7 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Thu Apr 2 12:09:57 EDT 2009


Author: shawkins
Date: 2009-04-02 12:09:56 -0400 (Thu, 02 Apr 2009)
New Revision: 696

Added:
   trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/AbstractStatisticsPanel.java
   trunk/engine/src/main/java/org/teiid/dqp/internal/process/Util.java
Removed:
   trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatistics.java
Modified:
   trunk/client/src/main/java/com/metamatrix/admin/api/objects/QueueWorkerPool.java
   trunk/client/src/main/java/com/metamatrix/admin/objects/MMQueueWorkerPool.java
   trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties
   trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPool.java
   trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java
   trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolStats.java
   trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsDisplayHandler.java
   trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsPanel.java
   trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsRefreshRequestHandlerImp.java
   trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsPanel.java
   trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java
   trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
   trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java
Log:
TEIID-454 fixing stats displays

Modified: trunk/client/src/main/java/com/metamatrix/admin/api/objects/QueueWorkerPool.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/objects/QueueWorkerPool.java	2009-04-02 15:53:15 UTC (rev 695)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/objects/QueueWorkerPool.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -24,7 +24,7 @@
 
 
 /** 
- * All the metamatrix server modules use queue based processing inside them. This
+ * All server modules use queue based processing inside them. This
  * object holds the statisics of those queues, as per how many of them queued, dequeued, 
  * processed etc.
  * <p>An identifier for QueueWorkerPool, is nothing but the modules it self, like "DQP", 
@@ -34,21 +34,6 @@
  */
 public interface QueueWorkerPool extends AdminObject {
     /** 
-     * @return Returns the number of dequeues.
-     * @since 4.3
-     */
-    public int getDequeues();
-    /** 
-     * @return Returns the number of enqueues.
-     * @since 4.3
-     */
-    public int getEnqueues();
-    /** 
-     * @return Returns the highwaterMark.
-     * @since 4.3
-     */
-    public int getHighwaterMark();
-    /** 
      * @return Returns the number of requests queued.
      * @since 4.3
      */
@@ -61,20 +46,43 @@
     public int getThreads();
     
     /** 
+     * @return Returns the highest number of active threads
+     */
+    public int getHighestThreads();
+    
+    /** 
      * @return Returns the number of totalDequeues.
      * @since 4.3
+     * @deprecated see {@link #getTotalCompleted()}
      */
     public long getTotalDequeues();
     
+    /**
+     * @return The number of completed tasks
+     */
+    long getTotalCompleted();
+    
     /** 
      * @return Returns the number of totalEnqueues.
      * @since 4.3
+     * @deprecated see {@link #getTotalSubmitted()}
      */
     public long getTotalEnqueues();
     
+    /**
+     * @return The number of submitted tasks
+     */
+    long getTotalSubmitted();
+    
     /** 
      * @return Returns the totalHighwaterMark.
      * @since 4.3
+     * @deprecated see {@link #getHighestQueued()}
      */
     public int getTotalHighwaterMark();
+
+    /** 
+     * @return Returns the highest queue size
+     */
+    public int getHighestQueued();
 }

Modified: trunk/client/src/main/java/com/metamatrix/admin/objects/MMQueueWorkerPool.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMQueueWorkerPool.java	2009-04-02 15:53:15 UTC (rev 695)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMQueueWorkerPool.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -34,19 +34,12 @@
     private int queued = 0;
     private int threads = 0;
     
-    // Counts since last stats retrieval
-    private int enqueues = 0;
-    private int dequeues = 0;
-    private int highwaterMark = 0;
-    
     // Total counts, never reset
-    private int totalHighwaterMark = 0;
-    private long totalEnqueues = 0;
-    private long totalDequeues = 0;
+    private int highestThreads;
+    private int highestQueued = 0;
+    private long totalSubmitted = 0;
+    private long totalCompleted = 0;
     
-   
-    
-    
     /**
      * Construct a new MMQueueWorkerPool 
      * @param identifierParts
@@ -55,8 +48,6 @@
     public MMQueueWorkerPool(String[] identifierParts) {
         super(identifierParts);
     }
-	
-	
    
     /**
      * Get string for display purposes 
@@ -68,64 +59,16 @@
         
         str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.MMQueueWorkerPool") + getIdentifier()); //$NON-NLS-1$
         str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.queued") + queued); //$NON-NLS-1$
-        str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.enqueues") + enqueues); //$NON-NLS-1$
-        str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.dequeues") + dequeues); //$NON-NLS-1$
-        str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.highwaterMark") + highwaterMark);  //$NON-NLS-1$
-        str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.totalEnqueues") + totalEnqueues);  //$NON-NLS-1$
-        str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.totalDequeues") + totalDequeues);  //$NON-NLS-1$
-        str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.totalHighwaterMark") + totalHighwaterMark); //$NON-NLS-1$
+        str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.highestQueued") + highestQueued);  //$NON-NLS-1$
+        str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.totalSubmitted") + totalSubmitted); //$NON-NLS-1$
+        str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.totalCompleted") + totalCompleted); //$NON-NLS-1$
         str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.threads") + threads);     //$NON-NLS-1$
+        str.append(AdminPlugin.Util.getString("MMQueueWorkerPool.highestThreads") + highestThreads);  //$NON-NLS-1$
         
         return str.toString();
     }
-
     
-    
-    
-    
     /** 
-     * @return Returns the dequeues.
-     * @since 4.3
-     */
-    public int getDequeues() {
-        return this.dequeues;
-    }
-    /** 
-     * @param dequeues The dequeues to set.
-     * @since 4.3
-     */
-    public void setDequeues(int dequeues) {
-        this.dequeues = dequeues;
-    }
-    /** 
-     * @return Returns the enqueues.
-     * @since 4.3
-     */
-    public int getEnqueues() {
-        return this.enqueues;
-    }
-    /** 
-     * @param enqueues The enqueues to set.
-     * @since 4.3
-     */
-    public void setEnqueues(int enqueues) {
-        this.enqueues = enqueues;
-    }
-    /** 
-     * @return Returns the highwaterMark.
-     * @since 4.3
-     */
-    public int getHighwaterMark() {
-        return this.highwaterMark;
-    }
-    /** 
-     * @param highwaterMark The highwaterMark to set.
-     * @since 4.3
-     */
-    public void setHighwaterMark(int highwaterMark) {
-        this.highwaterMark = highwaterMark;
-    }
-    /** 
      * @return Returns the number of requests queued.
      * @since 4.3
      */
@@ -158,42 +101,54 @@
      * @since 4.3
      */
     public long getTotalDequeues() {
-        return this.totalDequeues;
+    	return getTotalCompleted();
     }
     /** 
-     * @param totalDequeues The number of totalDequeues to set.
-     * @since 4.3
-     */
-    public void setTotalDequeues(long totalDequeues) {
-        this.totalDequeues = totalDequeues;
-    }
-    /** 
      * @return Returns the number of totalEnqueues.
      * @since 4.3
      */
     public long getTotalEnqueues() {
-        return this.totalEnqueues;
+        return getTotalSubmitted();
     }
     /** 
-     * @param totalEnqueues The number of totalEnqueues to set.
-     * @since 4.3
-     */
-    public void setTotalEnqueues(long totalEnqueues) {
-        this.totalEnqueues = totalEnqueues;
-    }
-    /** 
      * @return Returns the totalHighwaterMark.
      * @since 4.3
      */
     public int getTotalHighwaterMark() {
-        return this.totalHighwaterMark;
+        return getHighestQueued();
     }
-    /** 
-     * @param totalHighwaterMark The totalHighwaterMark to set.
-     * @since 4.3
-     */
-    public void setTotalHighwaterMark(int totalHighwaterMark) {
-        this.totalHighwaterMark = totalHighwaterMark;
-    }
+
+	public int getHighestThreads() {
+		return highestThreads;
+	}
+
+	public void setHighestThreads(int highestThreads) {
+		this.highestThreads = highestThreads;
+	}
+
+	public int getHighestQueued() {
+		return highestQueued;
+	}
+
+	public void setHighestQueued(int highestQueued) {
+		this.highestQueued = highestQueued;
+	}
+
+	public long getTotalSubmitted() {
+		return totalSubmitted;
+	}
+
+	public void setTotalSubmitted(long totalSubmitted) {
+		this.totalSubmitted = totalSubmitted;
+	}
+
+	public void setTotalCompleted(long totalCompleted) {
+		this.totalCompleted = totalCompleted;
+	}
+
+	public long getTotalCompleted() {
+		return totalCompleted;
+	}
+
 }
 

Modified: trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties
===================================================================
--- trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties	2009-04-02 15:53:15 UTC (rev 695)
+++ trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties	2009-04-02 16:09:56 UTC (rev 696)
@@ -177,18 +177,15 @@
 
 
 
-MMQueueWorkerPool.MMQueueWorkerPool=MMQueueWorkerPool:\n Identifier:\ 
+MMQueueWorkerPool.MMQueueWorkerPool=QueueWorkerPool:\n Identifier:\ 
 MMQueueWorkerPool.queued=\n queued:\ 
-MMQueueWorkerPool.enqueues=\n enqueues:\ 
-MMQueueWorkerPool.dequeues=\n dequeues:\ 
-MMQueueWorkerPool.highwaterMark=\n highwaterMark:\ 
-MMQueueWorkerPool.totalEnqueues=\n totalEnqueues:\ 
-MMQueueWorkerPool.totalDequeues=\n totalDequeues:\ 
-MMQueueWorkerPool.totalHighwaterMark=\n totalHighwaterMark:\ 
+MMQueueWorkerPool.highestQueued=\n highestQueued:\ 
+MMQueueWorkerPool.totalSubmitted=\n totalSubmitted:\ 
+MMQueueWorkerPool.totalCompleted=\n totalCompleted:\ 
 MMQueueWorkerPool.threads=\n threads:\ 
+MMQueueWorkerPool.highestThreads=\n highestThreads:\ 
 
 
-
 MMRequest.MMRequest=MMRequest:\n Identifier:\ 
 MMRequest.requestID=\n requestID:\ 
 MMRequest.userName=\n userName:\ 

Modified: trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPool.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPool.java	2009-04-02 15:53:15 UTC (rev 695)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPool.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -42,8 +42,6 @@
 	
 	boolean hasWork();
 	
-	int getPoolSize();
-	
 	ScheduledFuture<?> schedule(Runnable command,
             long delay,
             TimeUnit unit);

Modified: trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java	2009-04-02 15:53:15 UTC (rev 695)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -149,8 +149,8 @@
 		}
 		
 		private volatile int activeCount;
-		private volatile int maxActiveCount;
-		private volatile int maxQueueSize;
+		private volatile int highestActiveCount;
+		private volatile int highestQueueSize;
 		private volatile boolean terminated;
 		private volatile int submittedCount;
 		private volatile int completedCount;
@@ -179,18 +179,18 @@
 				if (atMaxThreads) {
 					queue.add(command);
 					int queueSize = queue.size();
-					if (queueSize > maxQueueSize) {
+					if (queueSize > highestQueueSize) {
 						atMaxThreads = true;
-						maxQueueSize = queueSize;
+						highestQueueSize = queueSize;
 					}
 				} else {
 					activeCount++;
-					maxActiveCount = Math.max(activeCount, maxActiveCount);
+					highestActiveCount = Math.max(activeCount, highestActiveCount);
 				}
 			}
 			if (atMaxThreads) {
 				if (newMaxQueueSize && maximumPoolSize > 1) {
-					LogManager.logWarning(LogCommonConstants.CTX_POOLING, CommonPlugin.Util.getString("WorkerPool.Max_thread", maximumPoolSize, poolName, maxQueueSize)); //$NON-NLS-1$
+					LogManager.logWarning(LogCommonConstants.CTX_POOLING, CommonPlugin.Util.getString("WorkerPool.Max_thread", maximumPoolSize, poolName, highestQueueSize)); //$NON-NLS-1$
 				}
 				return;
 			}
@@ -250,7 +250,7 @@
 		}
 		
 		public int getPoolSize() {
-			return maximumPoolSize;
+			return activeCount;
 		}
 		
 		public boolean isTerminated() {
@@ -268,7 +268,7 @@
 		}
 		
 		public int getLargestPoolSize() {
-			return this.maxActiveCount;
+			return this.highestActiveCount;
 		}
 		
 		@Override
@@ -276,8 +276,9 @@
 			WorkerPoolStats stats = new WorkerPoolStats();
 			stats.name = poolName;
 			stats.queued = queue.size();
-			stats.threads = getPoolSize();
+			stats.highestQueued = highestQueueSize;
 			stats.activeThreads = getActiveCount();
+			stats.maxThreads = this.maximumPoolSize;
 			stats.totalSubmitted = getSubmittedCount();
 			stats.highestActiveThreads = getLargestPoolSize();
 			stats.totalCompleted = getCompletedCount();

Modified: trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolStats.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolStats.java	2009-04-02 15:53:15 UTC (rev 695)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolStats.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -33,7 +33,8 @@
 
     // Current state    
     public int queued;
-    public int threads;
+    int highestQueued;
+    public int maxThreads;
     public int activeThreads;
     public int highestActiveThreads;
     public long totalSubmitted;
@@ -42,15 +43,48 @@
     public String toString() {
         StringBuffer str = new StringBuffer();
         
-        str.append("WorkerPoolStats:\n"); //$NON-NLS-1$
+        str.append(name + " WorkerPoolStats:\n"); //$NON-NLS-1$
         str.append("\tqueued = " + queued); //$NON-NLS-1$
-        str.append("\tthreads = " + threads);     //$NON-NLS-1$
+        str.append("\thighestQueued = " + highestQueued); //$NON-NLS-1$
+        str.append("\tmaxThreads = " + maxThreads);     //$NON-NLS-1$
         str.append("\tactiveThreads = " + activeThreads);     //$NON-NLS-1$
         str.append("\thighestActiveThreads = " + highestActiveThreads);     //$NON-NLS-1$
         str.append("\ttotalSubmitted = " + totalSubmitted);     //$NON-NLS-1$
-        
+        str.append("\ttotalCompleted = " + totalCompleted);     //$NON-NLS-1$
         return str.toString();
     }
+    
+    public int getActiveThreads() {
+		return activeThreads;
+	}
+    
+    public int getHighestActiveThreads() {
+		return highestActiveThreads;
+	}
+    
+    public long getTotalCompleted() {
+		return totalCompleted;
+	}
+    
+    public long getTotalSubmitted() {
+		return totalSubmitted;
+	}
+    
+    public String getQueueName() {
+		return name;
+	}
+    
+    public int getQueued() {
+		return queued;
+	}
+    
+    public int getHighestQueued() {
+		return highestQueued;
+	}
+    
+    public int getMaxThreads() {
+		return maxThreads;
+	}
 
 }
 

Added: trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/AbstractStatisticsPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/AbstractStatisticsPanel.java	                        (rev 0)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/AbstractStatisticsPanel.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.console.ui.views.runtime;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JPanel;
+
+import com.metamatrix.toolbox.ui.widget.LabelWidget;
+import com.metamatrix.toolbox.ui.widget.TextFieldWidget;
+import com.metamatrix.toolbox.ui.widget.TitledBorder;
+
+public abstract class AbstractStatisticsPanel<T> extends JPanel {
+
+	protected TextFieldWidget[] textFieldWidgets;
+
+	/** Get title of the panel. */
+	public abstract String getTitle();
+
+	/** Get titles of the displayed fields. */
+	public abstract String[] getLabelStrings();
+
+	/** Populate the displayed fields from the specified VMStatistics. */
+	public abstract void populate(T vmStats);
+
+	public AbstractStatisticsPanel() {
+		super();
+	}
+
+	protected void init() {
+		this.setBorder(new TitledBorder(getTitle()));
+		GridBagLayout layout = new GridBagLayout();
+		this.setLayout(layout);
+
+		String[] labelStrings = getLabelStrings();
+		int nfields = labelStrings.length;
+
+		textFieldWidgets = new TextFieldWidget[nfields];
+		LabelWidget[] labelWidgets = new LabelWidget[nfields];
+
+		for (int i = 0; i < nfields; i++) {
+			labelWidgets[i] = new LabelWidget(labelStrings[i]);
+			textFieldWidgets[i] = new TextFieldWidget(0);
+			textFieldWidgets[i].setEditable(false);
+			this.add(labelWidgets[i]);
+		}
+
+		for (int i = 0; i < nfields; i++) {
+			this.add(textFieldWidgets[i]);
+		}
+
+		for (int i = 0; i < nfields; i++) {
+			layout.setConstraints(labelWidgets[i], new GridBagConstraints(0, i,
+					1, 1, 0.0, 0.0, GridBagConstraints.EAST,
+					GridBagConstraints.NONE, new Insets(4, 4, 4, 4), 0, 0));
+		}
+
+		for (int i = 0; i < nfields; i++) {
+			layout.setConstraints(textFieldWidgets[i],
+					new GridBagConstraints(1, i, 1, 1, 1.0, 0.0,
+							GridBagConstraints.CENTER,
+							GridBagConstraints.HORIZONTAL, new Insets(4, 4, 4,
+									4), 0, 0));
+		}
+	}
+
+}


Property changes on: trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/AbstractStatisticsPanel.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatistics.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatistics.java	2009-04-02 15:53:15 UTC (rev 695)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatistics.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.console.ui.views.runtime;
-
-public class QueueStatistics {
-    String queueName;
-    int currentSize;
-    int highestSize;
-    int totalEnqueued;
-    int totalDequeued;
-    int numThreads;
-    
-    public QueueStatistics(String qName, int curSize, int highSize,
-            int totEnqueued, int totDequeued, int numThreads) {
-        super();
-        queueName = qName;
-        currentSize = curSize;
-        highestSize = highSize;
-        totalEnqueued = totEnqueued;
-        totalDequeued = totDequeued;
-        this.numThreads = numThreads;
-   	}
-
-    public String getQueueName() {
-        return queueName;
-    }
-
-    public int getCurrentSize() {
-        return currentSize;
-    }
-
-    public int getHighestSize() {
-        return highestSize;
-    }
-
-    public int getTotalEnqueued() {
-        return totalEnqueued;
-    }
-    
-    public int getTotalDequeued() {
-        return totalDequeued;
-    }
-
-	public int getNumThreads() {
-		return numThreads;
-	}
-}

Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsDisplayHandler.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsDisplayHandler.java	2009-04-02 15:53:15 UTC (rev 695)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsDisplayHandler.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -37,6 +37,7 @@
 import javax.swing.JFrame;
 import javax.swing.JPanel;
 
+import com.metamatrix.common.queue.WorkerPoolStats;
 import com.metamatrix.console.ui.ViewManager;
 import com.metamatrix.console.util.StaticUtilities;
 
@@ -69,7 +70,7 @@
      * The caller must subsequently call QueueStatisticsFrame.show() to display the frame.
      */
     public QueueStatisticsFrame startDisplayForService(String serviceDisplayName, ServiceData sd,
-            QueueStatistics[] queueStatistics) {
+            WorkerPoolStats[] queueStatistics) {
         QueueStatisticsPanel panel = new QueueStatisticsPanel(caller,
                 sd, queueStatistics);
         statisticsFrame = new QueueStatisticsFrame(this,
@@ -83,7 +84,7 @@
     }
 
     public void refreshDisplayForService(String serviceDisplayName, ServiceData sd,
-            QueueStatistics[] queueStatistics) {
+            WorkerPoolStats[] queueStatistics) {
         QueueStatisticsFrame statisticsFrame =
                 (QueueStatisticsFrame)currentlyShowing.get(sd);
         QueueStatisticsPanel panel = statisticsFrame.getPanel();

Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsPanel.java	2009-04-02 15:53:15 UTC (rev 695)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsPanel.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -32,22 +32,19 @@
 import javax.swing.AbstractButton;
 import javax.swing.JPanel;
 
+import com.metamatrix.common.queue.WorkerPoolStats;
 import com.metamatrix.platform.admin.api.runtime.ServiceData;
-
 import com.metamatrix.toolbox.ui.widget.ButtonWidget;
-import com.metamatrix.toolbox.ui.widget.LabelWidget;
-import com.metamatrix.toolbox.ui.widget.TextFieldWidget;
-import com.metamatrix.toolbox.ui.widget.TitledBorder;
 
 public class QueueStatisticsPanel extends JPanel {
     private ServiceData serviceData;
     private QueueStatisticsRefreshRequestHandler controller;
-    private QueueStatistics[] queueStatistics;
+    private WorkerPoolStats[] queueStatistics;
     private SingleQueueStatisticsPanel[] subPanels;
     private AbstractButton closeButton;
     
     public QueueStatisticsPanel(QueueStatisticsRefreshRequestHandler ctrlr,
-            ServiceData sd, QueueStatistics[] queueStat) {
+            ServiceData sd, WorkerPoolStats[] queueStat) {
         super();
         controller = ctrlr;
         serviceData = sd;
@@ -75,11 +72,7 @@
         for (int i = 0; i < queueStatistics.length; i++) {
             subPanels[i] = new SingleQueueStatisticsPanel(
                     queueStatistics[i].getQueueName());
-            subPanels[i].populate(new Integer(queueStatistics[i].getCurrentSize()),
-                    new Integer(queueStatistics[i].getHighestSize()),
-                    new Integer(queueStatistics[i].getTotalEnqueued()),
-                    new Integer(queueStatistics[i].getTotalDequeued()),
-                    new Integer(queueStatistics[i].getNumThreads()));
+            subPanels[i].populate(queueStatistics[i]);
             statsPanel.add(subPanels[i]);
         }
         this.add(statsPanel);
@@ -97,7 +90,7 @@
     }
 
 
-    public void repopulate(QueueStatistics[] queueStat) {
+    public void repopulate(WorkerPoolStats[] queueStat) {
         queueStatistics = queueStat;
         for (int i = 0; i < subPanels.length; i++) {
             String subPanelQueueName = subPanels[i].getQueueName();
@@ -111,14 +104,9 @@
                 }
             }
             if (matchLoc < 0) {
-                subPanels[i].populate(null, null, null, null, null);
+                subPanels[i].populate(null);
             } else {
-                subPanels[i].populate(
-                        new Integer(queueStatistics[matchLoc].getCurrentSize()),
-                        new Integer(queueStatistics[matchLoc].getHighestSize()),
-                        new Integer(queueStatistics[matchLoc].getTotalEnqueued()),
-                        new Integer(queueStatistics[matchLoc].getTotalDequeued()),
-                        new Integer(queueStatistics[matchLoc].getNumThreads()));
+                subPanels[i].populate(queueStatistics[matchLoc]);
             }
         }
     }
@@ -130,108 +118,44 @@
 
 
 
-class SingleQueueStatisticsPanel extends JPanel {
+class SingleQueueStatisticsPanel extends AbstractStatisticsPanel<WorkerPoolStats> {
     private String queueName;
-    private TextFieldWidget currentSizeTFW;
-    private TextFieldWidget highestSizeTFW;
-    private TextFieldWidget totalEnqueuedTFW;
-    private TextFieldWidget totalDequeuedTFW;
-    private TextFieldWidget numThreadsTFW;
     
     public SingleQueueStatisticsPanel(String queName) {
         super();
         queueName = queName;
         init();
     }
-
-    private void init() {
-        this.setBorder(new TitledBorder("Queue: " + queueName));
-        GridBagLayout layout = new GridBagLayout();
-        this.setLayout(layout);
-        LabelWidget currentSizeLabel = new LabelWidget("Current size:");
-        LabelWidget highestSizeLabel = new LabelWidget("Highest size:");
-        LabelWidget totalEnqueuedLabel = new LabelWidget("Total enqueued:");
-        LabelWidget totalDequeuedLabel = new LabelWidget("Total dequeued:");
-        LabelWidget numThreadsLabel = new LabelWidget("Num. threads:");
-        currentSizeTFW = new TextFieldWidget(10);
-        currentSizeTFW.setEditable(false);
-        highestSizeTFW = new TextFieldWidget();
-        highestSizeTFW.setEditable(false);
-        totalEnqueuedTFW = new TextFieldWidget();
-        totalEnqueuedTFW.setEditable(false);
-        totalDequeuedTFW = new TextFieldWidget();
-        totalDequeuedTFW.setEditable(false);
-        numThreadsTFW = new TextFieldWidget();
-        numThreadsTFW.setEditable(false);
-        this.add(currentSizeLabel);
-        this.add(highestSizeLabel);
-        this.add(totalEnqueuedLabel);
-        this.add(totalDequeuedLabel);
-        this.add(numThreadsLabel);
-        this.add(currentSizeTFW);
-        this.add(highestSizeTFW);
-        this.add(totalEnqueuedTFW);
-        this.add(totalDequeuedTFW);
-        this.add(numThreadsTFW);
-        layout.setConstraints(currentSizeLabel, new GridBagConstraints(0, 0, 1, 1,
-                0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
-                new Insets(4, 4, 4, 4), 0, 0));
-        layout.setConstraints(highestSizeLabel, new GridBagConstraints(0, 1, 1, 1,
-                0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
-                new Insets(4, 4, 4, 4), 0, 0));
-        layout.setConstraints(totalEnqueuedLabel, new GridBagConstraints(0, 2, 1, 1,
-                0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
-                new Insets(4, 4, 4, 4), 0, 0));
-        layout.setConstraints(totalDequeuedLabel, new GridBagConstraints(0, 3, 1, 1,
-                0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
-                new Insets(4, 4, 4, 4), 0, 0));
-       	layout.setConstraints(numThreadsLabel, new GridBagConstraints(0, 4, 1, 1,
-       			0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
-       			new Insets(4, 4, 4, 4), 0, 0));
-        layout.setConstraints(currentSizeTFW, new GridBagConstraints(1, 0, 1, 1,
-                1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
-                new Insets(4, 4, 4, 4), 0, 0));
-        layout.setConstraints(highestSizeTFW, new GridBagConstraints(1, 1, 1, 1,
-                1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
-                new Insets(4, 4, 4, 4), 0, 0));
-        layout.setConstraints(totalEnqueuedTFW, new GridBagConstraints(1, 2, 1, 1,
-                1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
-                new Insets(4, 4, 4, 4), 0, 0));
-        layout.setConstraints(totalDequeuedTFW, new GridBagConstraints(1, 3, 1, 1,
-                1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
-                new Insets(4, 4, 4, 4), 0, 0));
-        layout.setConstraints(numThreadsTFW, new GridBagConstraints(1, 4, 1, 1,
-        		1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
-        		new Insets(4, 4, 4, 4), 0, 0));
+    
+    @Override
+    public String[] getLabelStrings() {
+    	return new String[] { 
+    			"Current size", 
+    			"Highest size",
+				"Total submitted", 
+				"Total completed", 
+				"Current threads",
+				"Highest threads" };
     }
+    
+    @Override
+    public String getTitle() {
+    	return "Queue: " + queueName;
+    }
 
-    public void populate(Integer currentSize, Integer highestSize,
-            Integer totalEnqueued, Integer totalDequeued, Integer numThreads) {
-        if (currentSize == null) {
-            currentSizeTFW.setText("");
+    public void populate(WorkerPoolStats stats) {
+        if (stats == null) {
+        	for (int i = 0; i < textFieldWidgets.length; i++) {
+        		textFieldWidgets[i].setText("");
+        	}
         } else {
-            currentSizeTFW.setText(currentSize.toString());
+        	textFieldWidgets[0].setText(String.valueOf(stats.getQueued()));
+        	textFieldWidgets[1].setText(String.valueOf(stats.getHighestQueued()));
+        	textFieldWidgets[2].setText(String.valueOf(stats.getTotalSubmitted()));
+        	textFieldWidgets[3].setText(String.valueOf(stats.getTotalCompleted()));
+        	textFieldWidgets[4].setText(String.valueOf(stats.getActiveThreads()));
+        	textFieldWidgets[5].setText(String.valueOf(stats.getHighestActiveThreads()));
         }
-        if (highestSize == null) {
-            highestSizeTFW.setText("");
-        } else {
-            highestSizeTFW.setText(highestSize.toString());
-        }
-        if (totalEnqueued == null) {
-            totalEnqueuedTFW.setText("");
-        } else {
-            totalEnqueuedTFW.setText(totalEnqueued.toString());
-        }
-        if (totalDequeued == null) {
-            totalDequeuedTFW.setText("");
-        } else {
-            totalDequeuedTFW.setText(totalDequeued.toString());
-		}
-        if (numThreads == null) {
-        	numThreadsTFW.setText("");
-        } else {
-        	numThreadsTFW.setText(numThreads.toString());
-        }
     }
 
     public String getQueueName() {

Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsRefreshRequestHandlerImp.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsRefreshRequestHandlerImp.java	2009-04-02 15:53:15 UTC (rev 695)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsRefreshRequestHandlerImp.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -68,7 +68,7 @@
                     sd = currentServiceData;
                 }
             }
-            QueueStatistics[] qss = getQueueStatistics(sd);
+            WorkerPoolStats[] qss = getQueueStatistics(sd);
             if (qss.length != 0) {
                 qsdh.refreshDisplayForService(sd.getName(),sd,qss);
             }
@@ -113,25 +113,16 @@
     }
 
 
-    public QueueStatistics[] getQueueStatistics(ServiceData sd) {
+    public WorkerPoolStats[] getQueueStatistics(ServiceData sd) {
         Collection serviceCollection = null;
         serviceCollection = getServiceCollection(sd);
-        QueueStatistics[] qss = new QueueStatistics[serviceCollection.size()];
+        WorkerPoolStats[] qss = new WorkerPoolStats[serviceCollection.size()];
         if (serviceCollection.isEmpty() ) {
             return qss;
         }
-        if (serviceCollection != null) {
-        	Iterator iter = serviceCollection.iterator();
-            int i = 0;
-            while ( i < serviceCollection.size()) {
-                if (iter.hasNext()) {
-                    WorkerPoolStats wps = (WorkerPoolStats)iter.next();
-                    qss[i] = new QueueStatistics(wps.name, wps.queued,
-                            0, (int)wps.totalSubmitted,
-                            (int)wps.totalCompleted, wps.threads);
-                    i++;
-                }
-            }
+    	Iterator iter = serviceCollection.iterator();
+        for (int i = 0; i < serviceCollection.size(); i++) {
+            qss[i] = (WorkerPoolStats)iter.next();
         }
         return qss;
     }

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-02 15:53:15 UTC (rev 695)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsPanel.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -32,21 +32,16 @@
 import javax.swing.AbstractButton;
 import javax.swing.JPanel;
 
-import com.metamatrix.common.queue.WorkerPoolStats;
 import com.metamatrix.platform.admin.api.runtime.ProcessData;
-import com.metamatrix.platform.vm.controller.SocketListenerStats;
 import com.metamatrix.platform.vm.controller.ProcessStatistics;
+import com.metamatrix.platform.vm.controller.SocketListenerStats;
 import com.metamatrix.toolbox.ui.widget.ButtonWidget;
-import com.metamatrix.toolbox.ui.widget.LabelWidget;
-import com.metamatrix.toolbox.ui.widget.TextFieldWidget;
-import com.metamatrix.toolbox.ui.widget.TitledBorder;
 
 public class VMStatisticsPanel extends JPanel{
     private ProcessData processData;
     private QueueStatisticsRefreshRequestHandler controller;
     private ProcessStatistics vmStatistics;
     private ProcessVMStatisticsPanel processPanel;
-    private QueueVMStatisticsPanel queuePanel;
     private SocketVMStatisticsPanel socketPanel;
     private AbstractButton closeButton;
     
@@ -88,13 +83,10 @@
         JPanel statsPanel = new JPanel(statsLayout);
         processPanel = new ProcessVMStatisticsPanel(vmStatistics.name);
         processPanel.populate(vmStatistics);
-        queuePanel = new QueueVMStatisticsPanel();
-        queuePanel.populate(vmStatistics);
         socketPanel = new SocketVMStatisticsPanel();
         socketPanel.populate(vmStatistics);
         
         statsPanel.add(processPanel);
-        statsPanel.add(queuePanel);
         statsPanel.add(socketPanel);
         
         this.add(statsPanel);
@@ -108,9 +100,6 @@
         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));
@@ -127,7 +116,6 @@
     public void repopulate(ProcessStatistics vmStat) {
         vmStatistics = vmStat;
         processPanel.populate(vmStatistics);
-        queuePanel.populate(vmStatistics);
         socketPanel.populate(vmStatistics);
     }
 
@@ -136,68 +124,7 @@
     }
 }//end QueueStatisticsPanel
 
-
-
-
-abstract class AbstractVMStatisticsPanel extends JPanel {
-
-    protected TextFieldWidget[] textFieldWidgets;
-    
-    /**Get title of the panel.*/
-    public abstract String getTitle();
-
-    /**Get titles of the displayed fields.*/    
-    public abstract String[] getLabelStrings();
-
-    /**Populate the displayed fields from the specified VMStatistics.*/    
-    public abstract void populate(ProcessStatistics vmStats);
-    
-    
-    public AbstractVMStatisticsPanel() {
-        super();
-    }
-
-    protected void init() {
-        this.setBorder(new TitledBorder(getTitle()));
-        GridBagLayout layout = new GridBagLayout();
-        this.setLayout(layout);
-        
-        String[] labelStrings = getLabelStrings();
-        int nfields = labelStrings.length;
-
-        textFieldWidgets = new TextFieldWidget[nfields];
-        LabelWidget[] labelWidgets = new LabelWidget[nfields]; 
-        
-        
-        for (int i=0; i<nfields; i++) {        
-            labelWidgets[i] = new LabelWidget(labelStrings[i]);
-            textFieldWidgets[i] = new TextFieldWidget(0);
-            textFieldWidgets[i].setEditable(false);
-            this.add(labelWidgets[i]);
-        }
-        
-        for (int i=0; i<nfields; i++) {
-            this.add(textFieldWidgets[i]);
-        }
-            
-        for (int i=0; i<nfields; i++) {
-            layout.setConstraints(labelWidgets[i], new GridBagConstraints(0, i, 1, 1,
-                0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE,
-                new Insets(4, 4, 4, 4), 0, 0));
-        }
-        
-        for (int i=0; i<nfields; i++) {
-            layout.setConstraints(textFieldWidgets[i], new GridBagConstraints(1, i, 1, 1,
-                1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
-                new Insets(4, 4, 4, 4), 0, 0));
-        }
-    }
-      
-}
-
-
-
-class ProcessVMStatisticsPanel extends AbstractVMStatisticsPanel {
+class ProcessVMStatisticsPanel extends AbstractStatisticsPanel<ProcessStatistics> {
     private String processName;
     
     private static final String[] labelStrings = {
@@ -232,55 +159,15 @@
     }   
 }
 
+class SocketVMStatisticsPanel extends AbstractStatisticsPanel<ProcessStatistics> {
 
-
-class QueueVMStatisticsPanel extends AbstractVMStatisticsPanel {
-
     private static final String[] labelStrings = {
-        "Current Size",
-        "Highest Size",
-        "Total Enqueued",
-        "Total Dequeued",
-        "Num. Threads",
-    };
-    
-    
-    public QueueVMStatisticsPanel() {
-        super();
-        init();
-    }
-
-    /**Get title of the panel.*/
-    public String getTitle() {
-        return "Socket Worker Queue";
-    }
-
-    /**Get titles of the displayed fields.*/    
-    public String[] getLabelStrings() {
-        return labelStrings;
-    }
-
-    /**Populate the displayed fields from the specified VMStatistics.*/    
-        public void populate(ProcessStatistics vmStats) {
-        WorkerPoolStats poolStats = vmStats.processPoolStats;
-        textFieldWidgets[0].setText(Integer.toString(poolStats.queued));        
-        textFieldWidgets[1].setText(Integer.toString(0));
-        textFieldWidgets[2].setText(Long.toString(poolStats.totalSubmitted));
-        textFieldWidgets[3].setText(Long.toString(poolStats.totalCompleted));        
-        textFieldWidgets[4].setText(Integer.toString(poolStats.threads));
-    }
-}
-
-
-class SocketVMStatisticsPanel extends AbstractVMStatisticsPanel {
-
-    private static final String[] labelStrings = {
-        "MetaMatrix Packets Read",
-        "MetaMatrix Packets Written",
+        "Message Packets Read",
+        "Message Packets Written",
         "Num. Sockets",
         "Highest Num. Sockets",
-        "Num. Client Connections",
-        "Highest Num. Client Connections",
+        "Current Thread Count",
+        "Highest Thread Count",
     };
     
     
@@ -305,9 +192,8 @@
         textFieldWidgets[1].setText(Long.toString(listenerStats.objectsWritten));
         textFieldWidgets[2].setText(Integer.toString(listenerStats.sockets));
         textFieldWidgets[3].setText(Integer.toString(listenerStats.maxSockets));
-        textFieldWidgets[4].setText("0"); //$NON-NLS-1$
-        textFieldWidgets[5].setText("0"); //$NON-NLS-1$
-        
+        textFieldWidgets[4].setText(Integer.toString(vmStats.processPoolStats.getActiveThreads()));
+        textFieldWidgets[5].setText(Integer.toString(vmStats.processPoolStats.getHighestActiveThreads()));
     }
 
 }
\ No newline at end of file

Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java	2009-04-02 15:53:15 UTC (rev 695)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -30,13 +30,14 @@
 import java.util.Properties;
 import java.util.Set;
 
+import org.teiid.dqp.internal.process.Util;
+
 import com.metamatrix.admin.api.exception.AdminComponentException;
 import com.metamatrix.admin.api.exception.AdminException;
 import com.metamatrix.admin.api.exception.AdminProcessingException;
 import com.metamatrix.admin.api.objects.AdminObject;
 import com.metamatrix.admin.api.objects.Cache;
 import com.metamatrix.admin.api.objects.ExtensionModule;
-import com.metamatrix.admin.api.objects.QueueWorkerPool;
 import com.metamatrix.admin.api.objects.Session;
 import com.metamatrix.admin.api.objects.SystemObject;
 import com.metamatrix.admin.objects.MMAdminObject;
@@ -46,7 +47,6 @@
 import com.metamatrix.admin.objects.MMLogConfiguration;
 import com.metamatrix.admin.objects.MMModel;
 import com.metamatrix.admin.objects.MMPropertyDefinition;
-import com.metamatrix.admin.objects.MMQueueWorkerPool;
 import com.metamatrix.admin.objects.MMRequest;
 import com.metamatrix.admin.objects.MMSession;
 import com.metamatrix.admin.objects.MMSystem;
@@ -58,7 +58,6 @@
 import com.metamatrix.common.config.api.ConnectorBinding;
 import com.metamatrix.common.log.config.BasicLogConfiguration;
 import com.metamatrix.common.object.PropertyDefinition;
-import com.metamatrix.common.queue.WorkerPoolStats;
 import com.metamatrix.common.util.crypto.CryptoException;
 import com.metamatrix.common.util.crypto.CryptoUtil;
 import com.metamatrix.common.vdb.api.VDBArchive;
@@ -223,7 +222,7 @@
         }
         else if (src != null && src instanceof com.metamatrix.common.queue.WorkerPoolStats) {
             com.metamatrix.common.queue.WorkerPoolStats stats = (com.metamatrix.common.queue.WorkerPoolStats)src;
-            return convertStats(stats);
+            return Util.convertStats(stats, stats.getQueueName());
         }
         else if (src != null && src instanceof ServerConnection) {
         	ServerConnection conn = (ServerConnection)src;
@@ -262,21 +261,6 @@
         return session;
     }
     
-    private QueueWorkerPool convertStats(final WorkerPoolStats src) {        
-        MMQueueWorkerPool pool = new MMQueueWorkerPool(new String[] {src.name}); 
-        pool.setDeployed(true);
-        pool.setRegistered(true);
-        pool.setDequeues(0);
-        pool.setEnqueues(0);
-        pool.setHighwaterMark(0);
-        pool.setQueued(src.queued);
-        pool.setThreads(src.threads);
-        pool.setTotalDequeues(src.totalCompleted);
-        pool.setTotalEnqueues(src.totalSubmitted);
-        pool.setTotalHighwaterMark(0);
-        return pool;
-    }
-    
     /**
      * Convert LogConfiguration to Admin Object 
      */

Added: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Util.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/Util.java	                        (rev 0)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Util.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.  Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.dqp.internal.process;
+
+import com.metamatrix.admin.objects.MMQueueWorkerPool;
+import com.metamatrix.common.queue.WorkerPoolStats;
+
+public class Util {
+
+	public static MMQueueWorkerPool convertStats(final WorkerPoolStats src, String ... identifier) {        
+	    MMQueueWorkerPool pool = new MMQueueWorkerPool(identifier); 
+	    pool.setDeployed(true);
+	    pool.setRegistered(true);
+	    pool.setQueued(src.getQueued());
+	    pool.setThreads(src.getActiveThreads());
+	    pool.setHighestQueued(src.getHighestQueued());
+	    pool.setHighestThreads(src.getHighestActiveThreads());
+	    pool.setTotalCompleted(src.getTotalCompleted());
+	    pool.setTotalSubmitted(src.getTotalSubmitted());
+	    return pool;
+	}
+
+}


Property changes on: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Util.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

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-02 15:53:15 UTC (rev 695)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -22,6 +22,8 @@
 
 package com.metamatrix.admin.server;
 
+import static org.teiid.dqp.internal.process.Util.*;
+
 import java.io.File;
 import java.io.IOException;
 import java.net.InetAddress;
@@ -93,10 +95,9 @@
 import com.metamatrix.platform.security.api.SessionToken;
 import com.metamatrix.platform.service.api.exception.ServiceException;
 import com.metamatrix.platform.util.ProductInfoConstants;
-import com.metamatrix.platform.vm.controller.SocketListenerStats;
 import com.metamatrix.platform.vm.controller.ProcessStatistics;
+import com.metamatrix.platform.vm.controller.SocketListenerStats;
 import com.metamatrix.server.serverapi.RequestInfo;
-
 /**
  * @since 4.3
  */
@@ -611,16 +612,7 @@
 		                               
 		                           WorkerPoolStats workerStats = statistics.processPoolStats;
 		                           if (workerStats != null) {
-		                               String[] workerPoolIdentifierParts = new String[] {hostName, processName, workerStats.name};
-		                               MMQueueWorkerPool workerPool = new MMQueueWorkerPool(workerPoolIdentifierParts);                          
-		                               workerPool.setDequeues(0);
-		                               workerPool.setEnqueues(0);
-		                               workerPool.setHighwaterMark(0);
-		                               workerPool.setThreads(workerStats.threads);
-		                               workerPool.setQueued(workerStats.queued);
-		                               workerPool.setTotalDequeues(workerStats.totalCompleted);
-		                               workerPool.setTotalEnqueues(workerStats.totalSubmitted);
-		                               workerPool.setTotalHighwaterMark(0);
+		                               MMQueueWorkerPool workerPool = convertStats(workerStats, hostName, processName, workerStats.name);
 		                               
 		                               process.setQueueWorkerPool(workerPool);
 		                           }
@@ -741,18 +733,7 @@
 			                binding.getDeployedName(),
 			                name};                
 			            if (identifierMatches(identifier, identifierParts)) {
-			                MMQueueWorkerPool pool = new MMQueueWorkerPool(identifierParts);
-			                pool.setDeployed(true);
-			                pool.setRegistered(true);
-			                pool.setDequeues(0);
-			                pool.setEnqueues(0);
-			                pool.setHighwaterMark(0);
-			                pool.setQueued(stats.queued);
-			                pool.setThreads(stats.threads);
-			                pool.setTotalDequeues(stats.totalCompleted);
-			                pool.setTotalEnqueues(stats.totalSubmitted);
-			                pool.setTotalHighwaterMark(0);
-			                
+			                MMQueueWorkerPool pool = convertStats(stats, identifierParts);
 			                results.add(pool);
 			            }
 			        }

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-02 15:53:15 UTC (rev 695)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java	2009-04-02 16:09:56 UTC (rev 696)
@@ -86,7 +86,7 @@
             LogManager.logDetail(SocketVMController.SOCKET_CONTEXT, "server = " + this.server + "binding to port:" + port); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 		
-        ChannelFactory factory = new NioServerSocketChannelFactory(bossService, workerPool, workerPool.getPoolSize());
+        ChannelFactory factory = new NioServerSocketChannelFactory(bossService, workerPool, maxWorkers);
         
         ServerBootstrap bootstrap = new ServerBootstrap(factory);
         this.channelHandler = new SSLAwareChannelHandler(this, engine, Thread.currentThread().getContextClassLoader());




More information about the teiid-commits mailing list