[teiid-commits] teiid SVN: r537 - in trunk: common-internal/src/main/java/com/metamatrix/common/config/api and 34 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Mar 4 18:29:09 EST 2009


Author: rareddy
Date: 2009-03-04 18:29:07 -0500 (Wed, 04 Mar 2009)
New Revision: 537

Added:
   trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/ProcessStatistics.java
   trunk/server/src/main/java/com/metamatrix/platform/registry/ProcessMonitor.java
   trunk/server/src/main/java/com/metamatrix/platform/registry/ProcessRegistryBinding.java
   trunk/server/src/main/java/com/metamatrix/platform/vm/api/controller/ProcessManagement.java
   trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java
Removed:
   trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/VMControllerID.java
   trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/VMStatistics.java
   trunk/server/src/main/java/com/metamatrix/platform/registry/VMMonitor.java
   trunk/server/src/main/java/com/metamatrix/platform/registry/VMRegistryBinding.java
   trunk/server/src/main/java/com/metamatrix/platform/vm/api/controller/VMControllerInterface.java
   trunk/server/src/main/java/com/metamatrix/platform/vm/controller/VMController.java
Modified:
   trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorBinding.java
   trunk/client/src/main/java/com/metamatrix/admin/objects/MMDQP.java
   trunk/client/src/main/java/com/metamatrix/admin/objects/MMProcess.java
   trunk/common-internal/src/main/java/com/metamatrix/common/config/api/Configuration.java
   trunk/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfiguration.java
   trunk/common-internal/src/main/java/com/metamatrix/common/util/VMNaming.java
   trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/RuntimeStateAdminAPI.java
   trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/runtime/ProcessData.java
   trunk/common-internal/src/main/java/com/metamatrix/platform/service/api/ServiceID.java
   trunk/console/src/main/java/com/metamatrix/console/models/RuntimeMgmtManager.java
   trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/ProcessMgmtPanel.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/VMStatisticsDisplayHandler.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/AbstractAdminImpl.java
   trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
   trunk/server/src/main/java/com/metamatrix/admin/server/ServerRuntimeStateAdminImpl.java
   trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/SocketVMController.java
   trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java
   trunk/server/src/main/java/com/metamatrix/metadata/runtime/vdb/defn/VDBCreation.java
   trunk/server/src/main/java/com/metamatrix/platform/admin/api/runtime/SystemStateBuilder.java
   trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java
   trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIImpl.java
   trunk/server/src/main/java/com/metamatrix/platform/registry/ClusteredRegistryState.java
   trunk/server/src/main/java/com/metamatrix/platform/registry/ServiceRegistryBinding.java
   trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditMessage.java
   trunk/server/src/main/java/com/metamatrix/platform/security/audit/destination/DatabaseAuditDestination.java
   trunk/server/src/main/java/com/metamatrix/platform/security/audit/destination/SingleFileAuditDestination.java
   trunk/server/src/main/java/com/metamatrix/platform/security/audit/format/DelimitedAuditMessageFormat.java
   trunk/server/src/main/java/com/metamatrix/platform/security/audit/format/ReadableAuditMessageFormat.java
   trunk/server/src/main/java/com/metamatrix/platform/service/api/ServiceInterface.java
   trunk/server/src/main/java/com/metamatrix/platform/service/controller/AbstractService.java
   trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java
   trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ServerEvents.java
   trunk/server/src/main/java/com/metamatrix/server/Configuration.java
   trunk/server/src/main/java/com/metamatrix/server/HostController.java
   trunk/server/src/main/java/com/metamatrix/server/HostManagement.java
   trunk/server/src/main/java/com/metamatrix/server/LogApplicationInfo.java
   trunk/server/src/main/java/com/metamatrix/server/Main.java
   trunk/server/src/main/java/com/metamatrix/server/ServerGuiceModule.java
   trunk/server/src/main/java/com/metamatrix/server/ServiceManager.java
   trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java
   trunk/server/src/main/java/com/metamatrix/server/dqp/config/PlatformConfigSource.java
   trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformBufferService.java
   trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformTransactionService.java
   trunk/server/src/main/java/com/metamatrix/server/query/service/QueryService.java
   trunk/server/src/main/resources/com/metamatrix/platform/i18n.properties
   trunk/server/src/test/java/com/metamatrix/admin/server/FakeCacheAdmin.java
   trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfiguration.java
   trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java
   trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java
   trunk/server/src/test/java/com/metamatrix/admin/server/FakeRuntimeStateAdminAPIHelper.java
   trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerAdminImpl.java
   trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java
   trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java
   trunk/server/src/test/java/com/metamatrix/admin/server/TestServerRuntimeStateAdminImpl.java
   trunk/server/src/test/java/com/metamatrix/platform/registry/FakeRegistryUtil.java
   trunk/server/src/test/java/com/metamatrix/platform/registry/TestClusteredRegistryState.java
   trunk/server/src/test/java/com/metamatrix/platform/registry/TestServiceRegistryBinding.java
   trunk/server/src/test/java/com/metamatrix/platform/service/controller/FakeService.java
   trunk/server/src/test/java/com/metamatrix/platform/service/proxy/TestProxies.java
Log:
TEIID-394: VMControllerID is removed. Host Name + Process Name is used as identifier for any process identification. Also, VM name is overloaded with JVM, all the references to VMName has been changed to more consistent "Process Name".

Modified: trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorBinding.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorBinding.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectorBinding.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -42,9 +42,7 @@
     private int currentState;
     private Date stateChangedTime;
     private long serviceID = -1;
-    private long processID = -1;
     
-    
 	
     /**
      * Constructor.
@@ -200,22 +198,12 @@
      * @return Returns the processID.
      * @since 4.3
      */
-    public long getProcessID() {
-        return this.processID;
+    public String getProcessName() {
+        return identifierParts[1];
     }
 
-
     
     /** 
-     * @param processID The processID to set.
-     * @since 4.3
-     */
-    public void setProcessID(long processID) {
-        this.processID = processID;
-    }
-
-    
-    /** 
      * @return Returns the hostName.
      * @since 4.3
      */

Modified: trunk/client/src/main/java/com/metamatrix/admin/objects/MMDQP.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMDQP.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMDQP.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -42,9 +42,6 @@
     private int currentState;
     private Date stateChangedTime;
     private long serviceID = -1;
-    private long processID = -1;
-
-    
   
     
     /**
@@ -187,23 +184,11 @@
      * @return Returns the processID.
      * @since 4.3
      */
-    public long getProcessID() {
-        return this.processID;
+    public String getProcessName() {
+        return this.identifierParts[1];
     }
-
-
     
     /** 
-     * @param processID The processID to set.
-     * @since 4.3
-     */
-    public void setProcessID(long processID) {
-        this.processID = processID;
-    }
-
-
-    
-    /** 
      * @return Returns the hostName.
      * @since 4.3
      */

Modified: trunk/client/src/main/java/com/metamatrix/admin/objects/MMProcess.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMProcess.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMProcess.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -42,8 +42,6 @@
 	private int threadCount = 0;
 	private long totalMemory = 0;
     
-    private long processID = -1;
-    
     private int sockets = 0;
     private int maxSockets = 0;
     private int virtualSockets = 0;
@@ -331,22 +329,11 @@
      * @return Returns the processID.
      * @since 4.3
      */
-    public long getProcessID() {
-        return this.processID;
+    public String getProcessName() {
+        return identifierParts[1];
     }
-
-
     
     /** 
-     * @param processID The processID to set.
-     * @since 4.3
-     */
-    public void setProcessID(long processID) {
-        this.processID = processID;
-    }
-
-    
-    /** 
      * @return Returns the hostName.
      * @since 4.3
      */

Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/api/Configuration.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/api/Configuration.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/api/Configuration.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -207,7 +207,7 @@
      *  @param hostID is the host the VM was deployed to.
      *  @return DeployedComponent
      */
-    VMComponentDefn getVMForHost(String hostname, String vmname) ;
+    VMComponentDefn getVMForHost(String hostname, String processName) ;
 
 
     /**

Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfiguration.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfiguration.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/model/BasicConfiguration.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -674,13 +674,9 @@
 
         for (Iterator it = dcs.iterator(); it.hasNext(); ) {
             dc = (VMComponentDefn) it.next();
-            // is the component from the same host
+            // 	is the component from the same host
                 if (dc.getID().equals(vmID)) {
-//                ComponentDefn comp = dc.getDeployedComponentDefn(this);
-//                if (comp instanceof VMComponentDefn) {
-//                    if (dc.getName().equalsIgnoreCase(vmname)) {
-                        return dc;
-//                    }
+                	return dc;
                 }
         }
       
@@ -723,7 +719,7 @@
 	    return getVMsForHost(id);
     }
     
-    public VMComponentDefn getVMForHost(String hostname, String vmname)  {
+    public VMComponentDefn getVMForHost(String hostname, String processName)  {
 
         Collection dcs = getVMsForHost(hostname);
 
@@ -732,7 +728,7 @@
         for (Iterator it = dcs.iterator(); it.hasNext(); ) {
             dc = (VMComponentDefn) it.next();
             // is the component from the same host
-                if (dc.getID().getName().equalsIgnoreCase(vmname)) {
+                if (dc.getID().getName().equalsIgnoreCase(processName)) {
                         return dc;
                 }
         }

Modified: trunk/common-internal/src/main/java/com/metamatrix/common/util/VMNaming.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/util/VMNaming.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/util/VMNaming.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -48,17 +48,17 @@
     private static String BIND_ADDRESS = "";//$NON-NLS-1$
     
     /*
-     * VMNAME refers to the name of the process that is currently running.
+     * Process Name refers to the name of the process that is currently running.
      */
-    private static String VMNAME = "";//$NON-NLS-1$
+    private static String PROCESS_NAME = "";//$NON-NLS-1$
 
     
-    public static String getVMName() {
-        return VMNAME;
+    public static String getProcessName() {
+        return PROCESS_NAME;
     }
     
-    public static void setVMName(String vmname) {
-    	VMNAME = vmname;
+    public static void setProcessName(String processName) {
+    	PROCESS_NAME = processName;
     }
     
     public static String getConfigName() {
@@ -106,7 +106,7 @@
     public static String getHostInfo() {
         StringBuffer sb = new StringBuffer("Host Information"); //$NON-NLS-1$ 
         sb.append('\n');
-        sb.append(" VM Name:               " + VMNAME ); //$NON-NLS-1$
+        sb.append(" VM Name:               " + PROCESS_NAME ); //$NON-NLS-1$
         sb.append('\n');
         sb.append(" Hostname:              " + HOST_ADDRESS.getCanonicalHostName() ); //$NON-NLS-1$
         sb.append('\n');

Modified: trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/RuntimeStateAdminAPI.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/RuntimeStateAdminAPI.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/RuntimeStateAdminAPI.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -36,8 +36,7 @@
 import com.metamatrix.platform.admin.api.runtime.PscID;
 import com.metamatrix.platform.admin.api.runtime.SystemState;
 import com.metamatrix.platform.service.api.ServiceID;
-import com.metamatrix.platform.vm.controller.VMControllerID;
-import com.metamatrix.platform.vm.controller.VMStatistics;
+import com.metamatrix.platform.vm.controller.ProcessStatistics;
 
 public interface RuntimeStateAdminAPI extends SubSystemAdminAPI {
 
@@ -76,23 +75,6 @@
                       MetaMatrixComponentException;
 
     /**
-     * Return all processes running in mm system.
-     * 
-     * @param callerSessionID
-     *            ID of the caller's current session.
-     * @return List of VMControllerIDs.
-     * @throws AuthorizationException
-     *             if caller is not authorized to perform this method.
-     * @throws InvalidSessionException
-     *             if the <code>callerSessionID</code> is not valid or is expired.
-     * @throws MetaMatrixComponentException
-     *             if an error occurred in communicating with a component.
-     */
-    List getProcesses() throws AuthorizationException,
-                       InvalidSessionException,
-                       MetaMatrixComponentException;
-
-    /**
      * Return all hosts running in mm system.
      * 
      * @param callerSessionID
@@ -159,30 +141,11 @@
      * @throws MetaMatrixComponentException
      *             if an error occurred in communicating with a component.
      */
-    void stopProcess(VMControllerID processID) throws AuthorizationException,
+    void stopProcess(String hostname, String processName, boolean now) throws AuthorizationException,
                                               InvalidSessionException,
                                               MetaMatrixComponentException;
 
     /**
-     * Stop process now.
-     * 
-     * @param callerSessionID
-     *            ID of the caller's current session.
-     * @param processID
-     *            <code>VMControllerID</code>.
-     * @throws AuthorizationException
-     *             if caller is not authorized to perform this method.
-     * @throws InvalidSessionException
-     *             if the <code>callerSessionID</code> is not valid or is expired.
-     * @throws MetaMatrixComponentException
-     *             if an error occurred in communicating with a component.
-     */
-    void stopProcessNow(VMControllerID processID) throws AuthorizationException,
-                                                 InvalidSessionException,
-                                                 MetaMatrixComponentException;
-
-
-    /**
      * Gracefully shutdown server waiting for work to complete.
      * 
      * @param callerSessionID
@@ -433,8 +396,7 @@
      * @throws MetaMatrixComponentException
      *             if an error occurred in communicating with a component.
      */
-    void setLoggingConfiguration(LogConfiguration logConfig,
-                                 VMControllerID vmID) throws AuthorizationException,
+    void setLoggingConfiguration(LogConfiguration logConfig, String hostName, String processName) throws AuthorizationException,
                                                      InvalidSessionException,
                                                      MetaMatrixComponentException;
 
@@ -489,7 +451,7 @@
      * @throws MetaMatrixComponentException
      *             if an error occurred in communicating with a component.
      */
-    VMStatistics getVMStatistics(VMControllerID vmID) throws AuthorizationException,
+    ProcessStatistics getProcessStatistics(String hostName, String processName) throws AuthorizationException,
                                                      InvalidSessionException,
                                                      MetaMatrixComponentException;
 
@@ -555,36 +517,6 @@
                                   MetaMatrixComponentException;
 
     /**
-     * Retrieve the VMControllerID by name
-     * 
-     * @param hostName
-     *            name of the host of the VM
-     * @param processName
-     *            name of the process of the VM
-     * @return <code>VMControllerID</code>
-     * @since 4.2.1
-     */
-    VMControllerID getVMControllerIDByName(String hostName,
-                                           String processName) throws AuthorizationException,
-                                                              InvalidSessionException,
-                                                              MetaMatrixComponentException;
-
-    /**
-     * Get the Process name of the VM by ID and HostName
-     * 
-     * @param id
-     *            VMID of the VM Process
-     * @param hostName
-     *            host name of the VM Process
-     * @return String name of the VM Process
-     * @since 4.2.1
-     */
-    String getVMName(long id,
-                     String hostName) throws AuthorizationException,
-                                     InvalidSessionException,
-                                     MetaMatrixComponentException;
-    
-    /**
      * Get the log entries that match the specified criteria. 
      * @param startTime
      * @param endTime  If null, will ignore this criterion.

Modified: trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/runtime/ProcessData.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/runtime/ProcessData.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/common-internal/src/main/java/com/metamatrix/platform/admin/api/runtime/ProcessData.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -27,8 +27,6 @@
 import com.metamatrix.common.config.api.ComponentDefnID;
 import com.metamatrix.core.util.HashCodeUtil;
 
-import com.metamatrix.platform.vm.controller.VMControllerID;
-
 /**
  * This class is a container for ServiceRegistryBinding objects for
  * all the services running in this VM
@@ -38,9 +36,6 @@
     /** Map of ServiceID to ServiceRegistryBindings */
     private Collection pscs;
 
-    /** ID of VMControllerID */
-    private VMControllerID processID;
-
     /** defines vm in configuration */
     private ComponentDefnID defnID;
 
@@ -56,10 +51,9 @@
      * @param vmController VMController implementation
      * @param hostName Name of host VM is running on
      */
-    public ProcessData(VMControllerID processID, ComponentDefnID defnID, String hostName, Collection pscs, String processName, String port, boolean deployed, boolean registered) {
+    public ProcessData(String hostName, String processName, String port, ComponentDefnID defnID,  Collection pscs,  boolean deployed, boolean registered) {
         super(processName, deployed, registered);
         this.hostName = hostName;
-        this.processID = processID;
         this.defnID = defnID;
         this.pscs = pscs;
         this.port = port;
@@ -75,15 +69,6 @@
 
 
     /**
-     * Return VMControllerID that this binding represents.
-     *
-     * @return VMControllerID
-     */
-    public VMControllerID getProcessID() {
-        return processID;
-    }
-
-    /**
      * Return ComponentDefnID for VMController.
      *
      * @return ComponentDefnID
@@ -106,7 +91,9 @@
     private void computeHashCode() {
         hashCode = 0;
         hashCode = HashCodeUtil.hashCode(hashCode, defnID);
-        hashCode = HashCodeUtil.hashCode(hashCode, processID);
+        hashCode = HashCodeUtil.hashCode(hashCode, getName());
+        hashCode = HashCodeUtil.hashCode(hashCode, hostName);
+        
     }
 
     /**
@@ -132,9 +119,7 @@
             if (this.defnID == null && that.getComponentDefnID() != null) return false;
             if (that.getComponentDefnID() == null && this.defnID != null) return false;
             if (this.defnID == null && that.getComponentDefnID() == null) {
-                if (this.processID == null && that.getProcessID() != null) return false;
-                if (that.getProcessID() == null && this.processID != null) return false;
-                return processID.equals(that.getProcessID());
+                return this.hostName.equals(that.hostName) && this.getName().equals(that.getName());
             }
             return defnID.equals(that.getComponentDefnID());
         }

Modified: trunk/common-internal/src/main/java/com/metamatrix/platform/service/api/ServiceID.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/platform/service/api/ServiceID.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/common-internal/src/main/java/com/metamatrix/platform/service/api/ServiceID.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -22,29 +22,26 @@
 
 package com.metamatrix.platform.service.api;
 
-import com.metamatrix.platform.vm.controller.VMControllerID;
 import java.io.Serializable;
 
 public class ServiceID implements Serializable {
 
     private long id;
-    private VMControllerID vmControllerID;
+    private String hostName;
+    private String processName;
 
-    public ServiceID(long id, VMControllerID vmControllerID) {
+    public ServiceID(long id, String hostName, String processName) {
         this.id = id;
-        this.vmControllerID = vmControllerID;
+        this.hostName = hostName;
+        this.processName = processName;
     }
 
-    public VMControllerID getVMControllerID() {
-        return this.vmControllerID;
-    }
-
     public String getHostName() {
-        return vmControllerID.getHostName();
+        return this.hostName;
     }
 
-    public String toString() {
-        return "ServiceID<"+id+"> " + vmControllerID; //$NON-NLS-1$ //$NON-NLS-2$
+    public String getProcessName() {
+    	return this.processName;
     }
 
     public long getID() {
@@ -80,5 +77,8 @@
         return (int) this.id;
     }
 
+    public String toString() {
+        return "Service<"+id+"|"+this.hostName+"|"+processName+">"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+    }
 }
 

Copied: trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/ProcessStatistics.java (from rev 534, trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/VMStatistics.java)
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/ProcessStatistics.java	                        (rev 0)
+++ trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/ProcessStatistics.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -0,0 +1,44 @@
+/*
+ * 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.platform.vm.controller;
+
+import java.io.Serializable;
+
+import com.metamatrix.common.queue.WorkerPoolStats;
+
+/**
+ * VM statistics including: total memory, free memory, number of threads.
+ */
+public class ProcessStatistics implements Serializable {
+    public String name;
+    public long totalMemory = 0;
+    public long freeMemory = 0;
+    public int threadCount = 0;
+    
+    
+    public SocketListenerStats socketListenerStats = new SocketListenerStats();
+    
+    public WorkerPoolStats processPoolStats = new WorkerPoolStats();
+}
+
+

Deleted: trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/VMControllerID.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/VMControllerID.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/VMControllerID.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -1,65 +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.platform.vm.controller;
-
-import java.io.Serializable;
-
-public class VMControllerID implements Serializable {
-    
-	private long id;
-    private String hostName;
-
-    public VMControllerID(long id, String hostName) {
-        this.id = id;
-        this.hostName = hostName.toUpperCase();
-    }
-
-    public String getHostName() {
-        return hostName;
-    }
-
-    public long getID() {
-        return id;
-    }
-
-    public String toString() {
-        return "VMControllerID<"+id+">:"+hostName; //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    public boolean equals(Object obj) {
-		if(this == obj) {
-			return true;
-		}
-		if(!(obj instanceof VMControllerID)) {
-			return false;
-		}
-		return ((VMControllerID)obj).getID() == getID();
-    }
-
-    public int hashCode() {
-        return (int) this.id;
-    }
-}
-
-
-

Deleted: trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/VMStatistics.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/VMStatistics.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/common-internal/src/main/java/com/metamatrix/platform/vm/controller/VMStatistics.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -1,44 +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.platform.vm.controller;
-
-import java.io.Serializable;
-
-import com.metamatrix.common.queue.WorkerPoolStats;
-
-/**
- * VM statistics including: total memory, free memory, number of threads.
- */
-public class VMStatistics implements Serializable {
-    public String name;
-    public long totalMemory = 0;
-    public long freeMemory = 0;
-    public int threadCount = 0;
-    
-    
-    public SocketListenerStats socketListenerStats = new SocketListenerStats();
-    
-    public WorkerPoolStats processPoolStats = new WorkerPoolStats();
-}
-
-

Modified: trunk/console/src/main/java/com/metamatrix/console/models/RuntimeMgmtManager.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/models/RuntimeMgmtManager.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/console/src/main/java/com/metamatrix/console/models/RuntimeMgmtManager.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -349,7 +349,7 @@
         throws ExternalException {
         refreshImpl();
         try {
-        	getAPI().stopProcess(theProcess.getProcessID());
+        	getAPI().stopProcess(theProcess.getHostName(), theProcess.getName(), true);
         }
         catch (Exception theException) {
             theException.printStackTrace();
@@ -361,7 +361,7 @@
         throws ExternalException {
         refreshImpl();
         try {
-        	getAPI().stopProcessNow(theProcess.getProcessID());
+        	getAPI().stopProcess(theProcess.getHostName(), theProcess.getName(), true);
         }
         catch (Exception theException) {
             theException.printStackTrace();

Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/ProcessMgmtPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/ProcessMgmtPanel.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/ProcessMgmtPanel.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -163,9 +163,8 @@
                 Vector row = new Vector(HDRS.length);
                 row.setSize(HDRS.length);
                 row.setElementAt(process, PROC_COL);
-                row.setElementAt(process.getProcessID(), ID_COL);
-                row.setElementAt(
-                    new Boolean(process.isRegistered()), REGISTERED_COL);
+                row.setElementAt(process.getName(), ID_COL);
+                row.setElementAt(new Boolean(process.isRegistered()), REGISTERED_COL);
                 Integer[] counts = manager.getPscCounts(process);
                 row.setElementAt(counts[0], NUM_REG_PSC_COL);
                 row.setElementAt(counts[1], NUM_NOT_REG_PSC_COL);

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-03-03 23:48:40 UTC (rev 536)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/QueueStatisticsRefreshRequestHandlerImp.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -42,8 +42,7 @@
 import com.metamatrix.platform.admin.api.RuntimeStateAdminAPI;
 import com.metamatrix.platform.admin.api.runtime.ProcessData;
 import com.metamatrix.platform.admin.api.runtime.ServiceData;
-import com.metamatrix.platform.vm.controller.VMControllerID;
-import com.metamatrix.platform.vm.controller.VMStatistics;
+import com.metamatrix.platform.vm.controller.ProcessStatistics;
 
 public class QueueStatisticsRefreshRequestHandlerImp 
 		implements QueueStatisticsRefreshRequestHandler, ServiceStateConstants{
@@ -83,7 +82,7 @@
 	public void refreshProcessRequested(ProcessData pd) {
         try {
 			if (getProcessStatistics(pd) != null) {
-                VMStatistics vmstats = getProcessStatistics(pd);
+                ProcessStatistics vmstats = getProcessStatistics(pd);
                 vmsdh.refreshDisplayForProcess(pd.getName(), pd, vmstats);
             }
         } catch (Exception theException) {
@@ -185,9 +184,9 @@
         return sqs;
     }
 
-	public VMStatistics getProcessStatistics(ProcessData pd) {
+	public ProcessStatistics getProcessStatistics(ProcessData pd) {
         try {
-            return getAdminAPI().getVMStatistics(pd.getProcessID());
+            return getAdminAPI().getProcessStatistics(pd.getHostName(), pd.getName());
         } catch (Exception theException) {
             displayException(theException, "QueueStatisticsRefreshRequestHandlerImp.getVMStatistics"); //$NON-NLS-1$
             return null;

Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsDisplayHandler.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsDisplayHandler.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsDisplayHandler.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -40,7 +40,7 @@
 import com.metamatrix.console.util.StaticUtilities;
 
 import com.metamatrix.platform.admin.api.runtime.ProcessData;
-import com.metamatrix.platform.vm.controller.VMStatistics;
+import com.metamatrix.platform.vm.controller.ProcessStatistics;
 
 public class VMStatisticsDisplayHandler {
     public  QueueStatisticsRefreshRequestHandler caller;
@@ -67,7 +67,7 @@
      * The caller must subsequently call VMStatisticsFrame.show() to display the frame.
      */
     public VMStatisticsFrame startDisplayForProcess(String processDisplayName, ProcessData pd,
-            VMStatistics vmstatistics) {
+            ProcessStatistics vmstatistics) {
         VMStatisticsPanel panel = new VMStatisticsPanel(caller, pd, vmstatistics);
         statisticsFrame = new VMStatisticsFrame(this, processDisplayName, pd, 
         		panel);
@@ -80,7 +80,7 @@
     }
 
     public void refreshDisplayForProcess(String processDisplayName, ProcessData pd,
-            VMStatistics vmstatistics) {
+            ProcessStatistics vmstatistics) {
         VMStatisticsFrame statisticsFrame =
                 (VMStatisticsFrame) currentlyShowing.get(pd);
         VMStatisticsPanel panel = statisticsFrame.getPanel();

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-03-03 23:48:40 UTC (rev 536)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/runtime/VMStatisticsPanel.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -35,7 +35,7 @@
 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.VMStatistics;
+import com.metamatrix.platform.vm.controller.ProcessStatistics;
 import com.metamatrix.toolbox.ui.widget.ButtonWidget;
 import com.metamatrix.toolbox.ui.widget.LabelWidget;
 import com.metamatrix.toolbox.ui.widget.TextFieldWidget;
@@ -44,14 +44,14 @@
 public class VMStatisticsPanel extends JPanel{
     private ProcessData processData;
     private QueueStatisticsRefreshRequestHandler controller;
-    private VMStatistics vmStatistics;
+    private ProcessStatistics vmStatistics;
     private ProcessVMStatisticsPanel processPanel;
     private QueueVMStatisticsPanel queuePanel;
     private SocketVMStatisticsPanel socketPanel;
     private AbstractButton closeButton;
     
     public VMStatisticsPanel(QueueStatisticsRefreshRequestHandler ctrlr,
-            ProcessData pd, VMStatistics vmStats) {
+            ProcessData pd, ProcessStatistics vmStats) {
         super();
         controller = ctrlr;
         processData = pd;
@@ -124,7 +124,7 @@
                 new Insets(4, 4, 4, 4), 0, 0));
     }
 
-    public void repopulate(VMStatistics vmStat) {
+    public void repopulate(ProcessStatistics vmStat) {
         vmStatistics = vmStat;
         processPanel.populate(vmStatistics);
         queuePanel.populate(vmStatistics);
@@ -150,7 +150,7 @@
     public abstract String[] getLabelStrings();
 
     /**Populate the displayed fields from the specified VMStatistics.*/    
-    public abstract void populate(VMStatistics vmStats);
+    public abstract void populate(ProcessStatistics vmStats);
     
     
     public AbstractVMStatisticsPanel() {
@@ -225,7 +225,7 @@
     }
 
     /**Populate the displayed fields from the specified VMStatistics.*/    
-    public void populate(VMStatistics vmStats) {
+    public void populate(ProcessStatistics vmStats) {
         textFieldWidgets[0].setText(Long.toString(vmStats.totalMemory));
         textFieldWidgets[1].setText(Long.toString(vmStats.freeMemory));        
         textFieldWidgets[2].setText(Integer.toString(vmStats.threadCount));
@@ -261,7 +261,7 @@
     }
 
     /**Populate the displayed fields from the specified VMStatistics.*/    
-        public void populate(VMStatistics vmStats) {
+        public void populate(ProcessStatistics vmStats) {
         WorkerPoolStats poolStats = vmStats.processPoolStats;
         textFieldWidgets[0].setText(Integer.toString(poolStats.queued));        
         textFieldWidgets[1].setText(Integer.toString(0));
@@ -299,7 +299,7 @@
         return labelStrings;
     }
 
-    public void populate(VMStatistics vmStats) {        
+    public void populate(ProcessStatistics vmStats) {        
         SocketListenerStats listenerStats = vmStats.socketListenerStats;
         textFieldWidgets[0].setText(Long.toString(listenerStats.objectsRead));
         textFieldWidgets[1].setText(Long.toString(listenerStats.objectsWritten));

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-03-03 23:48:40 UTC (rev 536)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/BaseAdmin.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -300,7 +300,7 @@
      * @since 4.3
      */
     private com.metamatrix.admin.api.objects.ConnectorBinding convertConnectorType(final com.metamatrix.common.config.api.ConnectorBinding src, final Object parent) {
-        MMConnectorBinding binding = new MMConnectorBinding(new String[] {src.getDeployedName()});
+        MMConnectorBinding binding = new MMConnectorBinding(new String[] {src.getDeployedName(), "Embedded"}); //$NON-NLS-1$
         
         binding.setConnectorTypeName(src.getComponentTypeID().getFullName());
         binding.setCreated(src.getCreatedDate());
@@ -310,7 +310,6 @@
         binding.setEnabled(src.isEnabled());
         binding.setLastUpdated(src.getLastChangedDate());
         binding.setLastUpdatedBy(src.getLastChangedBy());
-        binding.setProcessID(0); // TODO:
         binding.setProperties(src.getProperties());
         binding.setRegistered(true);
         binding.setRoutingUUID(src.getRoutingUUID());

Modified: trunk/server/src/main/java/com/metamatrix/admin/server/AbstractAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/AbstractAdminImpl.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/AbstractAdminImpl.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -83,8 +83,7 @@
 import com.metamatrix.platform.security.api.service.SessionServiceInterface;
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.service.api.exception.ServiceException;
-import com.metamatrix.platform.vm.api.controller.VMControllerInterface;
-import com.metamatrix.platform.vm.controller.VMControllerID;
+import com.metamatrix.platform.vm.api.controller.ProcessManagement;
 import com.metamatrix.server.admin.apiimpl.RuntimeMetadataHelper;
 import com.metamatrix.server.query.service.QueryServiceInterface;
 
@@ -412,19 +411,18 @@
     
     protected void shutDownConnectorBinding(MMConnectorBinding binding, boolean stopNow) throws AdminException {
             
-        VMControllerID vmControllerID = new VMControllerID(binding.getProcessID(), binding.getHostName()); 
-        ServiceID serviceID = new ServiceID(binding.getServiceID(), vmControllerID);
+        ServiceID serviceID = new ServiceID(binding.getServiceID(), binding.getHostName(), binding.getProcessName());
         
         try {
-			VMControllerInterface vmController = getVMControllerInterface(serviceID.getVMControllerID());
+			ProcessManagement vmController = getProcessController(serviceID.getHostName(), serviceID.getProcessName());
 		    vmController.stopService(serviceID, stopNow, true);
 		} catch (MetaMatrixComponentException e) {
 			throw new AdminComponentException(e);
 		}
     }
 
-    private VMControllerInterface getVMControllerInterface(VMControllerID id) throws MetaMatrixComponentException {
-    	return this.registry.getVM(id.getHostName(), id.toString()).getVMController();
+    private ProcessManagement getProcessController(String hostName, String processName) throws MetaMatrixComponentException {
+    	return this.registry.getProcessBinding(hostName, processName).getProcessController();
     } 
 
     /**

Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -94,8 +94,7 @@
 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.VMControllerID;
-import com.metamatrix.platform.vm.controller.VMStatistics;
+import com.metamatrix.platform.vm.controller.ProcessStatistics;
 import com.metamatrix.server.serverapi.RequestInfo;
 
 /**
@@ -190,8 +189,7 @@
 			        String name = serviceBinding.getDeployedName();
 			        
 			        MMConnectorBinding binding;
-			        String[] identifierParts = 
-			            new String[] {serviceBinding.getHostName(), deployedComponent.getVMComponentDefnID().getName(), name};
+			        String[] identifierParts = new String[] {serviceBinding.getHostName(), serviceBinding.getProcessName(), name};
 			        String key = MMAdminObject.buildIdentifier(identifierParts).toUpperCase();
 			        if (runtimeMap.containsKey(key)) {
 			            //reuse MMConnectorBinding from config
@@ -210,8 +208,6 @@
 			            binding.setStateChangedTime(serviceBinding.getStateChangeTime());
 			            binding.setRegistered(true);
 			            binding.setServiceID(serviceBinding.getServiceID().getID());
-			            binding.setProcessID(serviceBinding.getServiceID().getVMControllerID().getID());
-
 			            
 			            results.add(binding);
 			        }
@@ -378,7 +374,7 @@
 			        
 			        MMDQP dqp;
 			        String[] identifierParts = 
-			            new String[] {serviceBinding.getHostName(), deployedComponent.getVMComponentDefnID().getName(), name};
+			            new String[] {serviceBinding.getHostName(), serviceBinding.getProcessName(), name};
 			        String key = MMAdminObject.buildIdentifier(identifierParts).toUpperCase();
 			        if (runtimeMap.containsKey(key)) {
 			            //reuse MMDQP from config
@@ -401,7 +397,6 @@
 			            dqp.setStateChangedTime(serviceBinding.getStateChangeTime());
 			            dqp.setRegistered(true);
 			            dqp.setServiceID(serviceBinding.getServiceID().getID());
-			            dqp.setProcessID(serviceBinding.getServiceID().getVMControllerID().getID());
 			            
 			            results.add(dqp);
 			        }
@@ -595,14 +590,12 @@
 		           String[] identifierParts = new String[] {hostName, processName};                
 		           if (identifierMatches(identifier, identifierParts)) {
 		               MMProcess process = new MMProcess(identifierParts);
-		               VMControllerID processID = processData.getProcessID();
 		               process.setRunning(processData.isRegistered());
 
 		               if (processData.isRegistered()) {
-		                   process.setProcessID(processID.getID());
 
 		                   try {
-		                       VMStatistics statistics = getRuntimeStateAdminAPIHelper().getVMStatistics(processID);
+		                       ProcessStatistics statistics = getRuntimeStateAdminAPIHelper().getVMStatistics(hostName, processName);
 		                       if (statistics != null) {
 		                           process.setFreeMemory(statistics.freeMemory);
 		                           process.setTotalMemory(statistics.totalMemory);
@@ -632,7 +625,7 @@
 		                               process.setQueueWorkerPool(workerPool);
 		                           }
 		                       }
-			            	   process.setInetAddress(getRuntimeStateAdminAPIHelper().getVMHostName(processID));
+			            	   process.setInetAddress(getRuntimeStateAdminAPIHelper().getVMHostName(hostName, processName));
 		                   } catch (MetaMatrixComponentException e) {
 		                       //do nothing: sometimes when the process is just starting the RMI stub
 		                       //for SocketVMController is not initialized yet
@@ -1137,10 +1130,8 @@
                 if (iter2.hasNext()) {
                     ProcessData processData = (ProcessData) iter2.next();
                     
-                    VMControllerID processID = processData.getProcessID();
-                    
                     try {
-                        byte[] logBytes = getRuntimeStateAdminAPIHelper().exportLogs(processID);
+                        byte[] logBytes = getRuntimeStateAdminAPIHelper().exportLogs(processData.getHostName(), processData.getName());
                         FileUtils.convertByteArrayToFile(logBytes, tempDirName, hostName+".zip");//$NON-NLS-1$
                     } catch (MetaMatrixComponentException e) {
                         //do nothing: sometimes when the process is just starting the RMI stub

Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerRuntimeStateAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerRuntimeStateAdminImpl.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerRuntimeStateAdminImpl.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -67,7 +67,6 @@
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.service.api.ServiceInterface;
 import com.metamatrix.platform.service.api.exception.ServiceException;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 
 /**
  * @since 4.3
@@ -180,10 +179,8 @@
                     
                     expectedServiceNames.addAll(getServiceNamesFromConfiguration(hostName, processName, bindingName));
                     
-                    VMControllerID vmControllerID = new VMControllerID(binding.getProcessID(), hostName); 
+                    ServiceID serviceID = new ServiceID(binding.getServiceID(), hostName, processName);
                     
-                    ServiceID serviceID = new ServiceID(binding.getServiceID(), vmControllerID);
-                    
                     getRuntimeStateAdminAPIHelper().restartService(serviceID);
                 }
             }
@@ -290,10 +287,8 @@
                 String bindingName = identifierParts[2];
                 expectedServiceNames.addAll(getServiceNamesFromConfiguration(hostName, processName, bindingName));
     
+                ServiceID serviceID = new ServiceID(binding.getServiceID(), hostName, processName);
                 
-                VMControllerID vmControllerID = new VMControllerID(binding.getProcessID(), hostName); 
-                ServiceID serviceID = new ServiceID(binding.getServiceID(), vmControllerID);
-                
                 getRuntimeStateAdminAPIHelper().stopService(serviceID, stopNow);
             }
                 
@@ -355,11 +350,9 @@
                 
         try {
             MMProcess process = (MMProcess) processes.iterator().next();
-            VMControllerID vmControllerID = new VMControllerID(process.getProcessID(), process.getHostName()); 
 
-            getRuntimeStateAdminAPIHelper().stopProcess(vmControllerID, stopNow);
+            getRuntimeStateAdminAPIHelper().stopProcess(process.getHostName(), process.getProcessName(), stopNow);
             
-            
             if (waitUntilDone) {
                 boolean done = false;
                 while (! done) {

Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/SocketVMController.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/SocketVMController.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/SocketVMController.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -45,8 +45,7 @@
 import com.metamatrix.platform.util.PlatformProxyHelper;
 import com.metamatrix.platform.vm.controller.ServerEvents;
 import com.metamatrix.platform.vm.controller.SocketListenerStats;
-import com.metamatrix.platform.vm.controller.VMController;
-import com.metamatrix.platform.vm.controller.VMControllerID;
+import com.metamatrix.platform.vm.controller.ProcessController;
 import com.metamatrix.server.Configuration;
 import com.metamatrix.server.HostManagement;
 import com.metamatrix.server.Main;
@@ -55,7 +54,7 @@
  * Main class for a server process.
  */
 @Singleton
-public class SocketVMController extends VMController {
+public class SocketVMController extends ProcessController {
 	
 	public static final String SOCKET_CONTEXT = "ServerSocket"; //$NON-NLS-1$
 	
@@ -77,8 +76,8 @@
     private WorkerPool workerPool;
         
     @Inject
-    public SocketVMController(@Named(Configuration.HOST) Host host, @Named(Configuration.VMNAME) String vmName, VMControllerID vmId, ClusteredRegistryState registry, ServerEvents serverEvents, MessageBus bus, HostManagement hostManagement) throws Exception {
-        super(host, vmName, vmId, registry, serverEvents, bus, hostManagement);
+    public SocketVMController(@Named(Configuration.HOST) Host host, @Named(Configuration.PROCESSNAME) String processName, ClusteredRegistryState registry, ServerEvents serverEvents, MessageBus bus, HostManagement hostManagement) throws Exception {
+        super(host, processName, registry, serverEvents, bus, hostManagement);
     }
 
     @Override
@@ -135,7 +134,7 @@
         String bindaddress =  VMNaming.getBindAddress();
         
         final Object[] param = new Object[] {
-            this.vmName, bindaddress, String.valueOf(socketPort)
+            this.processName, bindaddress, String.valueOf(socketPort)
         };
         
         logMessage(PlatformPlugin.Util.getString("SocketVMController.1", param)); //$NON-NLS-1$
@@ -175,14 +174,14 @@
         return buffer.toString();
     }
 
-    public SocketListenerStats getSocketListenerStats() {
+    protected SocketListenerStats getSocketListenerStats() {
         if (listener == null) {
             return null;
         }
         return listener.getStats();
     }    
 
-    public WorkerPoolStats getProcessPoolStats() {
+    protected WorkerPoolStats getProcessPoolStats() {
         if (workerPool == null) {
             return null;
         }

Modified: trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/common/log/DbLogWriter.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -312,7 +312,7 @@
 			stmt.setString(6, StringUtil.truncString(VMNaming.getConfigName(), maxGeneralLength)); 
 
 			// Message VM ID column
-			stmt.setString(7, StringUtil.truncString(VMNaming.getVMName(), maxGeneralLength));
+			stmt.setString(7, StringUtil.truncString(VMNaming.getProcessName(), maxGeneralLength));
 
 			// Message thread name column
 			stmt.setString(8, StringUtil.truncString(message.getThreadName(), maxGeneralLength));

Modified: trunk/server/src/main/java/com/metamatrix/metadata/runtime/vdb/defn/VDBCreation.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/metadata/runtime/vdb/defn/VDBCreation.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/metadata/runtime/vdb/defn/VDBCreation.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -258,13 +258,13 @@
             // still needs to stay the same
             boolean beenCreated = false;
             for (Iterator vmit=vmsToDeployTo.iterator(); vmit.hasNext();) {
-                String vmname = (String) vmit.next();
-                VMComponentDefn depVM = getDeployedVM(vmname, cmc);
+                String processName = (String) vmit.next();
+                VMComponentDefn depVM = getDeployedVM(processName, cmc);
                 // the VM has to be deployed (which is to have 1 or more pscs deployed to it) in order
                 // for the VM to be started
                 // *** Currently this process will not try to start a VM ***
                 if (depVM == null) {
-                	LogManager.logWarning(LogCommonConstants.CTX_CONFIG,RuntimeMetadataPlugin.Util.getString("VDBCreation.0", vmname)); //$NON-NLS-1$
+                	LogManager.logWarning(LogCommonConstants.CTX_CONFIG,RuntimeMetadataPlugin.Util.getString("VDBCreation.0", processName)); //$NON-NLS-1$
                      continue;
                 }
                 
@@ -276,7 +276,7 @@
                         continue;
                     }
                 }
-                LogManager.logWarning(LogCommonConstants.CTX_CONFIG,RuntimeMetadataPlugin.Util.getString("VDBCreation.5", new Object[] {binding.getName(), vmname} )); //$NON-NLS-1$
+                LogManager.logWarning(LogCommonConstants.CTX_CONFIG,RuntimeMetadataPlugin.Util.getString("VDBCreation.5", new Object[] {binding.getName(), processName} )); //$NON-NLS-1$
 
                 processDeployment(depVM, cmc, (beenCreated?beenCreated:bindingExist), binding, type, createdPSC, editor);
 
@@ -413,11 +413,11 @@
         }
     }
     
-    private VMComponentDefn getDeployedVM(String vmName,ConfigurationModelContainer cmc) throws Exception {
+    private VMComponentDefn getDeployedVM(String processName,ConfigurationModelContainer cmc) throws Exception {
         Collection vms = cmc.getConfiguration().getVMComponentDefns();
         for (Iterator it=vms.iterator(); it.hasNext();) {
             VMComponentDefn vm = (VMComponentDefn) it.next();
-            if (vm.getName().equalsIgnoreCase(vmName)) {
+            if (vm.getName().equalsIgnoreCase(processName)) {
                 return vm;
             }
         }

Modified: trunk/server/src/main/java/com/metamatrix/platform/admin/api/runtime/SystemStateBuilder.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/admin/api/runtime/SystemStateBuilder.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/admin/api/runtime/SystemStateBuilder.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -42,7 +42,7 @@
 import com.metamatrix.platform.registry.ClusteredRegistryState;
 import com.metamatrix.platform.registry.HostControllerRegistryBinding;
 import com.metamatrix.platform.registry.ServiceRegistryBinding;
-import com.metamatrix.platform.registry.VMRegistryBinding;
+import com.metamatrix.platform.registry.ProcessRegistryBinding;
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.service.api.ServiceState;
 import com.metamatrix.platform.service.controller.ServicePropertyNames;
@@ -120,7 +120,7 @@
 
         // loop thru all vm's for the host and create a ProcessData object for each.
         while (iter.hasNext()) {
-            VMRegistryBinding vmBinding = (VMRegistryBinding) iter.next();
+            ProcessRegistryBinding vmBinding = (ProcessRegistryBinding) iter.next();
             processes.add(createProcessData(vmBinding));
             deployedVMs.remove(vmBinding.getDeployedComponent());
         }
@@ -169,23 +169,22 @@
     /**
      * Create a ProcessData object for the vmBinding.
      */
-    private ProcessData createProcessData(VMRegistryBinding vmBinding) {
+    private ProcessData createProcessData(ProcessRegistryBinding vmBinding) {
 
         // if this vm is not deployed (appServer VM) then
         // create an empty ProcessData and return.
         if (vmBinding.getDeployedComponent() == null) {
-            return new ProcessData(vmBinding.getVMControllerID(),
-                                   null,    // deployed component id
-                                   vmBinding.getHostName(),
-                                   new ArrayList(),
-                                   vmBinding.getVMName(),
-                                   String.valueOf(vmBinding.getPort()),
-                                   false, // not deployed
-                                   true); // registered
+            return new ProcessData(	vmBinding.getHostName(),
+            						vmBinding.getProcessName(),
+            						String.valueOf(vmBinding.getPort()),
+            						null,    // deployed component id
+            						new ArrayList(),
+            						false, // not deployed
+            						true); // registered
         }
 
         // ServiceBindings for vm
-        List bindings = this.registry.getServiceBindings(vmBinding.getHostName(), vmBinding.getVMControllerID().toString()); 
+        List bindings = this.registry.getServiceBindings(vmBinding.getHostName(), vmBinding.getProcessName()); 
 
         // Map of pscIDs -> List of services
         Map pscMap = new HashMap();
@@ -255,7 +254,7 @@
         // create a list of psc's
         List pscList = new ArrayList();
         Iterator pscIter = pscMap.keySet().iterator();
-        String processName = vmBinding.getVMName();
+        String processName = vmBinding.getProcessName();
 
         while (pscIter.hasNext()) {
             ProductServiceConfigID pId = (ProductServiceConfigID) pscIter.next();
@@ -271,12 +270,12 @@
             deployedComponents.remove(dc);
         }
 
-        return new ProcessData(vmBinding.getVMControllerID(),
-                               (VMComponentDefnID) vmBinding.getDeployedComponent().getID(),
-                               vmBinding.getHostName(), 
-                               pscList, vmBinding.getVMName(), vmBinding.getPort(), 
-                               deployed, true);
-
+        return new ProcessData(	vmBinding.getHostName(),
+        						vmBinding.getProcessName(), 
+        						vmBinding.getPort(),
+        						(VMComponentDefnID) vmBinding.getDeployedComponent().getID(),
+        						pscList,  
+        						deployed, true);
     }
 
 
@@ -336,12 +335,11 @@
 
         String hostName = deployedVM.getHostID().getName();
 
-        return new ProcessData(null,
+        return new ProcessData(	hostName,
+        						deployedVM.getName(), deployedVM.getPort(),
                                (VMComponentDefnID)deployedVM.getID(),
-                               hostName,                                
-                               pscList, deployedVM.getName(), deployedVM.getPort(), 
+                               pscList,  
                                true, false); // deployed, not registered
-
     }
 
     /**

Modified: trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -57,7 +57,7 @@
 import com.metamatrix.platform.registry.HostControllerRegistryBinding;
 import com.metamatrix.platform.registry.ResourceNotBoundException;
 import com.metamatrix.platform.registry.ServiceRegistryBinding;
-import com.metamatrix.platform.registry.VMRegistryBinding;
+import com.metamatrix.platform.registry.ProcessRegistryBinding;
 import com.metamatrix.platform.security.api.service.AuthorizationServiceInterface;
 import com.metamatrix.platform.security.api.service.MembershipServiceInterface;
 import com.metamatrix.platform.security.api.service.SessionServiceInterface;
@@ -69,9 +69,8 @@
 import com.metamatrix.platform.util.LogMessageKeys;
 import com.metamatrix.platform.util.LogPlatformConstants;
 import com.metamatrix.platform.util.PlatformProxyHelper;
-import com.metamatrix.platform.vm.api.controller.VMControllerInterface;
-import com.metamatrix.platform.vm.controller.VMControllerID;
-import com.metamatrix.platform.vm.controller.VMStatistics;
+import com.metamatrix.platform.vm.api.controller.ProcessManagement;
+import com.metamatrix.platform.vm.controller.ProcessStatistics;
 import com.metamatrix.server.HostManagement;
 
 
@@ -119,8 +118,7 @@
             SystemStateBuilder ssm = new SystemStateBuilder(this.registry, this.hostManagement);
             return ssm.getSystemState();
         } catch (Exception e) {
-            throw new MetaMatrixComponentException(e, ErrorMessageKeys.ADMIN_0051,
-                                                   PlatformPlugin.Util.getString(ErrorMessageKeys.ADMIN_0051));
+            throw new MetaMatrixComponentException(e, ErrorMessageKeys.ADMIN_0051, PlatformPlugin.Util.getString(ErrorMessageKeys.ADMIN_0051));
         }
     }
 
@@ -167,25 +165,7 @@
         return list;
     }
 
-    /**
-     * Return all processes running in mm system.
-     * 
-     * @param callerSessionID
-     *            ID of the caller's current session.
-     * @return List of VMControllerIDs.
-     * @throws MetaMatrixComponentException
-     *             if an error occurred in communicating with a component.
-     */
-    public List<VMControllerID> getProcesses() throws MetaMatrixComponentException {
-        List processes = new ArrayList();
 
-        List<VMRegistryBinding> bindings = this.registry.getVMs(null);
-        for (VMRegistryBinding vmBinding:bindings) {
-            processes.add(vmBinding.getVMControllerID());
-        }
-        return processes;
-    }
-
     /**
      * Return VMStatistics object for Process.
      * 
@@ -197,15 +177,15 @@
      * @throws MetaMatrixComponentException
      *             if an error occurred in communicating with a component.
      */
-    public VMStatistics getVMStatistics(VMControllerID vmID) throws MetaMatrixComponentException {
-		VMRegistryBinding vm = registry.getVM(vmID.getHostName(), vmID.toString());
-		return vm.getVMController().getVMStatistics();
+    public ProcessStatistics getVMStatistics(String hostName, String processName) throws MetaMatrixComponentException {
+		ProcessRegistryBinding vm = registry.getProcessBinding(hostName, processName);
+		return vm.getProcessController().getVMStatistics();
     }   
     
 
-    public InetAddress getVMHostName(VMControllerID vmID) throws MetaMatrixComponentException  {
-		VMRegistryBinding vm = registry.getVM(vmID.getHostName(), vmID.toString());
-		return vm.getVMController().getAddress();    	
+    public InetAddress getVMHostName(String hostName, String processName) throws MetaMatrixComponentException  {
+		ProcessRegistryBinding vm = registry.getProcessBinding(hostName, processName);
+		return vm.getProcessController().getAddress();    	
     }
     
     /**
@@ -239,7 +219,7 @@
      * @return ServiceRegistryBinding
      */
     public ServiceRegistryBinding getServiceBinding(ServiceID serviceID) throws ResourceNotBoundException {
-        return this.registry.getServiceBinding(serviceID.getHostName(), serviceID.getVMControllerID().toString(), serviceID);
+        return this.registry.getServiceBinding(serviceID.getHostName(), serviceID.getProcessName(), serviceID);
     }
 
     /**
@@ -363,12 +343,12 @@
 
             while (procIter.hasNext()) {
                 ProcessData pData = (ProcessData)procIter.next();
-                VMControllerInterface vmController = null;
+                ProcessManagement vmController = null;
                 // if registered then get the VMController
                 if (pData.isRegistered()) {
                     try {
-                    	VMRegistryBinding vmBinding = this.registry.getVM(pData.getProcessID().getHostName(), pData.getProcessID().toString());
-                        vmController = vmBinding.getVMController();
+                    	ProcessRegistryBinding vmBinding = this.registry.getProcessBinding(pData.getHostName(), pData.getName());
+                        vmController = vmBinding.getProcessController();
                     } catch (Exception e) {
                         exceptions.add(e); // if we can't get the vmController then go to next process
                         // errorMsg.append(e.getMessage());
@@ -444,32 +424,11 @@
         }
     }
 
-    public VMControllerInterface getVMControllerInterface(VMControllerID id) throws ResourceNotBoundException {
-    	return this.registry.getVM(id.getHostName(), id.toString()).getVMController();
+    public ProcessManagement getVMControllerInterface(String hostName, String processName) throws ResourceNotBoundException {
+    	return this.registry.getProcessBinding(hostName, processName).getProcessController();
     } 
     
-    /**
-     * Start a deployed service.
-     * 
-     * @param registry
-     *            The Registry.
-     * @param id
-     *            ServiceComponentDefnID of service instance.
-     * @param vmID
-     *            Identifies VMController to start service in.
-     * @throws MetaMatrixComponentException
-     *             if an error occurred in communicating with a component.
-     */
-    public void startDeployedService(ServiceComponentDefnID serviceID, VMControllerID vmID) throws MetaMatrixComponentException {
 
-        VMControllerInterface vmController = getVMControllerInterface(vmID);
-        try {
-            vmController.startDeployedService(serviceID);
-        } catch (ServiceException se) {
-            throw new MetaMatrixComponentException(se);
-        }
-    }
-
     /**
      * Restart a failed or stopped service.
      * 
@@ -482,10 +441,9 @@
      */
     public void restartService(ServiceID serviceID) throws MetaMatrixComponentException {
 
-        VMControllerID vmID = serviceID.getVMControllerID();
-        VMRegistryBinding vmBinding = this.registry.getVM(vmID.getHostName(), vmID.toString());
+        ProcessRegistryBinding vmBinding = this.registry.getProcessBinding(serviceID.getHostName(), serviceID.getProcessName());
         
-        VMControllerInterface vmController = vmBinding.getVMController();
+        ProcessManagement vmController = vmBinding.getProcessController();
         try {
         	vmController.stopService(serviceID, false, false);
         } catch (ServiceException se) {
@@ -499,7 +457,7 @@
     } 
 
     /**
-     * Set the Log Configuration in the database and propergate changes to other VM
+     * Set the Log Configuration in the database and propagate changes to other VM
      * 
      * @param registry
      * @param config
@@ -527,8 +485,7 @@
         try {
             configAdmin.executeTransaction(actions, principalName);
         } catch (ModificationException e) {
-            String msg = PlatformPlugin.Util.getString(ErrorMessageKeys.ADMIN_0084, config.getID());
-            throw new MetaMatrixComponentException(e, ErrorMessageKeys.ADMIN_0084, msg);
+            throw new MetaMatrixComponentException(e, ErrorMessageKeys.ADMIN_0084, PlatformPlugin.Util.getString(ErrorMessageKeys.ADMIN_0084, config.getID()));
         }
 
         // Then, if the operational (current) config is effected, set logging config for
@@ -545,8 +502,8 @@
 
             Iterator vmItr = registry.getVMs(null).iterator();
             while (vmItr.hasNext()) {
-                VMRegistryBinding vmBinding = (VMRegistryBinding)vmItr.next();
-                VMControllerInterface vm = vmBinding.getVMController();
+                ProcessRegistryBinding vmBinding = (ProcessRegistryBinding)vmItr.next();
+                ProcessManagement vm = vmBinding.getProcessController();
                     vm.setCurrentLogConfiguration(logConfig);
             }
             if (msgs != null && msgs.length() > 0) {
@@ -569,9 +526,8 @@
      */
     public void stopService(ServiceID serviceID, boolean stopNow) throws MetaMatrixComponentException {
 
-        VMControllerID vmID = serviceID.getVMControllerID();
-        VMRegistryBinding binding = registry.getVM(vmID.getHostName(), vmID.toString());
-        VMControllerInterface vmController = binding.getVMController();
+        ProcessRegistryBinding binding = registry.getProcessBinding(serviceID.getHostName(), serviceID.getProcessName());
+        ProcessManagement vmController = binding.getProcessController();
         try {
         	vmController.stopService(serviceID, stopNow, false);
         } catch (ServiceException se) {
@@ -679,9 +635,9 @@
      * @throws MetaMatrixComponentException
      *             if an error occurred in communicating with a component.
      */
-   public void stopProcess(VMControllerID vmID, boolean stopNow)
+   public void stopProcess(String hostName, String processName, boolean stopNow)
 			throws AuthorizationException, MetaMatrixComponentException {
-		this.hostManagement.killServer(vmID.getHostName(), vmID.toString(), stopNow);
+		this.hostManagement.killServer(hostName, processName, stopNow);
 	} 
     
     
@@ -694,9 +650,9 @@
      * @throws AdminException
      * @since 4.3
      */
-   public byte[] exportLogs(VMControllerID processID) throws MetaMatrixComponentException {
-       	VMRegistryBinding vmBinding = this.registry.getVM(processID.getHostName(), processID.toString());
-       VMControllerInterface vmController = vmBinding.getVMController();
+   public byte[] exportLogs(String hostName, String processName) throws MetaMatrixComponentException {
+	   ProcessRegistryBinding processBinding = this.registry.getProcessBinding(hostName, processName);
+       ProcessManagement vmController = processBinding.getProcessController();
        return vmController.exportLogs();
    }
 

Modified: trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIImpl.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIImpl.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -38,7 +38,6 @@
 import com.metamatrix.api.exception.security.AuthorizationException;
 import com.metamatrix.common.config.api.Configuration;
 import com.metamatrix.common.config.api.ServiceComponentDefnID;
-import com.metamatrix.common.log.I18nLogManager;
 import com.metamatrix.common.log.LogConfiguration;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.common.log.reader.DBLogReader;
@@ -57,8 +56,9 @@
 import com.metamatrix.platform.registry.ClusteredRegistryState;
 import com.metamatrix.platform.registry.ResourceNotBoundException;
 import com.metamatrix.platform.registry.ServiceRegistryBinding;
-import com.metamatrix.platform.registry.VMRegistryBinding;
+import com.metamatrix.platform.registry.ProcessRegistryBinding;
 import com.metamatrix.platform.security.api.SessionToken;
+import com.metamatrix.platform.service.ServicePlugin;
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.service.api.ServiceInterface;
 import com.metamatrix.platform.service.api.ServiceState;
@@ -67,9 +67,8 @@
 import com.metamatrix.platform.util.LogMessageKeys;
 import com.metamatrix.platform.util.LogPlatformConstants;
 import com.metamatrix.platform.util.PlatformProxyHelper;
-import com.metamatrix.platform.vm.api.controller.VMControllerInterface;
-import com.metamatrix.platform.vm.controller.VMControllerID;
-import com.metamatrix.platform.vm.controller.VMStatistics;
+import com.metamatrix.platform.vm.api.controller.ProcessManagement;
+import com.metamatrix.platform.vm.controller.ProcessStatistics;
 import com.metamatrix.server.HostManagement;
 
 public class RuntimeStateAdminAPIImpl extends SubSystemAdminAPIImpl implements RuntimeStateAdminAPI {
@@ -149,27 +148,7 @@
 
     }
 
-    /**
-     * Return all processes running in mm system.
-     * 
-     * @return List of VMControllerIDs.
-     * @throws AuthorizationException
-     *             if caller is not authorized to perform this method.
-     * @throws InvalidSessionException
-     *             if the <code>callerSessionID</code> is not valid or is expired.
-     * @throws MetaMatrixComponentException
-     *             if an error occurred in communicating with a component.
-     */
-    public synchronized List<VMControllerID> getProcesses() throws AuthorizationException,
-                                                                              InvalidSessionException,
-                                                                              MetaMatrixComponentException {
 
-        // Validate caller's session
-        AdminAPIHelper.validateSession(getSessionID());
-        
-        return helper.getProcesses();
-    }
-
     /**
      * Return all hosts running in mm system.
      * 
@@ -209,9 +188,7 @@
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0003, new Object[] {
-            serviceID, token.getUsername()
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0003, new Object[] {serviceID, token.getUsername()}));
 
         // Validate caller's role
         AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.stopService(" + serviceID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -237,9 +214,7 @@
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0004, new Object[] {
-            serviceID, token.getUsername()
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0004, new Object[] {serviceID, token.getUsername()}));
 
         // Validate caller's role
         AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.stopServiceNow(" + serviceID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -266,9 +241,7 @@
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0005, new Object[] {
-            host, token.getUsername()
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0005, new Object[] {host, token.getUsername()}));
 
         // Validate caller's role
         AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.stopHost(" + host + ")"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -295,9 +268,7 @@
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0006, new Object[] {
-            host, token.getUsername()
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0006, new Object[] {host, token.getUsername()}));
 
         // Validate caller's role
         AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.stopHostNow(" + host + ")"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -318,50 +289,19 @@
      * @throws MetaMatrixComponentException
      *             if an error occurred in communicating with a component.
      */
-    public synchronized void stopProcess(VMControllerID processID) throws AuthorizationException,
-                                                                  InvalidSessionException,
-                                                                  MetaMatrixComponentException {
+    public synchronized void stopProcess(String hostName, String processName, boolean now) 
+    	throws AuthorizationException,InvalidSessionException, MetaMatrixComponentException {
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0009, new Object[] {
-            processID, token.getUsername()
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0009, new Object[] {hostName+"."+processName, token.getUsername()})); //$NON-NLS-1$
 
         // Validate caller's role
-        AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.stopProcess(" + processID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+        AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.stopProcess(" + hostName+","+ processName + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
-        helper.stopProcess(processID, false);
+        helper.stopProcess(hostName, processName, now);
     }
 
-    /**
-     * Stop process now.
-     * 
-     * @param processID
-     *            <code>VMControllerID</code>.
-     * @throws AuthorizationException
-     *             if caller is not authorized to perform this method.
-     * @throws InvalidSessionException
-     *             if the <code>callerSessionID</code> is not valid or is expired.
-     * @throws MetaMatrixComponentException
-     *             if an error occurred in communicating with a component.
-     */
-    public synchronized void stopProcessNow(VMControllerID processID) throws AuthorizationException,
-                                                                     InvalidSessionException,
-                                                                     MetaMatrixComponentException {
-
-        // Validate caller's session
-        SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0010, new Object[] {
-            processID, token.getUsername()
-        });
-
-        // Validate caller's role
-        AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.stopProcessNow(" + processID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
-
-        helper.stopProcess(processID, true);
-    }
-
   
     /**
      * Gracefully shutdown server waiting for work to complete.
@@ -379,9 +319,7 @@
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0015, new Object[] {
-            token.getUsername()
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0015, new Object[] {token.getUsername()}));
 
         // Validate caller's role
         AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.shutdownServer()"); //$NON-NLS-1$
@@ -400,9 +338,7 @@
      * @throws MetaMatrixComponentException
      *             if an error occurred in communicating with a component.
      */
-    public synchronized void bounceServer() throws AuthorizationException,
-                                                                              InvalidSessionException,
-                                                                              MetaMatrixComponentException {
+    public synchronized void bounceServer() throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
@@ -432,9 +368,7 @@
                                                                 InvalidSessionException,
                                                                 MetaMatrixComponentException {
 
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0019, new Object[] {
-            serviceID
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0019, new Object[] {serviceID}));
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
@@ -463,9 +397,7 @@
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0020, new Object[] {
-            host, token.getUsername()
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0020, new Object[] {host, token.getUsername()}));
         // Validate caller's role
         AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.startHost(" + host + ")"); //$NON-NLS-1$ //$NON-NLS-2$
 
@@ -486,16 +418,13 @@
      * @throws MetaMatrixComponentException
      *             if an error occurred in communicating with a component.
      */
-    public synchronized void startProcess(String host,
-                                          String process) throws AuthorizationException,
+    public synchronized void startProcess(String host, String process) throws AuthorizationException,
                                                          InvalidSessionException,
                                                          MetaMatrixComponentException {
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0021, new Object[] {
-            process, token.getUsername()
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0021, new Object[] {process, token.getUsername()}));
 
         // Validate caller's role
         AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.startProcess(" + host + ", " + process + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -522,9 +451,8 @@
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0022, new Object[] {
-            pscID, token.getUsername()
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0022, new Object[] {pscID, token.getUsername()}));
+        
         // Validate caller's role
         AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.startPSC(" + pscID + ")"); //$NON-NLS-1$ //$NON-NLS-2$
 
@@ -548,31 +476,19 @@
     }
 
     // Helper method to start all services that are in a PSC
-    private void startPSCServices(ProcessData processData,
-                                  PSCData pscData) throws MetaMatrixComponentException,
-                                                  MultipleException {
+    private void startPSCServices(ProcessData processData, PSCData pscData) 
+    	throws MetaMatrixComponentException,MultipleException {
 
-        // check if already running
-        //if (pscData.isRegistered()) {
-        //    throw new MetaMatrixComponentException("PSC " + pscData.getName() + " is already running.");
-        //}
-
         // check that process is running
         if (!processData.isRegistered()) {
-            throw new MetaMatrixComponentException(ErrorMessageKeys.ADMIN_0069,
-                                                   PlatformPlugin.Util.getString(ErrorMessageKeys.ADMIN_0069,
-                                                                                 pscData.getName(),
-                                                                                 processData.getName()));
+            throw new MetaMatrixComponentException(ErrorMessageKeys.ADMIN_0069,PlatformPlugin.Util.getString(ErrorMessageKeys.ADMIN_0069,pscData.getName(),processData.getName()));
         }
 
-        VMControllerInterface vm = null;
+        ProcessManagement vm = null;
         try {
-            vm = helper.getVMControllerInterface(processData.getProcessID());
+            vm = helper.getVMControllerInterface(processData.getHostName(), processData.getName());
         } catch (ResourceNotBoundException e) {
-            throw new MetaMatrixComponentException(ErrorMessageKeys.ADMIN_0070,
-                                                   PlatformPlugin.Util.getString(ErrorMessageKeys.ADMIN_0070,
-                                                                                 pscData.getName(),
-                                                                                 processData.getName()));
+            throw new MetaMatrixComponentException(ErrorMessageKeys.ADMIN_0070,PlatformPlugin.Util.getString(ErrorMessageKeys.ADMIN_0070,pscData.getName(),processData.getName()));
         }
 
         List exceptions = new ArrayList();
@@ -649,9 +565,7 @@
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0023, new Object[] {
-            pscID, token.getUsername()
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0023, new Object[] {pscID, token.getUsername()}));
 
         // Validate caller's role
         AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.stopPSC(" + pscID + ", " + now + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -687,9 +601,9 @@
                                                    PlatformPlugin.Util.getString(ErrorMessageKeys.ADMIN_0056, pscData.getName()));
         }
 
-        VMControllerInterface vm = null;
+        ProcessManagement vm = null;
         try {
-            vm = helper.getVMControllerInterface(processData.getProcessID());
+            vm = helper.getVMControllerInterface(processData.getHostName(), processData.getName());
         } catch (ResourceNotBoundException e) {
             throw new MetaMatrixComponentException(ErrorMessageKeys.ADMIN_0074,
                                                    PlatformPlugin.Util.getString(ErrorMessageKeys.ADMIN_0074,
@@ -741,9 +655,7 @@
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
-        I18nLogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, LogMessageKeys.ADMIN_0026, new Object[] {
-            token.getUsername()
-        });
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, ServicePlugin.Util.getString(LogMessageKeys.ADMIN_0026, new Object[] {token.getUsername()}));
 
         // Validate caller's role
         AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.synchronizeServer()"); //$NON-NLS-1$
@@ -806,8 +718,10 @@
         
     }
 
+    private static String buildProcessId(String host, String process) {
+    	return host+"."+process; //$NON-NLS-1$
+    }
 
-
     /**
      * Sets the <code>LogConfiguration</code> on the <code>LogManager</code> running in the given VM. If
      * <code>null>/code> is passed in for vmID, set log config on the
@@ -820,30 +734,19 @@
      * @throws InvalidSessionException if the <code>callerSessionID</code> is not valid or is expired.
      * @throws MetaMatrixComponentException if an error occurred in communicating with a component.
      */
-    public synchronized void setLoggingConfiguration(LogConfiguration logConfig,
-                                                     VMControllerID vmID) throws AuthorizationException,
-                                                                         InvalidSessionException,
-                                                                         MetaMatrixComponentException {
-        String theVMID = "App Server VM"; //$NON-NLS-1$
-        if (vmID != null) {
-            theVMID = vmID.toString();
-        }
-        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, CorePlugin.Util.getString(LogMessageKeys.ADMIN_0029, new Object[] {theVMID}));
+    public synchronized void setLoggingConfiguration(LogConfiguration logConfig, String hostName, String processName) 
+    	throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
+    	
+        LogManager.logInfo(LogPlatformConstants.CTX_RUNTIME_ADMIN, CorePlugin.Util.getString(LogMessageKeys.ADMIN_0029, new Object[] {buildProcessId(hostName, processName)}));
 
         // Validate caller's session
         SessionToken token = AdminAPIHelper.validateSession(getSessionID());
+        
         // Validate caller's role
-        AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.setLoggingConfiguration(" + logConfig + ", " + vmID + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        AdminAPIHelper.checkForRequiredRole(token, AdminRoles.RoleName.ADMIN_PRODUCT, "RuntimeStateAdminAPIImpl.setLoggingConfiguration(" + logConfig + ", " + buildProcessId(hostName, processName) + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
-        // Set App Server VM's log config if vmID == null.
-        if (vmID == null) {
-            LogManager.setLogConfiguration(logConfig);
-            return;
-        }
-
         // Set logging config for given VM
-        // VMControllerNotBoundException gets propagated (ancester is MetaMatrixComponentException)
-        VMControllerInterface vm = helper.getVMControllerInterface(vmID);
+        ProcessManagement vm = helper.getVMControllerInterface(hostName, processName);
         vm.setCurrentLogConfiguration(logConfig);
     }
 
@@ -893,8 +796,7 @@
                                                                                    InvalidSessionException,
                                                                                    MetaMatrixComponentException {
 
-        LogManager.logDetail(LogPlatformConstants.CTX_RUNTIME_ADMIN,
-                             "Getting queue statistics for " + queueName + " for service: " + serviceID); //$NON-NLS-1$ //$NON-NLS-2$
+        LogManager.logDetail(LogPlatformConstants.CTX_RUNTIME_ADMIN, "Getting queue statistics for " + queueName + " for service: " + serviceID); //$NON-NLS-1$ //$NON-NLS-2$
 
         // Validate caller's session
         AdminAPIHelper.validateSession(getSessionID());
@@ -917,18 +819,16 @@
      * @throws MetaMatrixComponentException
      *             if an error occurred in communicating with a component.
      */
-    public synchronized VMStatistics getVMStatistics(VMControllerID vmID) throws AuthorizationException,
-                                                                         InvalidSessionException,
-                                                                         MetaMatrixComponentException {
+    public synchronized ProcessStatistics getProcessStatistics(String hostName, String processName) 
+    	throws AuthorizationException, InvalidSessionException, MetaMatrixComponentException {
 
-        LogManager.logDetail(LogPlatformConstants.CTX_RUNTIME_ADMIN, "Getting vm statistics for " + vmID); //$NON-NLS-1$
+        LogManager.logDetail(LogPlatformConstants.CTX_RUNTIME_ADMIN, "Getting vm statistics for " + buildProcessId(hostName, processName)); //$NON-NLS-1$
 
         // Validate caller's session
         AdminAPIHelper.validateSession(getSessionID());
-        // Any administrator may call this read-only method - no need to validate role
 
-        
-        return helper.getVMStatistics(vmID);
+        // Any administrator may call this read-only method - no need to validate role
+        return helper.getVMStatistics(hostName, processName);
     }
 
     /**
@@ -951,10 +851,10 @@
         }
 
         while (result == null && vmIter.hasNext()) {
-            VMRegistryBinding vmBinding = (VMRegistryBinding)vmIter.next();
-            if (vmBinding.getHostName().equalsIgnoreCase(hostName) && vmBinding.getVMName().equalsIgnoreCase(processName)) {
+            ProcessRegistryBinding processBinding = (ProcessRegistryBinding)vmIter.next();
+            if (processBinding.getHostName().equalsIgnoreCase(hostName) && processBinding.getProcessName().equalsIgnoreCase(processName)) {
 
-                Iterator serviceIter = this.registry.getServiceBindings(hostName, vmBinding.getVMControllerID().toString()).iterator();
+                Iterator serviceIter = this.registry.getServiceBindings(hostName, processBinding.getProcessName()).iterator();
                 while (result == null && serviceIter.hasNext()) {
                     ServiceRegistryBinding binding = (ServiceRegistryBinding)serviceIter.next();
                     if (binding.getHostName().equalsIgnoreCase(hostName) &&
@@ -989,10 +889,10 @@
         }
 
         while (result == null && vmIter.hasNext()) {
-            VMRegistryBinding vmBinding = (VMRegistryBinding)vmIter.next();
-            if (vmBinding.getHostName().equalsIgnoreCase(hostName) && vmBinding.getVMName().equalsIgnoreCase(processName)) {
+            ProcessRegistryBinding processBinding = (ProcessRegistryBinding)vmIter.next();
+            if (processBinding.getHostName().equalsIgnoreCase(hostName) && processBinding.getProcessName().equalsIgnoreCase(processName)) {
 
-                Iterator serviceIter = this.registry.getServiceBindings(hostName, vmBinding.getVMControllerID().toString()).iterator();
+                Iterator serviceIter = this.registry.getServiceBindings(hostName, processBinding.getProcessName()).iterator();
                 while (result == null && serviceIter.hasNext()) {
                     ServiceRegistryBinding binding = (ServiceRegistryBinding)serviceIter.next();
                     if (binding.getHostName().equalsIgnoreCase(hostName) &&
@@ -1010,63 +910,14 @@
      * @see com.metamatrix.platform.admin.apiimpl.RuntimeStateAdminAPI#getVMControllerBindings()
      * @since 4.2.1
      */
-    public List<VMRegistryBinding> getVMControllerBindings() throws InvalidSessionException,
+    public List<ProcessRegistryBinding> getVMControllerBindings() throws InvalidSessionException,
                                                                             AuthorizationException,
                                                                             MetaMatrixComponentException {
         AdminAPIHelper.validateSession(getSessionID());
         return registry.getVMs(null);
     }
 
-    /**
-     * @see com.metamatrix.platform.admin.apiimpl.RuntimeStateAdminAPI#getVMControllerIDByName(
-     *      java.lang.String, java.lang.String)
-     * @since 4.2.1
-     */
-    public VMControllerID getVMControllerIDByName(String hostName,
-                                                  String processName) throws AuthorizationException,
-                                                                     InvalidSessionException,
-                                                                     ResourceNotBoundException,
-                                                                     MetaMatrixComponentException {
-        AdminAPIHelper.validateSession(getSessionID());
-        VMControllerID result = null;
-        Iterator vmIter = getVMControllerBindings().iterator();
-        if (!vmIter.hasNext()) {
-            return result;
-        }
 
-        while (vmIter.hasNext()) {
-            VMRegistryBinding vmBinding = (VMRegistryBinding)vmIter.next();
-            if (vmBinding.getHostName().equalsIgnoreCase(hostName) && vmBinding.getVMName().equalsIgnoreCase(processName)) {
-                result = vmBinding.getVMControllerID();
-            }
-        }
-        return result;
-    }
-
-    /**
-     * @see com.metamatrix.platform.admin.apiimpl.RuntimeStateAdminAPI#getVMName(
-     *      long, java.lang.String)
-     * @since 4.2.1
-     */
-    public String getVMName(long id, String hostName) 
-        throws AuthorizationException,InvalidSessionException, MetaMatrixComponentException {
-        
-        AdminAPIHelper.validateSession(getSessionID());
-        VMControllerID vmID = new VMControllerID(id, hostName);
-        String result = null;
-        Iterator vmIter = getVMControllerBindings().iterator();
-        while (vmIter.hasNext()) {
-            VMRegistryBinding vmBinding = (VMRegistryBinding)vmIter.next();
-            VMControllerID vmIDtemp = vmBinding.getVMController().getID();
-            if (vmIDtemp.equals(vmID)) {
-                result = vmBinding.getVMName();
-                break;
-            }
-
-        }
-        return result;
-    }
-
     /** 
      * @see com.metamatrix.platform.admin.api.RuntimeStateAdminAPI#getLogEntries(java.util.Date, java.util.Date, java.util.List, java.util.List, int)
      * @since 4.3

Modified: trunk/server/src/main/java/com/metamatrix/platform/registry/ClusteredRegistryState.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/registry/ClusteredRegistryState.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/registry/ClusteredRegistryState.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -62,22 +62,22 @@
 		return node;
 	}
 	
-	private Cache addVMNode(String hostName, String vmName) throws CacheNodeNotFoundException {
+	private Cache addProcessNode(String hostName, String processName) throws CacheNodeNotFoundException {
 		Cache hostNode = getHostNode(hostName);
-		Cache n =  hostNode.addChild(vmName.toUpperCase());
-		n.put(NAME, vmName);
+		Cache n =  hostNode.addChild(processName.toUpperCase());
+		n.put(NAME, processName);
 		return n;
 	}
 	
-	private Cache getVMNode(String hostName, String vmName) throws CacheNodeNotFoundException {
+	private Cache getProcessNode(String hostName, String processName) throws CacheNodeNotFoundException {
 		Cache hostNode = getHostNode(hostName);
-		Cache vmNode = hostNode.getChild(vmName.toUpperCase());
+		Cache vmNode = hostNode.getChild(processName.toUpperCase());
 		if (vmNode == null) {
-			throw new CacheNodeNotFoundException("VM Node not found="+vmName); //$NON-NLS-1$
+			throw new CacheNodeNotFoundException("VM Node not found="+processName); //$NON-NLS-1$
 		}
 		
 		// only return the active vms
-		VMRegistryBinding binding = (VMRegistryBinding)vmNode.get(VM_CONTROLLER);
+		ProcessRegistryBinding binding = (ProcessRegistryBinding)vmNode.get(VM_CONTROLLER);
 		if (binding == null || !binding.isAlive()) {
 			throw new CacheNodeNotFoundException("VM Node's binding not found or not active"); //$NON-NLS-1$
 		}
@@ -95,23 +95,23 @@
 		this.cache.removeChild(hostName.toUpperCase());
 	}
 	
-	protected synchronized void addVM(String hostName, String vmName, VMRegistryBinding vmBinding) throws CacheNodeNotFoundException {
-		Cache vmNode = addVMNode(hostName, vmName);
+	protected synchronized void addProcess(String hostName, String processName, ProcessRegistryBinding vmBinding) throws CacheNodeNotFoundException {
+		Cache vmNode = addProcessNode(hostName, processName);
 		vmNode.put(VM_CONTROLLER, vmBinding);
 	}
 	
-	protected void updateVM(String hostName, String vmName, VMRegistryBinding binding) throws ResourceNotBoundException, CacheNodeNotFoundException {
-		Cache vmNode = getVMNode(hostName, vmName);
+	protected void updateProcess(String hostName, String processName, ProcessRegistryBinding binding) throws ResourceNotBoundException, CacheNodeNotFoundException {
+		Cache vmNode = getProcessNode(hostName, processName);
 		if (vmNode.get(VM_CONTROLLER) == null) {
-			throw new ResourceNotBoundException(ServicePlugin.Util.getString(ServiceMessages.REGISTRY_0012, hostName+"/"+vmName )); //$NON-NLS-1$
+			throw new ResourceNotBoundException(ServicePlugin.Util.getString(ServiceMessages.REGISTRY_0012, hostName+"/"+processName )); //$NON-NLS-1$
 		}
 		vmNode.put(VM_CONTROLLER, binding);		
 	} 	
 	
-	protected void removeVM(String hostName, String vmName) {
+	protected void removeProcess(String hostName, String processName) {
 		try {
 			Cache hostNode = getHostNode(hostName);
-			hostNode.removeChild(vmName.toUpperCase());
+			hostNode.removeChild(processName.toUpperCase());
 		} catch (CacheNodeNotFoundException e) {
 			// this is OK, this is already gone.
 		}
@@ -146,11 +146,11 @@
 	 * @param hostName
 	 * @return
 	 */
-	public List<VMRegistryBinding> getVMs(String hostName){
+	public List<ProcessRegistryBinding> getVMs(String hostName){
 		return getVMs(hostName, new ArrayList());
 	}
 	
-	private List<VMRegistryBinding> getVMs(String hostName, ArrayList list){
+	private List<ProcessRegistryBinding> getVMs(String hostName, ArrayList list){
 		
 		if (hostName == null) {
 			Collection<Cache> hostNodes = this.cache.getChildren();
@@ -172,22 +172,22 @@
 		return list;
 	}
 	
-	public VMRegistryBinding getVM(String hostName, String vmName) throws ResourceNotBoundException {
+	public ProcessRegistryBinding getProcessBinding(String hostName, String processName) throws ResourceNotBoundException {
 		try {
-			Cache vmNode = getVMNode(hostName, vmName);
-			VMRegistryBinding binding = (VMRegistryBinding)vmNode.get(VM_CONTROLLER);
+			Cache vmNode = getProcessNode(hostName, processName);
+			ProcessRegistryBinding binding = (ProcessRegistryBinding)vmNode.get(VM_CONTROLLER);
 			if (binding == null) {
-				throw new ResourceNotBoundException(ServicePlugin.Util.getString(ServiceMessages.REGISTRY_0012, hostName+"/"+vmName )); //$NON-NLS-1$				
+				throw new ResourceNotBoundException(ServicePlugin.Util.getString(ServiceMessages.REGISTRY_0012, hostName+"/"+processName )); //$NON-NLS-1$				
 			}
 			return binding;
 		} catch (CacheNodeNotFoundException e) {
-			throw new ResourceNotBoundException(ServicePlugin.Util.getString(ServiceMessages.REGISTRY_0012, hostName+"/"+vmName )); //$NON-NLS-1$
+			throw new ResourceNotBoundException(ServicePlugin.Util.getString(ServiceMessages.REGISTRY_0012, hostName+"/"+processName )); //$NON-NLS-1$
 		} 
 	}
 	
 	
-	protected synchronized void addServiceBinding(String hostName, String vmName, ServiceRegistryBinding binding) throws ResourceAlreadyBoundException, CacheNodeNotFoundException {
-		Cache services = getServices(hostName, vmName);
+	protected synchronized void addServiceBinding(String hostName, String processName, ServiceRegistryBinding binding) throws ResourceAlreadyBoundException, CacheNodeNotFoundException {
+		Cache services = getServices(hostName, processName);
 
 		// check if this service already exists
 		ServiceRegistryBinding existing = (ServiceRegistryBinding)services.get(binding.getServiceID());
@@ -198,8 +198,8 @@
         services.put(binding.getServiceID(), binding);
 	}
 	
-	protected void updateServiceBinding(String hostName, String vmName, ServiceRegistryBinding binding) throws ResourceNotBoundException, CacheNodeNotFoundException {
-		Cache services = getServices(hostName, vmName);
+	protected void updateServiceBinding(String hostName, String processName, ServiceRegistryBinding binding) throws ResourceNotBoundException, CacheNodeNotFoundException {
+		Cache services = getServices(hostName, processName);
 
 		// check if this service already exists
 		ServiceRegistryBinding existing = (ServiceRegistryBinding)services.get(binding.getServiceID());
@@ -210,10 +210,10 @@
         services.put(binding.getServiceID(), binding);	
    }	
 	
-	public ServiceRegistryBinding getServiceBinding(String hostName, String vmName, ServiceID serviceId ) throws ResourceNotBoundException {
+	public ServiceRegistryBinding getServiceBinding(String hostName, String processName, ServiceID serviceId ) throws ResourceNotBoundException {
 		ServiceRegistryBinding binding;
 		try {
-	        Cache services = getServices(hostName, vmName);
+	        Cache services = getServices(hostName, processName);
 			binding = (ServiceRegistryBinding)services.get(serviceId);
 			if (binding == null) {
 				throw new ResourceNotBoundException(ServicePlugin.Util.getString(ServiceMessages.REGISTRY_0011, serviceId ));
@@ -225,21 +225,21 @@
 	}
 
 
-	public List<ServiceRegistryBinding> getActiveServiceBindings(String hostName, String vmName, String serviceType) {
-		return getServiceBindings(hostName, vmName, serviceType);
+	public List<ServiceRegistryBinding> getActiveServiceBindings(String hostName, String processName, String serviceType) {
+		return getServiceBindings(hostName, processName, serviceType);
 	}
 	
 	public List<ServiceRegistryBinding> getServiceBindings(String serviceType) {
 		return getServiceBindings(null, null, serviceType);
 	}
 
-	public List<ServiceRegistryBinding> getServiceBindings(String hostName, String vmName, String serviceType) {
-		return getServiceBindings(hostName, vmName, serviceType, false);
+	public List<ServiceRegistryBinding> getServiceBindings(String hostName, String processName, String serviceType) {
+		return getServiceBindings(hostName, processName, serviceType, false);
 	}
 	
-	private List<ServiceRegistryBinding> getServiceBindings(String hostName, String vmName, String serviceType, boolean active) {
+	private List<ServiceRegistryBinding> getServiceBindings(String hostName, String processName, String serviceType, boolean active) {
 		List services = new ArrayList();
-		List<ServiceRegistryBinding> bindings = getServiceBindings(hostName, vmName);
+		List<ServiceRegistryBinding> bindings = getServiceBindings(hostName, processName);
 		for (ServiceRegistryBinding binding:bindings) {
             if (binding.getServiceType().equals(serviceType)) {
             	if (!active || (active && binding.isActive())) {
@@ -250,27 +250,27 @@
 		return services;
     }
     
-	public List<ServiceRegistryBinding> getServiceBindings(String hostName, String vmName) {
-		return getServiceBindings(hostName, vmName, new ArrayList());
+	public List<ServiceRegistryBinding> getServiceBindings(String hostName, String processName) {
+		return getServiceBindings(hostName, processName, new ArrayList());
 	}	
 	
-	private List<ServiceRegistryBinding> getServiceBindings(String hostName, String vmName, ArrayList list) {
+	private List<ServiceRegistryBinding> getServiceBindings(String hostName, String processName, ArrayList list) {
 		
 		try {
-			if (hostName == null && vmName == null) {
+			if (hostName == null && processName == null) {
 				Collection<Cache> hostNodes = this.cache.getChildren();
 				for(Cache host:hostNodes) {
 					getServiceBindings((String)host.get(NAME), null, list);
 				}
 			}
-			else if (hostName != null && vmName == null) {
+			else if (hostName != null && processName == null) {
 				Collection<Cache> vmNodes = getHostNode(hostName).getChildren();
 				for(Cache vm:vmNodes) {
 					getServiceBindings(hostName, (String)vm.get(NAME), list);
 				}
 			}
-			else if (hostName != null && vmName != null) {
-				Cache services = getServices(hostName, vmName);
+			else if (hostName != null && processName != null) {
+				Cache services = getServices(hostName, processName);
 				list.addAll(services.values());
 			}
 		} catch (CacheNodeNotFoundException e) {
@@ -279,8 +279,8 @@
 		return list;
 	}	
 	
-	private Cache getServices(String hostName, String vmName) throws CacheNodeNotFoundException {
-		Cache vmNode = getVMNode(hostName, vmName);
+	private Cache getServices(String hostName, String processName) throws CacheNodeNotFoundException {
+		Cache vmNode = getProcessNode(hostName, processName);
         Cache services = vmNode.getChild(SERVICES);
         if (services == null) {
         	services = vmNode.addChild(SERVICES);
@@ -288,9 +288,9 @@
         return services;
 	}
 	
-	protected void removeServiceBinding(String hostName, String vmName, ServiceID serviceId) {
+	protected void removeServiceBinding(String hostName, String processName, ServiceID serviceId) {
 		try {
-			Cache services = getServices(hostName, vmName);
+			Cache services = getServices(hostName, processName);
 			services.remove(serviceId);
 		} catch (CacheNodeNotFoundException e) {
 			// OK, this already gone.

Copied: trunk/server/src/main/java/com/metamatrix/platform/registry/ProcessMonitor.java (from rev 534, trunk/server/src/main/java/com/metamatrix/platform/registry/VMMonitor.java)
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/registry/ProcessMonitor.java	                        (rev 0)
+++ trunk/server/src/main/java/com/metamatrix/platform/registry/ProcessMonitor.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -0,0 +1,198 @@
+/*
+ * 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.platform.registry;
+
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import com.google.inject.name.Named;
+import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.util.LogCommonConstants;
+import com.metamatrix.core.MetaMatrixRuntimeException;
+import com.metamatrix.platform.registry.ClusteredRegistryState.CacheNodeNotFoundException;
+import com.metamatrix.platform.service.api.ServiceID;
+import com.metamatrix.platform.service.api.ServiceInterface;
+import com.metamatrix.platform.service.api.exception.ServiceException;
+import com.metamatrix.platform.service.api.exception.ServiceStateException;
+import com.metamatrix.platform.vm.api.controller.ProcessManagement;
+import com.metamatrix.platform.vm.controller.ServerEvents;
+import com.metamatrix.server.Configuration;
+
+/**
+ * This really needs to be the part of/ or be the VMController. 
+ *
+ */
+ at Singleton
+public class ProcessMonitor implements ServerEvents {
+
+	private static final int POLLING_INTERVAL_DEFAULT = 1000*15;
+
+	@Named("metamatrix.server.serviceMonitorInterval") // what is good usage of these kind ?? 
+	int pollingIntervel = POLLING_INTERVAL_DEFAULT;
+	
+	ClusteredRegistryState registry;
+	String hostName;
+	String processName;
+	
+    // Monitors remote vm's to detect when they go down.
+    private Timer vmPollingThread = new Timer("VMPollingThread", true); //$NON-NLS-1$
+    private Timer servicePollingThread = new Timer("ServiceMonitoringThread", true); //$NON-NLS-1$
+    
+	@Inject
+	public ProcessMonitor (@Named(Configuration.HOSTNAME)String hostName, @Named(Configuration.PROCESSNAME)String processname, ClusteredRegistryState registry) {
+		
+		this.hostName = hostName;
+		this.processName = processname;
+		this.registry = registry;
+		
+		// check the health of the other VMS
+		startVMPollingThread();
+		
+		// check health of the local services
+		startServicePollingThread();
+	}
+	
+	/**
+	 * Should be called when the local VM is going down.
+	 */
+	public void shutdown() {
+		this.registry.removeProcess(this.hostName, this.processName);
+	}
+	
+    private void startVMPollingThread() {
+        // Poll vm's to detect when a vm crashes
+    	vmPollingThread.schedule(new TimerTask() {
+    		@Override
+    		public void run() {
+    			List<ProcessRegistryBinding> vmBindings = ProcessMonitor.this.registry.getVMs(null);
+
+    			for (ProcessRegistryBinding binding: vmBindings) {
+                    ProcessManagement vm = binding.getProcessController();
+                    boolean alive = binding.isAlive();
+	                
+                    try {
+	                    vm.ping();
+	                    binding.setAlive(true);
+	                } catch (ServiceException e) {
+	                	// mark as not alive, then no services will be pinged from this vm
+	                	binding.setAlive(false);
+	                }
+	                
+	                // if the vmstate changed then, update the registry.
+	                if (alive != binding.isAlive()) {
+	                	processUpdated(binding);
+	                }
+	            }
+    		}
+    	}, POLLING_INTERVAL_DEFAULT, POLLING_INTERVAL_DEFAULT);
+    }
+    
+    private void startServicePollingThread() {
+        servicePollingThread.schedule(new TimerTask() {
+        	@Override
+        	public void run() {
+        		List<ServiceRegistryBinding> bindings = registry.getServiceBindings(hostName, processName);
+                for (ServiceRegistryBinding binding:bindings) {
+
+                	ServiceInterface si = binding.getService();
+                	try {
+            			// when service in stopped state; this will be null
+            			// if shut down there will not be a binding for it.
+            			if(si != null) {
+            				binding.getService().checkState();
+            			}
+    				} catch (ServiceStateException e) {
+    					// OK to throw up, service will capture the error to logs.
+    				}
+    				
+    				// the state of the service changed, then update the cache.
+    				if (binding.isDirty()) {
+    					serviceUpdated(binding);
+    					binding.setDirty(false);
+    				}
+                }
+        	}
+        }, pollingIntervel, pollingIntervel);
+    }
+
+	public void serviceAdded(ServiceRegistryBinding binding) {
+		try {
+			this.registry.addServiceBinding(hostName, processName, binding);
+			LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "Service Added:"+binding.getServiceID()); //$NON-NLS-1$
+		} catch (ResourceAlreadyBoundException e) {
+			LogManager.logWarning(LogCommonConstants.CTX_CONTROLLER, "Service already exists:"+binding.getServiceID()); //$NON-NLS-1$
+		} catch(CacheNodeNotFoundException e) {
+			LogManager.logError(LogCommonConstants.CTX_CONTROLLER, e, "Failed to add service:"+binding.getServiceID()); //$NON-NLS-1$
+		}
+	}
+
+	public void serviceRemoved(ServiceID id) {
+		this.registry.removeServiceBinding(hostName, processName, id);		
+		LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "Service removed:"+id); //$NON-NLS-1$
+	}
+
+	public void processAdded(ProcessRegistryBinding binding) {
+		binding.setAlive(true);
+		try {
+			this.registry.addProcess(binding.getHostName(), binding.getProcessName(), binding);
+			LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "VM Added:"+binding); //$NON-NLS-1$
+		} catch (CacheNodeNotFoundException e) {
+			LogManager.logError(LogCommonConstants.CTX_CONTROLLER, e, "Failed to add VM:"+binding); //$NON-NLS-1$
+			throw new MetaMatrixRuntimeException("Failed to add VM:"+binding); //$NON-NLS-1$
+		}
+		
+	}
+
+	public void processRemoved(String hostName, String processName) {
+		this.registry.removeProcess(hostName, processName);		
+		LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "VM Removed:<"+hostName+"."+processName+">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+	}
+
+	@Override
+	public void serviceUpdated(ServiceRegistryBinding binding) {
+		try {
+			this.registry.updateServiceBinding(binding.getHostName(), binding.getServiceID().getProcessName(), binding);
+			LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "Service updated:"+binding.getServiceID()); //$NON-NLS-1$
+		} catch(CacheNodeNotFoundException e) {
+			LogManager.logError(LogCommonConstants.CTX_CONTROLLER, e, "Failed to add service:"+binding.getServiceID()); //$NON-NLS-1$
+		} catch (ResourceNotBoundException e) {
+			LogManager.logWarning(LogCommonConstants.CTX_CONTROLLER, "Service not exist:"+binding.getServiceID()); //$NON-NLS-1$
+		}
+	}
+
+	@Override
+	public void processUpdated(ProcessRegistryBinding binding) {
+		try {
+			this.registry.updateProcess(binding.getHostName(), binding.getProcessName(), binding);
+			LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "VM Added:" + binding); //$NON-NLS-1$
+		} catch (CacheNodeNotFoundException e) {
+			LogManager.logError(LogCommonConstants.CTX_CONTROLLER, e, "Failed to add VM:"+ binding); //$NON-NLS-1$
+			throw new MetaMatrixRuntimeException("Failed to add VM:" + binding); //$NON-NLS-1$
+		} catch(ResourceNotBoundException e) {
+			LogManager.logWarning(LogCommonConstants.CTX_CONTROLLER, "VM does not exist:"+binding); //$NON-NLS-1$
+		}
+	}
+}

Copied: trunk/server/src/main/java/com/metamatrix/platform/registry/ProcessRegistryBinding.java (from rev 534, trunk/server/src/main/java/com/metamatrix/platform/registry/VMRegistryBinding.java)
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/registry/ProcessRegistryBinding.java	                        (rev 0)
+++ trunk/server/src/main/java/com/metamatrix/platform/registry/ProcessRegistryBinding.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -0,0 +1,130 @@
+/*
+ * 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.platform.registry;
+
+import java.io.Serializable;
+
+import com.metamatrix.common.config.api.VMComponentDefn;
+import com.metamatrix.common.messaging.MessageBus;
+import com.metamatrix.platform.vm.api.controller.ProcessManagement;
+import com.metamatrix.server.ResourceFinder;
+
+/**
+ * This class is a container for ServiceRegistryBinding objects for
+ * all the services running in this VM
+ */
+public class ProcessRegistryBinding implements Serializable {
+
+    /** Host that this VM belongs to. */
+    private String hostName;
+
+    /** Name of vm */
+    private String processName;
+    
+    private boolean alive;
+
+    /**
+     * Local reference to VMController, this is transient to prevent it from
+     * being sent to other vm's. Remote vm's must use the stub to access vmController
+     */
+    private transient ProcessManagement processController;
+
+    /** Remote reference to VMController */
+    private Object vmControllerStub;
+
+    /** defines vm in configuration */
+    // TODO: this is part of configuration, this should be removed from here..
+    private VMComponentDefn vmComponent;
+
+    private transient MessageBus messageBus;
+    
+    public ProcessRegistryBinding(String hostName, String processName, VMComponentDefn deployedComponent, ProcessManagement vmController, MessageBus bus) {
+    	this.hostName = hostName;
+    	this.processName = processName;
+        this.vmComponent = deployedComponent;
+        this.processController = vmController;
+        this.messageBus = bus;
+        this.vmControllerStub = getStub(vmController);
+    }
+
+    private Object getStub(ProcessManagement controller) {
+        if (controller == null) {
+            return null;
+        }
+        return this.messageBus.export(controller, new Class[] {ProcessManagement.class});
+    }
+
+    /**
+     * Return reference for VMController.
+     * If VMController is running in this VM then return local reference.
+     * Else return remote reference.
+     *
+     * @return VMController reference
+     */
+    public synchronized ProcessManagement getProcessController() {
+
+        // if vmController is null then this must be a remote vm so return the stub.
+        if (this.processController != null) {
+            return processController;
+        }
+        if (this.vmControllerStub == null) {
+        	return null;
+        }
+    	// when exported to the remote, use remote's message bus instance.
+    	MessageBus bus = this.messageBus;
+    	if(bus == null) {
+    		bus = ResourceFinder.getMessageBus();
+    	}        
+        processController = (ProcessManagement)bus.getRPCProxy(this.vmControllerStub);
+        return processController;
+    }
+
+    public VMComponentDefn getDeployedComponent() {
+       return this.vmComponent;
+    }
+
+    public String getHostName() {
+    	return hostName;
+    }
+
+    public String getProcessName() {
+    	return processName;
+    }
+    
+    public String getPort() {
+        return vmComponent.getPort();
+    }
+    
+    public boolean isAlive() {
+    	return this.alive;
+    }
+    
+    public void setAlive(boolean flag) {
+    	this.alive = flag;
+    }
+
+    public String toString() {
+        return "Process<" +this.hostName+"|"+ this.processName + ">"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+    }
+}
+

Modified: trunk/server/src/main/java/com/metamatrix/platform/registry/ServiceRegistryBinding.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/registry/ServiceRegistryBinding.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/registry/ServiceRegistryBinding.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -205,6 +205,10 @@
     public String getHostName() {
         return this.hostName;
     }
+    
+    public String getProcessName() {
+        return this.serviceID.getProcessName();
+    }
 
     public int getCurrentState() {
         return this.currentState;

Deleted: trunk/server/src/main/java/com/metamatrix/platform/registry/VMMonitor.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/registry/VMMonitor.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/registry/VMMonitor.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -1,201 +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.platform.registry;
-
-import java.util.List;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.google.inject.name.Named;
-import com.metamatrix.common.log.LogManager;
-import com.metamatrix.common.util.LogCommonConstants;
-import com.metamatrix.core.MetaMatrixRuntimeException;
-import com.metamatrix.platform.registry.ClusteredRegistryState.CacheNodeNotFoundException;
-import com.metamatrix.platform.service.api.ServiceID;
-import com.metamatrix.platform.service.api.ServiceInterface;
-import com.metamatrix.platform.service.api.exception.ServiceException;
-import com.metamatrix.platform.service.api.exception.ServiceStateException;
-import com.metamatrix.platform.vm.api.controller.VMControllerInterface;
-import com.metamatrix.platform.vm.controller.ServerEvents;
-import com.metamatrix.platform.vm.controller.VMControllerID;
-import com.metamatrix.server.Configuration;
-
-/**
- * This really needs to be the part of/ or be the VMController. 
- *
- */
- at Singleton
-public class VMMonitor implements ServerEvents {
-
-	private static final int POLLING_INTERVAL_DEFAULT = 1000*15;
-
-	@Named("metamatrix.server.serviceMonitorInterval") // what is good usage of these kind ?? 
-	int pollingIntervel = POLLING_INTERVAL_DEFAULT;
-	
-	ClusteredRegistryState registry;
-	String hostName;
-	String vmName;
-	VMControllerID vmId;
-	
-    // Monitors remote vm's to detect when they go down.
-    private Timer vmPollingThread = new Timer("VMPollingThread", true); //$NON-NLS-1$
-    private Timer servicePollingThread = new Timer("ServiceMonitoringThread", true); //$NON-NLS-1$
-    
-	@Inject
-	public VMMonitor (@Named(Configuration.HOSTNAME)String hostName, @Named(Configuration.VMNAME)String vmName, VMControllerID vmId, ClusteredRegistryState registry) {
-		
-		this.hostName = hostName;
-		this.vmName = vmName;
-		this.vmId = vmId;
-		this.registry = registry;
-		
-		// check the health of the other VMS
-		startVMPollingThread();
-		
-		// check health of the local services
-		startServicePollingThread();
-	}
-	
-	/**
-	 * Should be called when the local VM is going down.
-	 */
-	public void shutdown() {
-		this.registry.removeVM(this.hostName, this.vmId.toString());
-	}
-	
-    private void startVMPollingThread() {
-        // Poll vm's to detect when a vm crashes
-    	vmPollingThread.schedule(new TimerTask() {
-    		@Override
-    		public void run() {
-    			List<VMRegistryBinding> vmBindings = VMMonitor.this.registry.getVMs(null);
-
-    			for (VMRegistryBinding binding: vmBindings) {
-                    VMControllerInterface vm = binding.getVMController();
-                    boolean alive = binding.isAlive();
-	                
-                    try {
-	                    vm.ping();
-	                    binding.setAlive(true);
-	                } catch (ServiceException e) {
-	                	// mark as not alive, then no services will be pinged from this vm
-	                	binding.setAlive(false);
-	                }
-	                
-	                // if the vmstate changed then, update the registry.
-	                if (alive != binding.isAlive()) {
-	                	vmUpdated(binding);
-	                }
-	            }
-    		}
-    	}, POLLING_INTERVAL_DEFAULT, POLLING_INTERVAL_DEFAULT);
-    }
-    
-    private void startServicePollingThread() {
-        servicePollingThread.schedule(new TimerTask() {
-        	@Override
-        	public void run() {
-        		List<ServiceRegistryBinding> bindings = registry.getServiceBindings(hostName, vmId.toString());
-                for (ServiceRegistryBinding binding:bindings) {
-
-                	ServiceInterface si = binding.getService();
-                	try {
-            			// when service in stopped state; this will be null
-            			// if shut down there will not be a binding for it.
-            			if(si != null) {
-            				binding.getService().checkState();
-            			}
-    				} catch (ServiceStateException e) {
-    					// OK to throw up, service will capture the error to logs.
-    				}
-    				
-    				// the state of the service changed, then update the cache.
-    				if (binding.isDirty()) {
-    					serviceUpdated(binding);
-    					binding.setDirty(false);
-    				}
-                }
-        	}
-        }, pollingIntervel, pollingIntervel);
-    }
-
-	public void serviceAdded(ServiceRegistryBinding binding) {
-		try {
-			this.registry.addServiceBinding(hostName, vmId.toString(), binding);
-			LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "Service Added:"+binding.getServiceID()); //$NON-NLS-1$
-		} catch (ResourceAlreadyBoundException e) {
-			LogManager.logWarning(LogCommonConstants.CTX_CONTROLLER, "Service already exists:"+binding.getServiceID()); //$NON-NLS-1$
-		} catch(CacheNodeNotFoundException e) {
-			LogManager.logError(LogCommonConstants.CTX_CONTROLLER, e, "Failed to add service:"+binding.getServiceID()); //$NON-NLS-1$
-		}
-	}
-
-	public void serviceRemoved(ServiceID id) {
-		this.registry.removeServiceBinding(hostName, vmId.toString(), id);		
-		LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "Service removed:"+id); //$NON-NLS-1$
-	}
-
-	public void vmAdded(VMRegistryBinding binding) {
-		binding.setAlive(true);
-		try {
-			this.registry.addVM(hostName, vmId.toString(), binding);
-			LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "VM Added:"+binding.getVMControllerID()); //$NON-NLS-1$
-		} catch (CacheNodeNotFoundException e) {
-			LogManager.logError(LogCommonConstants.CTX_CONTROLLER, e, "Failed to add VM:"+binding.getVMControllerID()); //$NON-NLS-1$
-			throw new MetaMatrixRuntimeException("Failed to add VM:"+binding.getVMControllerID()); //$NON-NLS-1$
-		}
-		
-	}
-
-	public void vmRemoved(VMControllerID id) {
-		this.registry.removeVM(hostName, vmId.toString());		
-		LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "VM Removed:"+id); //$NON-NLS-1$
-	}
-
-	@Override
-	public void serviceUpdated(ServiceRegistryBinding binding) {
-		try {
-			this.registry.updateServiceBinding(binding.getHostName(), binding.getServiceID().getVMControllerID().toString(), binding);
-			LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "Service updated:"+binding.getServiceID()); //$NON-NLS-1$
-		} catch(CacheNodeNotFoundException e) {
-			LogManager.logError(LogCommonConstants.CTX_CONTROLLER, e, "Failed to add service:"+binding.getServiceID()); //$NON-NLS-1$
-		} catch (ResourceNotBoundException e) {
-			LogManager.logWarning(LogCommonConstants.CTX_CONTROLLER, "Service not exist:"+binding.getServiceID()); //$NON-NLS-1$
-		}
-	}
-
-	@Override
-	public void vmUpdated(VMRegistryBinding binding) {
-		try {
-			this.registry.updateVM(binding.getHostName(), binding.getVMControllerID().toString(), binding);
-			LogManager.logDetail(LogCommonConstants.CTX_CONTROLLER, "VM Added:"+binding.getVMControllerID()); //$NON-NLS-1$
-		} catch (CacheNodeNotFoundException e) {
-			LogManager.logError(LogCommonConstants.CTX_CONTROLLER, e, "Failed to add VM:"+binding.getVMControllerID()); //$NON-NLS-1$
-			throw new MetaMatrixRuntimeException("Failed to add VM:"+binding.getVMControllerID()); //$NON-NLS-1$
-		} catch(ResourceNotBoundException e) {
-			LogManager.logWarning(LogCommonConstants.CTX_CONTROLLER, "VM does not exist:"+binding.getVMControllerID()); //$NON-NLS-1$
-		}
-	}
-}

Deleted: trunk/server/src/main/java/com/metamatrix/platform/registry/VMRegistryBinding.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/registry/VMRegistryBinding.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/registry/VMRegistryBinding.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -1,152 +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.platform.registry;
-
-import java.io.Serializable;
-
-import com.metamatrix.common.config.api.VMComponentDefn;
-import com.metamatrix.common.messaging.MessageBus;
-import com.metamatrix.server.ResourceFinder;
-import com.metamatrix.platform.vm.api.controller.VMControllerInterface;
-import com.metamatrix.platform.vm.controller.VMControllerID;
-
-/**
- * This class is a container for ServiceRegistryBinding objects for
- * all the services running in this VM
- */
-public class VMRegistryBinding implements Serializable {
-
-    /** ID of VMControllerID */
-    private VMControllerID vmID;
-
-    /** Host that this VM belongs to. */
-    private String hostName;
-
-    /** Name of vm */
-    private String vmName;
-    
-    private boolean alive;
-
-    /**
-     * Local reference to VMController, this is transient to prevent it from
-     * being sent to other vm's. Remote vm's must use the stub to access vmController
-     */
-    private transient VMControllerInterface vmController;
-
-    /** Remote reference to VMController */
-    private Object vmControllerStub;
-
-    /** defines vm in configuration */
-    // TODO: this is part of configuration, this should be removed from here..
-    private VMComponentDefn vmComponent;
-
-    private transient MessageBus messageBus;
-    
-    public VMRegistryBinding(String hostName, VMControllerID vmID, VMComponentDefn deployedComponent, VMControllerInterface vmController, MessageBus bus) {
-    	this.hostName = hostName;
-        this.vmID = vmID;
-        this.vmComponent = deployedComponent;
-        this.vmController = vmController;
-        this.messageBus = bus;
-        try {
-            this.vmName = vmController.getName();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        this.vmControllerStub = getStub(vmController);
-        
-    }
-
-    private Object getStub(VMControllerInterface controller) {
-        if (controller == null) {
-            return null;
-        }
-        return this.messageBus.export(controller, new Class[] {VMControllerInterface.class});
-    }
-
-
-    /**
-     * Return VMControllerID that this binding represents.
-     *
-     * @return VMControllerID
-     */
-    public VMControllerID getVMControllerID() {
-        return vmID;
-    }
-
-
-    /**
-     * Return reference for VMController.
-     * If VMController is running in this VM then return local reference.
-     * Else return remote reference.
-     *
-     * @return VMController reference
-     */
-    public synchronized VMControllerInterface getVMController() {
-
-        // if vmController is null then this must be a remote vm so return the stub.
-        if (this.vmController != null) {
-            return vmController;
-        }
-        if (this.vmControllerStub == null) {
-        	return null;
-        }
-    	// when exported to the remote, use remote's message bus instance.
-    	MessageBus bus = this.messageBus;
-    	if(bus == null) {
-    		bus = ResourceFinder.getMessageBus();
-    	}        
-        vmController = (VMControllerInterface)bus.getRPCProxy(this.vmControllerStub);
-        return vmController;
-    }
-
-    public VMComponentDefn getDeployedComponent() {
-       return this.vmComponent;
-    }
-
-    public String getHostName() {
-    	return hostName;
-    }
-
-    public String getVMName() {
-    	return vmName;
-    }
-    
-    public String getPort() {
-        return vmComponent.getPort();
-    }
-    
-    public boolean isAlive() {
-    	return this.alive;
-    }
-    
-    public void setAlive(boolean flag) {
-    	this.alive = flag;
-    }
-
-    public String toString() {
-        return "VMRegistryBinding: " + this.vmName + " <" + this.vmID + ">"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    }
-}
-

Modified: trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditMessage.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditMessage.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditMessage.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -30,7 +30,7 @@
 import com.metamatrix.common.util.VMNaming;
 
 public class AuditMessage implements Externalizable {
-    public static final String VM_NAME = VMNaming.getVMName();
+    public static final String PROCESS_NAME = VMNaming.getProcessName();
     public static final String HOST_NAME = VMNaming.getConfigName();
 
     private static final String RESOURCE_DELIMITER = ", "; //$NON-NLS-1$
@@ -43,7 +43,7 @@
 	private long timestamp;
     //private String threadName;
     private String hostName;
-    private String vmName;
+    private String processName;
 
 	public AuditMessage() {
 	}
@@ -57,7 +57,7 @@
 	    this.timestamp = System.currentTimeMillis();
         //this.threadName = Thread.currentThread().getName();
         this.hostName = HOST_NAME;
-        this.vmName = VM_NAME;
+        this.processName = PROCESS_NAME;
 	}
 
     public String getContext() {
@@ -72,20 +72,8 @@
         return this.principal;
     }
 
-    //public int getLevel() {
-    //    return this.level;
-    //}
-
-    //public String getLabel() {
-    //    return AuditLevel.getLabelForLevel(level);
-    //}
-	
-    //public String getThreadName() {
-    //    return this.threadName;
-    //}
-
-    public String getVMName() {
-        return this.vmName;
+    public String getProcessName() {
+        return this.processName;
     }
 
     public String getHostName() {
@@ -161,7 +149,7 @@
 		out.writeObject(resources);
 		out.writeLong(timestamp);
 //		out.writeObject(threadName);
-		out.writeObject(vmName);
+		out.writeObject(processName);
 	}
 
 	// implements Externalizable
@@ -173,7 +161,7 @@
 		this.resources = (Object[]) in.readObject();
 		this.timestamp = in.readLong();
 //		this.threadName = (String) in.readObject();
-		this.vmName = (String) in.readObject();
+		this.processName = (String) in.readObject();
 	}
 
 }

Modified: trunk/server/src/main/java/com/metamatrix/platform/security/audit/destination/DatabaseAuditDestination.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/audit/destination/DatabaseAuditDestination.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/audit/destination/DatabaseAuditDestination.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -229,7 +229,7 @@
 					maxGeneralLength));
 
 			// Message VM ID column
-			stmt.setString(7, StringUtil.truncString(message.getVMName(),
+			stmt.setString(7, StringUtil.truncString(message.getProcessName(),
 					maxGeneralLength));
 
 			// Insert the row into the table

Modified: trunk/server/src/main/java/com/metamatrix/platform/security/audit/destination/SingleFileAuditDestination.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/audit/destination/SingleFileAuditDestination.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/audit/destination/SingleFileAuditDestination.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -119,11 +119,11 @@
         int index = fileName.indexOf(VM_NAME_TOKEN);
         if ( index != -1 ) {
             StringBuffer tempFileName = new StringBuffer(fileName);
-            String vmName = VMNaming.getVMName();
-            if ( vmName == null || vmName.trim().length() == 0 ) {
-                vmName = VMNaming.getConfigName();
+            String processName = VMNaming.getProcessName();
+            if ( processName == null || processName.trim().length() == 0 ) {
+                processName = VMNaming.getConfigName();
             }
-            tempFileName.replace(index,index+VM_NAME_TOKEN.length(),vmName);
+            tempFileName.replace(index,index+VM_NAME_TOKEN.length(),processName);
             fileName = tempFileName.toString();
         }
 

Modified: trunk/server/src/main/java/com/metamatrix/platform/security/audit/format/DelimitedAuditMessageFormat.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/audit/format/DelimitedAuditMessageFormat.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/audit/format/DelimitedAuditMessageFormat.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -54,7 +54,7 @@
         msg.append( DELIMITER_CHAR );
         msg.append( message.getHostName() );
         msg.append( DELIMITER_CHAR );
-        msg.append( message.getVMName() );
+        msg.append( message.getProcessName() );
         msg.append( DELIMITER_CHAR );
         msg.append( message.getPrincipal() );
         msg.append( DELIMITER_CHAR );

Modified: trunk/server/src/main/java/com/metamatrix/platform/security/audit/format/ReadableAuditMessageFormat.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/security/audit/format/ReadableAuditMessageFormat.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/security/audit/format/ReadableAuditMessageFormat.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -50,7 +50,7 @@
         msg.append(" ["); //$NON-NLS-1$
         msg.append( message.getHostName() );
         msg.append( '|' );
-        msg.append( message.getVMName() );
+        msg.append( message.getProcessName() );
         msg.append( '|' );
         msg.append( message.getPrincipal() );
         msg.append("] <"); //$NON-NLS-1$

Modified: trunk/server/src/main/java/com/metamatrix/platform/service/api/ServiceInterface.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/service/api/ServiceInterface.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/service/api/ServiceInterface.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -29,7 +29,6 @@
 import com.metamatrix.common.comm.ClientServiceRegistry;
 import com.metamatrix.common.config.api.DeployedComponentID;
 import com.metamatrix.common.queue.WorkerPoolStats;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 
 public interface ServiceInterface {
 
@@ -77,17 +76,18 @@
      */
     Date getStartTime();
 
-    /*
+    /**
      * Determine which host the service instance is running on.
      * @return Host the service is running on
      */
     String getHostname();
 
     /**
-     * Get the id of the VM that the service is running in.
+     * Get process name on which this service is running on
+     * @return
      */
-    VMControllerID getVMID();
-
+    String getProcessName();
+    
     /**
      * Determine if the service is alive and well.
      */

Modified: trunk/server/src/main/java/com/metamatrix/platform/service/controller/AbstractService.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/service/controller/AbstractService.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/service/controller/AbstractService.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -39,7 +39,6 @@
 import com.metamatrix.common.queue.WorkerPoolStats;
 import com.metamatrix.common.util.LogCommonConstants;
 import com.metamatrix.common.util.PasswordMaskUtil;
-import com.metamatrix.common.util.VMNaming;
 import com.metamatrix.core.event.EventObjectListener;
 import com.metamatrix.core.log.MessageLevel;
 import com.metamatrix.platform.service.ServiceMessages;
@@ -52,7 +51,6 @@
 import com.metamatrix.platform.service.api.exception.ServiceNotInitializedException;
 import com.metamatrix.platform.service.api.exception.ServiceStateException;
 import com.metamatrix.platform.service.api.exception.ServiceSuspendedException;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 
 /**
  * Base class for all services.
@@ -270,24 +268,22 @@
     }
 
     /**
-     * Return VMControllerID for vm service is running in.
-     *
-     * @return VMControllerID
-     */
-    public VMControllerID getVMID() {
-        return id.getVMControllerID();
-    }
-
-    /**
      * Return name of the host service is running on.
      *
      * @return String Host name
      */
     public final String getHostname() {
-        return VMNaming.getConfigName();
+        return this.id.getHostName();
     }
 
     /**
+     * @see com.metamatrix.platform.service.api.ServiceInterface#getProcessName()
+     */
+	public final String getProcessName(){
+		return this.id.getProcessName();
+	}
+	
+    /**
      * Return instance name of this service.
      *
      * @return String instance name

Modified: trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -40,7 +40,6 @@
 import com.metamatrix.platform.service.ServicePlugin;
 import com.metamatrix.platform.service.api.ServiceInterface;
 import com.metamatrix.platform.util.PlatformProxyHelper;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 import com.metamatrix.server.Configuration;
 
 /**
@@ -62,16 +61,13 @@
 	
 	String hostName;
 		
-	String vmName;
+	String processName;
 	
-	VMControllerID vmID;
-
     @Inject
-    public ProxyManager(@Named(Configuration.HOSTNAME)String hostName, @Named(Configuration.VMNAME)String vmName, VMControllerID vmID, ClusteredRegistryState registry) {
+    public ProxyManager(@Named(Configuration.HOSTNAME)String hostName, @Named(Configuration.PROCESSNAME)String processName, ClusteredRegistryState registry) {
     	this.hostName = hostName;
-    	this.vmName = vmName;
+    	this.processName = processName;
     	this.registry = registry;
-    	this.vmID = vmID;
     	this.registry.addListener(this);
     }
     
@@ -218,7 +214,7 @@
      * @param serviceType The type of the service of interest.
      */
     private void setServiceInstances(ServiceSelectionPolicy policy, String serviceType) {
-        List localServiceBindings = this.registry.getActiveServiceBindings(this.hostName, this.vmID.toString(), serviceType);
+        List localServiceBindings = this.registry.getActiveServiceBindings(this.hostName, this.processName, serviceType);
         List serviceBindings = this.registry.getActiveServiceBindings(null, null, serviceType);
         serviceBindings.removeAll(localServiceBindings);
         policy.updateServices(localServiceBindings, serviceBindings);

Copied: trunk/server/src/main/java/com/metamatrix/platform/vm/api/controller/ProcessManagement.java (from rev 535, trunk/server/src/main/java/com/metamatrix/platform/vm/api/controller/VMControllerInterface.java)
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/vm/api/controller/ProcessManagement.java	                        (rev 0)
+++ trunk/server/src/main/java/com/metamatrix/platform/vm/api/controller/ProcessManagement.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -0,0 +1,122 @@
+/*
+ * 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.platform.vm.api.controller;
+
+import java.net.InetAddress;
+import java.util.Date;
+
+import com.metamatrix.admin.api.exception.AdminException;
+import com.metamatrix.common.config.api.ServiceComponentDefnID;
+import com.metamatrix.common.log.LogConfiguration;
+import com.metamatrix.platform.service.api.ServiceID;
+import com.metamatrix.platform.vm.controller.ProcessStatistics;
+
+public interface ProcessManagement {
+    
+	/**
+	 * Starts the VM by invoking all the deployed services
+	 */
+	public void start();
+	
+	
+    /**
+     * Shut down all services waiting for work to complete.
+     * Essential services will also be shutdown.
+     */
+    void shutdown(boolean now);
+    
+	/**
+	 *  Start the service identified by the ServiceComponentID
+	 *  If synch is true then wait for service to start before returning.
+	 *  Any exceptions will then be thrown to the caller.
+	 *  If synch is false then start service asynchronously.
+	 */
+	public void startDeployedService(ServiceComponentDefnID id);
+
+	/**
+	 * Start a previously stopped service
+	 */
+	void startService(ServiceID serviceID);
+
+
+	/**
+	 * Kill service once work is complete
+	 */
+	void stopService(ServiceID id, boolean now, boolean shutdown);
+
+    /**
+     * Check the state of a service
+     */
+    void checkService(ServiceID serviceID);
+
+    /**
+     * Set the current log configuration.
+     */
+    void setCurrentLogConfiguration(LogConfiguration logConfiguration);
+
+	/**
+	 * Get the time the VM was initialized.
+	 */
+    Date getStartTime();
+
+	/**
+	 * Get the address of the host this VM is running on.
+	 */
+    InetAddress getAddress();
+
+	/**
+	 * Get the name for this controller.
+	 */
+    String getName();
+
+	/**
+	 * Method called from registries to determine if VMController is alive.
+	 */
+	void ping();
+
+    /**
+     * Returns true if system is being shutdown.
+     */
+    boolean isShuttingDown();
+
+    /**
+     * Return information about VM.
+     * totalMemory, freeMemory, threadCount
+     */
+    ProcessStatistics getVMStatistics();
+
+    /**
+     * dumps stack trace to log file.
+     */
+    void dumpThreads();
+
+    /**
+     * Export the server logs to a byte[].  The bytes contain the contents of a .zip file containing the logs. 
+     * This will export all logs on the host that contains this VMController.
+     * @return the logs, as a byte[].
+     * @throws AdminException
+     * @since 4.3
+     */
+    byte[] exportLogs();
+}
+

Deleted: trunk/server/src/main/java/com/metamatrix/platform/vm/api/controller/VMControllerInterface.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/vm/api/controller/VMControllerInterface.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/vm/api/controller/VMControllerInterface.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -1,128 +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.platform.vm.api.controller;
-
-import java.net.InetAddress;
-import java.util.Date;
-
-import com.metamatrix.admin.api.exception.AdminException;
-import com.metamatrix.common.config.api.ServiceComponentDefnID;
-import com.metamatrix.common.log.LogConfiguration;
-import com.metamatrix.platform.service.api.ServiceID;
-import com.metamatrix.platform.vm.controller.VMControllerID;
-import com.metamatrix.platform.vm.controller.VMStatistics;
-
-public interface VMControllerInterface {
-    
-	/**
-	 * Starts the VM by invoking all the deployed services
-	 */
-	public void start();
-	
-	
-    /**
-     * Shut down all services waiting for work to complete.
-     * Essential services will also be shutdown.
-     */
-    void shutdown(boolean now);
-    
-	/**
-	 *  Start the service identified by the ServiceComponentID
-	 *  If synch is true then wait for service to start before returning.
-	 *  Any exceptions will then be thrown to the caller.
-	 *  If synch is false then start service asynchronously.
-	 */
-	public void startDeployedService(ServiceComponentDefnID id);
-
-	/**
-	 * Start a previously stopped service
-	 */
-	void startService(ServiceID serviceID);
-
-
-	/**
-	 * Kill service once work is complete
-	 */
-	void stopService(ServiceID id, boolean now, boolean shutdown);
-
-    /**
-     * Check the state of a service
-     */
-    void checkService(ServiceID serviceID);
-
-    /**
-     * Set the current log configuration.
-     */
-    void setCurrentLogConfiguration(LogConfiguration logConfiguration);
-
-	/**
-	 * Get the time the VM was initialized.
-	 */
-    Date getStartTime();
-
-	/**
-	 * Get the address of the host this VM is running on.
-	 */
-    InetAddress getAddress();
-
-	/**
-	 * Get the ID for this controller.
-	 */
-    VMControllerID getID() ;
-
-	/**
-	 * Get the name for this controller.
-	 */
-    String getName();
-
-	/**
-	 * Method called from registries to determine if VMController is alive.
-	 */
-	void ping();
-
-    /**
-     * Returns true if system is being shutdown.
-     */
-    boolean isShuttingDown();
-
-    /**
-     * Return information about VM.
-     * totalMemory, freeMemory, threadCount
-     */
-    VMStatistics getVMStatistics();
-
-    /**
-     * dumps stack trace to log file.
-     */
-    void dumpThreads();
-
-    /**
-     * Export the server logs to a byte[].  The bytes contain the contents of a .zip file containing the logs. 
-     * This will export all logs on the host that contains this VMController.
-     * @return the logs, as a byte[].
-     * @throws AdminException
-     * @since 4.3
-     */
-    byte[] exportLogs();
-}
-

Copied: trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java (from rev 535, trunk/server/src/main/java/com/metamatrix/platform/vm/controller/VMController.java)
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java	                        (rev 0)
+++ trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -0,0 +1,944 @@
+/*
+ * 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.platform.vm.controller;
+
+import java.io.File;
+import java.lang.reflect.Proxy;
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import com.metamatrix.admin.api.exception.AdminException;
+import com.metamatrix.admin.api.server.ServerAdmin;
+import com.metamatrix.admin.server.ServerAdminImpl;
+import com.metamatrix.admin.util.AdminMethodRoleResolver;
+import com.metamatrix.api.exception.MetaMatrixComponentException;
+import com.metamatrix.api.exception.MultipleException;
+import com.metamatrix.common.comm.ClientServiceRegistry;
+import com.metamatrix.common.comm.platform.socket.server.AdminAuthorizationInterceptor;
+import com.metamatrix.common.comm.platform.socket.server.LogonImpl;
+import com.metamatrix.common.config.CurrentConfiguration;
+import com.metamatrix.common.config.JDBCConnectionPoolHelper;
+import com.metamatrix.common.config.api.ComponentTypeID;
+import com.metamatrix.common.config.api.ConfigurationModelContainer;
+import com.metamatrix.common.config.api.DeployedComponent;
+import com.metamatrix.common.config.api.DeployedComponentID;
+import com.metamatrix.common.config.api.Host;
+import com.metamatrix.common.config.api.HostID;
+import com.metamatrix.common.config.api.HostType;
+import com.metamatrix.common.config.api.ProductServiceConfigID;
+import com.metamatrix.common.config.api.ServiceComponentDefn;
+import com.metamatrix.common.config.api.ServiceComponentDefnID;
+import com.metamatrix.common.config.api.VMComponentDefn;
+import com.metamatrix.common.config.api.VMComponentDefnID;
+import com.metamatrix.common.config.api.VMComponentDefnType;
+import com.metamatrix.common.config.api.exceptions.ConfigurationException;
+import com.metamatrix.common.id.dbid.DBIDGenerator;
+import com.metamatrix.common.id.dbid.DBIDGeneratorException;
+import com.metamatrix.common.log.LogConfiguration;
+import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.messaging.MessageBus;
+import com.metamatrix.common.queue.WorkerPool;
+import com.metamatrix.common.queue.WorkerPoolFactory;
+import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.common.util.LogCommonConstants;
+import com.metamatrix.common.util.PropertiesUtils;
+import com.metamatrix.common.util.VMNaming;
+import com.metamatrix.common.util.LogContextsUtil.PlatformAdminConstants;
+import com.metamatrix.core.util.FileUtil;
+import com.metamatrix.core.util.ZipFileUtil;
+import com.metamatrix.metadata.runtime.RuntimeMetadataCatalog;
+import com.metamatrix.platform.PlatformPlugin;
+import com.metamatrix.platform.admin.api.AuthorizationAdminAPI;
+import com.metamatrix.platform.admin.api.ConfigurationAdminAPI;
+import com.metamatrix.platform.admin.api.ExtensionSourceAdminAPI;
+import com.metamatrix.platform.admin.api.MembershipAdminAPI;
+import com.metamatrix.platform.admin.api.RuntimeStateAdminAPI;
+import com.metamatrix.platform.admin.api.SessionAdminAPI;
+import com.metamatrix.platform.admin.apiimpl.AdminHelper;
+import com.metamatrix.platform.admin.apiimpl.AuthorizationAdminAPIImpl;
+import com.metamatrix.platform.admin.apiimpl.ConfigurationAdminAPIImpl;
+import com.metamatrix.platform.admin.apiimpl.ExtensionSourceAdminAPIImpl;
+import com.metamatrix.platform.admin.apiimpl.MembershipAdminAPIImpl;
+import com.metamatrix.platform.admin.apiimpl.RuntimeStateAdminAPIImpl;
+import com.metamatrix.platform.admin.apiimpl.SessionAdminAPIImpl;
+import com.metamatrix.platform.config.api.service.ConfigurationServiceInterface;
+import com.metamatrix.platform.registry.ClusteredRegistryState;
+import com.metamatrix.platform.registry.ResourceNotBoundException;
+import com.metamatrix.platform.registry.ServiceRegistryBinding;
+import com.metamatrix.platform.registry.ProcessRegistryBinding;
+import com.metamatrix.platform.security.api.ILogon;
+import com.metamatrix.platform.security.api.service.AuthorizationServiceInterface;
+import com.metamatrix.platform.security.api.service.MembershipServiceInterface;
+import com.metamatrix.platform.security.api.service.SessionServiceInterface;
+import com.metamatrix.platform.service.api.ServiceID;
+import com.metamatrix.platform.service.api.ServiceInterface;
+import com.metamatrix.platform.service.api.ServiceState;
+import com.metamatrix.platform.service.api.exception.ServiceException;
+import com.metamatrix.platform.service.controller.ServicePropertyNames;
+import com.metamatrix.platform.util.ErrorMessageKeys;
+import com.metamatrix.platform.util.LogMessageKeys;
+import com.metamatrix.platform.util.LogPlatformConstants;
+import com.metamatrix.platform.util.PlatformProxyHelper;
+import com.metamatrix.platform.vm.api.controller.ProcessManagement;
+import com.metamatrix.server.HostManagement;
+import com.metamatrix.server.ResourceFinder;
+import com.metamatrix.server.admin.api.QueryAdminAPI;
+import com.metamatrix.server.admin.api.RuntimeMetadataAdminAPI;
+import com.metamatrix.server.admin.api.TransactionAdminAPI;
+import com.metamatrix.server.admin.apiimpl.QueryAdminAPIImpl;
+import com.metamatrix.server.admin.apiimpl.RuntimeMetadataAdminAPIImpl;
+import com.metamatrix.server.admin.apiimpl.TransactionAdminAPIImpl;
+
+/**
+ * This class is used to start up a server process and start all services that are 
+ * configured under this server
+ */
+public abstract class ProcessController implements ProcessManagement {
+
+    public static final String STARTER_MAX_THREADS = "vm.starter.maxThreads"; //$NON-NLS-1$
+    /**Time-to-live for threads used to start services (ms)*/    
+    public static final String STARTER_TIMETOLIVE = "vm.starter.timetolive"; //$NON-NLS-1$
+    /**Interval to check the state of services (ms)*/    
+    public static final String SERVICE_MONITOR_INTERVAL = "metamatrix.server.serviceMonitorInterval"; //$NON-NLS-1$
+        
+    // this is a 4.2.2 property used for command line setting
+    private static final String STOP_DELAY_TIME = "metamatrix.vm.stop.delay.sec"; //$NON-NLS-1$
+    
+    private static final int DEFAULT_FORCE_SHUTDOWN_TIME = 30;
+    public static final int DEFAULT_STARTER_MAX_THREADS = 15; 
+    public static final int DEFAULT_STARTER_TIMETOLIVE = 15000;
+    
+    protected Host host;
+    protected String processName;
+    
+	private Date startTime;
+	private Properties vmProps;
+	VMComponentDefn vmComponentDefn;
+
+    private boolean shuttingDown = false;
+
+    //WorkerPool used for starting services asynchronously
+    private WorkerPool startServicePool;    
+    
+    protected ClusteredRegistryState registry;
+    
+    private MessageBus messageBus;
+    
+    // Server events that are being generated
+    ServerEvents events;
+    
+    protected ClientServiceRegistry clientServices;
+    private Map<ComponentTypeID, Properties> defaultPropertiesCache = new HashMap<ComponentTypeID, Properties>();
+    private Properties hostProperties;
+
+    private int force_shutdown_time = DEFAULT_FORCE_SHUTDOWN_TIME;
+
+    /**
+     * Create a new instance of VMController.
+     *
+     * @param processName Name of Process
+     * @param startDeployedServices If true all services that are deployed to this vm are started.
+     * @param standalone If true indicates that VMController is running in its own vm.
+     * @throws Exception if an error occurs initializing vmController
+     */
+    public ProcessController(Host host, String processname, ClusteredRegistryState registry, ServerEvents serverEvents, MessageBus bus, HostManagement hostManagement) throws Exception {
+    	this.host = host;
+    	this.processName = processname;
+    	
+    	this.registry = registry;
+    	this.events = serverEvents;
+    	this.messageBus = bus;
+    	    	
+        Properties configProps = CurrentConfiguration.getInstance().getProperties(); 
+        int maxThreads = PropertiesUtils.getIntProperty(configProps, STARTER_MAX_THREADS, DEFAULT_STARTER_MAX_THREADS);
+        int timeToLive = PropertiesUtils.getIntProperty(configProps, STARTER_TIMETOLIVE, DEFAULT_STARTER_TIMETOLIVE);
+    	
+        this.startServicePool = WorkerPoolFactory.newWorkerPool("StartServiceQueue", maxThreads, timeToLive); //$NON-NLS-1$
+        
+		initVMProperties(host.getFullName(), processname);
+		
+        this.startTime = new Date();
+
+        this.clientServices = new ClientServiceRegistry();
+
+        RuntimeMetadataCatalog.getInstance().init(CurrentConfiguration.getInstance().getProperties(), ResourceFinder.getMessageBus(), ResourceFinder.getCacheFactory());
+        
+        this.registerILogonAPI();
+        this.registerAdmin(hostManagement);
+        
+        this.registerSubSystemAdminAPIs(hostManagement);
+        
+        addShutdownHook();        
+    }
+
+	
+    /**
+     * Register the ServiceInterceptors for the SubSystemAdminAPIs 
+     * @throws MetaMatrixComponentException
+     */
+    private void registerSubSystemAdminAPIs(HostManagement hostManagement) throws MetaMatrixComponentException {
+        this.clientServices.registerClientService(ConfigurationAdminAPI.class, ConfigurationAdminAPIImpl.getInstance(this.registry), PlatformAdminConstants.CTX_CONFIGURATION_ADMIN_API);
+        this.clientServices.registerClientService(RuntimeStateAdminAPI.class, RuntimeStateAdminAPIImpl.getInstance(this.registry, hostManagement), PlatformAdminConstants.CTX_RUNTIME_STATE_ADMIN_API);
+        this.clientServices.registerClientService(MembershipAdminAPI.class, MembershipAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
+        this.clientServices.registerClientService(SessionAdminAPI.class, SessionAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
+        this.clientServices.registerClientService(AuthorizationAdminAPI.class, AuthorizationAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_AUTHORIZATION_ADMIN_API);
+        this.clientServices.registerClientService(ExtensionSourceAdminAPI.class, ExtensionSourceAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
+        this.clientServices.registerClientService(QueryAdminAPI.class, QueryAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
+        this.clientServices.registerClientService(RuntimeMetadataAdminAPI.class, RuntimeMetadataAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_RUNTIME_METADATA_ADMIN_API);
+        this.clientServices.registerClientService(TransactionAdminAPI.class, TransactionAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
+    }	
+    
+    
+    /**
+     * Register a ServiceInterceptor for the new Admin API, so that the client can access it via messaging.
+     * @throws AdminException 
+     * 
+     * @throws MetaMatrixComponentException
+     */
+    private void registerAdmin(HostManagement hostManagement) throws AdminException {
+    	ServerAdminImpl serverAdminImpl = new ServerAdminImpl(this.registry, hostManagement);
+    	AdminMethodRoleResolver adminMethodRoleResolver = new AdminMethodRoleResolver();
+    	adminMethodRoleResolver.init();
+    	ServerAdmin roleCheckedServerAdmin = (ServerAdmin)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {ServerAdmin.class}, new AdminAuthorizationInterceptor(new AdminHelper(), adminMethodRoleResolver, serverAdminImpl));
+    	this.clientServices.registerClientService(ServerAdmin.class, roleCheckedServerAdmin, PlatformAdminConstants.CTX_ADMIN);
+    }
+    
+    /** 
+     * Register ILogonAPI's ServiceInterceptor
+     * @throws ServiceException 
+     * @throws ConfigurationException 
+     */
+    private void registerILogonAPI() throws ConfigurationException, ServiceException {
+    	this.clientServices.registerClientService(ILogon.class, new LogonImpl(PlatformProxyHelper.getSessionServiceProxy(PlatformProxyHelper.ROUND_ROBIN_LOCAL), CurrentConfiguration.getInstance().getClusterName()), LogCommonConstants.CTX_LOGON);
+    }    
+
+	private void addShutdownHook() {
+        Runtime.getRuntime().addShutdownHook(new Thread() {
+            public void run() {
+            	try {
+					shutdown(false);
+				} catch (Exception e) {
+					// ignore
+				}
+            }            	
+        });
+	}
+    
+    /**
+     * Lazily get Current Configuration
+     */
+    ConfigurationModelContainer getConfigurationModel() throws ConfigurationException {
+        return CurrentConfiguration.getInstance().getConfigurationModel();
+    }    
+
+    /**
+     * Initialize vm properties.
+     * This method initializes the following global attributes.
+     *
+     *  - hostID
+     *  - vmComponentDefnID
+     *  - vmProps
+     */
+	private void initVMProperties(String hostname, String processName) throws Exception {
+        ConfigurationModelContainer config = getConfigurationModel();
+        
+        VMComponentDefn deployedVM = config.getConfiguration().getVMForHost(hostname, processName);
+
+        if (deployedVM != null) {
+        	this.vmComponentDefn = deployedVM;
+        	            
+           vmProps = config.getDefaultPropertyValues(deployedVM.getComponentTypeID());
+           Properties props = config.getConfiguration().getAllPropertiesForComponent(deployedVM.getID());
+           vmProps.putAll(props);
+           
+           // this system property setting will override the setting in the VM
+           // this is done because the command line argument
+           force_shutdown_time = PropertiesUtils.getIntProperty(System.getProperties(), STOP_DELAY_TIME, DEFAULT_FORCE_SHUTDOWN_TIME);
+           if (DEFAULT_FORCE_SHUTDOWN_TIME == force_shutdown_time) {
+               force_shutdown_time = PropertiesUtils.getIntProperty(vmProps, VMComponentDefnType.FORCED_SHUTDOWN_TIME, DEFAULT_FORCE_SHUTDOWN_TIME);
+           }
+           
+           Properties allProps = new Properties();
+           allProps.putAll(System.getProperties());
+           allProps.putAll(config.getConfiguration().getProperties());
+           allProps.putAll(host.getProperties());
+           allProps.putAll(props);
+           System.setProperties(allProps);
+           
+           logMessage(PlatformPlugin.Util.getString("VMController.VM_Force_Shutdown_Time", force_shutdown_time)); //$NON-NLS-1$
+           
+           // add the vm to registry
+           ProcessRegistryBinding binding = new ProcessRegistryBinding(host.getFullName(), this.processName, deployedVM, this, this.messageBus);        
+           this.events.processAdded(binding);
+        }
+	}
+
+    protected void logMessage(String s) {
+        LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, s);
+    }
+
+	public void start() {
+    			
+        logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0013));
+        VMComponentDefnID vmComponentDefnID = (VMComponentDefnID)this.vmComponentDefn.getID();
+
+        try {
+            ConfigurationModelContainer configuration = getConfigurationModel();
+
+            Collection deployedServices = configuration.getConfiguration().getDeployedServicesForVM(this.vmComponentDefn);
+            
+            logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0014, new Integer(deployedServices.size()), vmComponentDefnID.getName()));
+
+            ArrayList essentialServices = new ArrayList();
+            ArrayList otherServices = new ArrayList();
+            
+            // create a list of platform services and other services
+            Iterator servicesIterator = deployedServices.iterator();
+            while (servicesIterator.hasNext()) {
+                DeployedComponent depComp = (DeployedComponent) servicesIterator.next();
+
+                ServiceComponentDefn scd = (ServiceComponentDefn) depComp.getDeployedComponentDefn(configuration.getConfiguration());
+
+                if (scd.isEssential()) {
+                    essentialServices.add(depComp);
+                } else {
+                    otherServices.add(depComp);
+                }
+            }
+
+            // start platform services first (synchronously) 
+            boolean errored = false;
+            servicesIterator = essentialServices.iterator();
+            while (servicesIterator.hasNext()) {
+                DeployedComponent depComp = (DeployedComponent) servicesIterator.next();
+                try {
+                    startDeployedService(depComp, null, configuration, true);
+                } catch (Exception e) {
+                    errored = true;
+                    // error already logged from startDeployedService method.
+                    // continue starting services.
+                }
+            }
+            
+            if (errored) return;
+            
+
+            // now start the rest of the services asynchronously
+            servicesIterator = otherServices.iterator();
+            while (servicesIterator.hasNext()) {
+                DeployedComponent depComp = (DeployedComponent) servicesIterator.next();
+                try {
+                    startDeployedService(depComp, null, configuration, false);
+                } catch (Exception e) {
+                    // error already logged from startDeployedService method.
+                    // continue starting services.
+                }
+            }
+            logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0016, new Integer(deployedServices.size()),  vmComponentDefnID.getName()));
+
+        } catch (ConfigurationException e) {
+            logException(e, PlatformPlugin.Util.getString(LogMessageKeys.VM_0017, vmComponentDefnID.getName(), host.getID().getName()));
+        }
+    }
+
+
+    public void startService(ServiceID serviceID) {
+        logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0018, serviceID));
+
+        ServiceRegistryBinding binding = null;
+
+        try {
+            binding = this.registry.getServiceBinding(serviceID.getHostName(), serviceID.getProcessName(), serviceID);
+        } catch (ResourceNotBoundException e) {
+            String msg = PlatformPlugin.Util.getString(LogMessageKeys.VM_0019, serviceID);
+            throw new ServiceException(e, msg);
+        } catch (Exception e) {
+            String msg = PlatformPlugin.Util.getString(LogMessageKeys.VM_0020, serviceID);
+            throw new ServiceException(e, msg);
+        }
+
+        if (!binding.isServiceBad()) {
+            throw new ServiceException(PlatformPlugin.Util.getString(LogMessageKeys.VM_0021, serviceID));
+        }
+
+        try {
+            ConfigurationModelContainer configuration = getConfigurationModel();
+            startDeployedService(binding.getDeployedComponent(), serviceID, configuration, true);
+
+        } catch (Exception e) {
+            throw new ServiceException(e, PlatformPlugin.Util.getString(LogMessageKeys.VM_0022, serviceID));
+        }
+    }
+
+    public void startDeployedService(ServiceComponentDefnID id) {
+        logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0023, id));
+        startDeployedService(id, null);
+    }
+
+	private void startDeployedService(ServiceComponentDefnID defnID, ServiceID serviceID) {
+        try {
+            ConfigurationModelContainer configuration = getConfigurationModel();
+            VMComponentDefnID vmComponentDefnID = (VMComponentDefnID)this.vmComponentDefn.getID();
+            DeployedComponent deployedService = configuration.getConfiguration().getDeployedServiceForVM(defnID, vmComponentDefnID, (HostID) getConfigHost().getID());
+            startDeployedService(deployedService, serviceID, configuration, true);
+        } catch (Exception e) {
+            String msg = PlatformPlugin.Util.getString(LogMessageKeys.VM_0024, defnID);
+            throw new ServiceException(e, msg);
+        }
+    }
+
+	/**
+	 *  Start the service identified by the DeployedComponentID
+	 *  If synch is true then wait for service to start before returning.
+	 *  Any exceptions will then be thrown to the caller.
+	 *  If synch is false then start service asynchronously.
+	 * @throws ConfigurationException 
+	 */
+	private void startDeployedService(DeployedComponent deployedService, ServiceID serviceID, ConfigurationModelContainer configModel, boolean synch) throws ConfigurationException {
+        Properties defaultProps = null;
+        synchronized (this) {
+            defaultProps = defaultPropertiesCache.get(deployedService.getComponentTypeID());
+            
+            if (defaultProps == null) {
+                if (hostProperties == null) {
+                    hostProperties = CurrentConfiguration.getInstance().getSystemBootStrapProperties();
+                    hostProperties = new Properties(hostProperties);
+                    PropertiesUtils.putAll(hostProperties, host.getProperties());
+                }
+                defaultProps = new Properties(hostProperties);
+                defaultProps.putAll(configModel.getDefaultPropertyValues(deployedService.getComponentTypeID()));
+                defaultPropertiesCache.put(deployedService.getComponentTypeID(), defaultProps);
+            }
+        }
+        Properties serviceProps = new Properties(defaultProps);
+        Properties props = configModel.getConfiguration().getAllPropertiesForComponent(deployedService.getID());
+        serviceProps.putAll(props);
+        PropertiesUtils.setOverrideProperies(serviceProps, hostProperties);
+        
+        ProductServiceConfigID pscID = deployedService.getProductServiceConfigID();
+        String serviceClassName = serviceProps.getProperty( ServicePropertyNames.SERVICE_CLASS_NAME );
+
+        if (serviceClassName != null && serviceClassName.length() > 0) {
+            logMessage( PlatformPlugin.Util.getString(LogMessageKeys.VM_0025, deployedService.getServiceComponentDefnID().getName(), processName, host.getID().getName()));
+
+            serviceProps.put(ServicePropertyNames.INSTANCE_NAME, deployedService.getName());
+            serviceProps.put(ServicePropertyNames.SERVICE_NAME, deployedService.getServiceComponentDefnID().getName());
+            serviceProps.put(ServicePropertyNames.COMPONENT_TYPE_NAME, deployedService.getComponentTypeID().getFullName());
+
+            // get routing id.
+            if (!deployedService.isDeployedConnector()) {
+                serviceProps.put(ServicePropertyNames.SERVICE_ROUTING_ID, deployedService.getComponentTypeID().getFullName());
+            } else {
+                ServiceComponentDefn scd = (ServiceComponentDefn) deployedService.getDeployedComponentDefn(configModel.getConfiguration());
+                String routingID = scd.getRoutingUUID();
+                serviceProps.put(ServicePropertyNames.SERVICE_ROUTING_ID, routingID);
+            }
+            startService(this.clientServices, serviceClassName, serviceID, deployedService, pscID, serviceProps, synch );
+
+        } else {
+            String msg = PlatformPlugin.Util.getString(LogMessageKeys.VM_0026, new Object[] {ServicePropertyNames.SERVICE_CLASS_NAME, deployedService.getServiceComponentDefnID().getName(), processName, host.getID().getName()});
+            throw new ServiceException(msg);
+        }
+
+    }
+	
+    /**
+     * Shut down all services waiting for work to complete.
+     * Essential services will also be shutdown.
+     */
+	public synchronized void shutdown(boolean now) {
+		logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0041));
+		
+		try {
+            stopServices(now, true);
+        } catch (MultipleException e) {
+        	logException(e, e.getMessage());
+        } catch (ServiceException e) {
+            logException(e, e.getMessage());
+        } 
+
+		JDBCConnectionPoolHelper.getInstance().shutDown();
+
+        // unregister VMController
+        events.processRemoved(host.getFullName(), this.processName);
+        
+        this.shuttingDown = true;
+
+        notifyAll();        
+        
+		this.startServicePool.execute(new Runnable() {
+            public void run() {
+                // Wait before killing the VM.
+                try {
+                    Thread.sleep(force_shutdown_time * 1000);
+                } catch (Exception e) {}
+                // And exit.
+                System.exit(1);
+            }
+        });
+    }
+
+
+	/**
+	 * Kill service once work is complete
+	 */
+	public void stopService(ServiceID id, boolean now, boolean shutdown) {
+        try {
+			logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0035, id));
+			validateServiceID(id);
+			ServiceRegistryBinding binding = this.registry.getServiceBinding(id.getHostName(), id.getProcessName(), id);
+			stopService(binding, now, shutdown);
+		} catch (ResourceNotBoundException e) {
+			throw new ServiceException(e);
+		}
+    }
+
+    /**
+     * Set the current log configuration for this vm.
+     */
+    public void setCurrentLogConfiguration(LogConfiguration logConfiguration) {
+        logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0046, logConfiguration));
+        LogManager.setLogConfiguration(logConfiguration);
+    }
+
+	/**
+	 * Get the time the VM was initialized.
+	 */
+    public Date getStartTime() {
+        return this.startTime;
+    }
+
+    
+    public Host getConfigHost() {
+        return this.host;
+    }
+       
+    /**
+	 * Method called from registries to determine if VMController is alive.
+	 */
+	public void ping() {
+	}
+
+	public synchronized boolean isShuttingDown() {
+		return shuttingDown;
+	}
+
+    /**
+	 * Return information about VM. totalMemory, freeMemory, threadCount
+	 */
+    public ProcessStatistics getVMStatistics() {
+        ProcessStatistics vmStats = new ProcessStatistics();
+        Runtime rt = Runtime.getRuntime();
+        vmStats.freeMemory = rt.freeMemory();
+        vmStats.totalMemory = rt.totalMemory();
+
+        // get total thread count.
+        ThreadGroup root, tg;
+        root = Thread.currentThread().getThreadGroup();
+        while ((tg = root.getParent()) != null) {
+            root = tg;
+        }
+        vmStats.threadCount = root.activeCount();
+        vmStats.name = processName;
+        
+        
+        vmStats.processPoolStats = getProcessPoolStats(); 
+        vmStats.socketListenerStats = getSocketListenerStats();
+        
+        return vmStats;
+    }
+
+    /**
+     * Prints thread information to a log file.
+     * Does not include the stacktrace - that is not available in 1.4.
+     */
+    public void dumpThreads() {
+
+        ThreadGroup root, tg;
+        root = Thread.currentThread().getThreadGroup();
+        while ((tg = root.getParent()) != null) {
+            root = tg;
+        }
+        listThreads(root, 0);
+    }
+
+    /**
+     * Print information about the specified thread group.
+     */
+    private void listThreads(ThreadGroup tg, int indent) {
+
+        for (int i = 0; i < indent; i++) {
+            System.out.print("    "); //$NON-NLS-1$
+        }
+        System.out.println(tg);
+        indent++;
+
+        //Recursively print information threads in this group
+        int cnt = tg.activeCount();
+        Thread[] threads = new Thread[cnt];
+        tg.enumerate(threads, false);
+        for (int i = 0; i < cnt; i++) {
+            if (threads[i] != null) {
+                for (int j = 0; j < indent; j++) {
+                    System.out.print("    "); //$NON-NLS-1$
+                }
+                System.out.println(threads[i]);
+            }
+        }
+
+        //Recursively print information about child thread groups
+        cnt = tg.activeGroupCount();
+        ThreadGroup[] groups = new ThreadGroup[cnt];
+        tg.enumerate(groups);
+        for (int i = 0; i < cnt; i++) {
+            listThreads(groups[i], indent);
+        }
+    }
+
+    /**
+     * Private helper method that verifies service belongs to this vm
+     */
+    private void validateServiceID(ServiceID serviceID) {
+        if (!(serviceID.getHostName().equalsIgnoreCase(this.host.getFullName()) && serviceID.getProcessName().equalsIgnoreCase(this.processName))) {
+            throw new ServiceException(PlatformPlugin.Util.getString(LogMessageKeys.VM_0047, serviceID, this.host.getFullName(), this.processName));
+        }
+    }
+        
+    /** 
+     * @see com.metamatrix.platform.vm.api.controller.ProcessManagement#exportLogs()
+     * @since 4.3
+     */
+    public byte[] exportLogs() {
+        File tmpFile = null;
+        try {
+            tmpFile = File.createTempFile("logs", ".zip");  //$NON-NLS-1$ //$NON-NLS-2$
+            tmpFile.deleteOnExit();
+            
+            String mainLogDirectory = host.getLogDirectory();
+            ZipFileUtil.addAll(tmpFile, mainLogDirectory, "log"); //$NON-NLS-1$ 
+            
+            String hostLogDirectory = host.getProperty(HostType.HOST_DIRECTORY) + File.separator + "log"; //$NON-NLS-1$ 
+            ZipFileUtil.addAll(tmpFile, hostLogDirectory, "hosts_"+host.getName()+"_log"); //$NON-NLS-1$//$NON-NLS-2$
+            
+            String servletLogDirectory = host.getProperty(HostType.HOST_DIRECTORY) + File.separator + "servletengine" + File.separator + "logs"; //$NON-NLS-1$ //$NON-NLS-2$
+            ZipFileUtil.addAll(tmpFile, servletLogDirectory, "hosts_"+host.getName()+"_servletengine_log"); //$NON-NLS-1$//$NON-NLS-2$
+            
+            return new FileUtil(tmpFile.getAbsolutePath()).readBytes();
+            
+        } catch (Exception e) {
+            throw new ServiceException(e);
+        } finally {
+            try {
+                tmpFile.delete();
+            } catch (Exception e) {
+            }
+        }
+    }
+    
+    protected abstract SocketListenerStats getSocketListenerStats();
+    protected abstract WorkerPoolStats getProcessPoolStats();
+
+    
+    /**
+     * Start a service in this VM. If synch flag is true then what for the service to start
+     * before returning. Starting a service in this manner is typically done from the console so
+     * any errors can be reported. Starting a service asynchronously (synch == false) is intended for
+     * starting up the server. This prevents any race conditions due to service dependencies.
+     *
+     * @param ClientServiceRegistry Class to registry ServerListener
+     * @param serviceClassName Class to instantiate as a service.
+     * @param serviceID - null if a new service, if non-null then we are re-starting a service.
+     * @param serviceProps Properties required to start service.
+     * @param synch Flag to indicate if service should be started synchronously are asynchronously.
+     */
+    private void startService(final ClientServiceRegistry clientServiceRegistry, final String serviceClassName, final ServiceID serviceID, final DeployedComponent deployedComponent, final ProductServiceConfigID pscID, final Properties serviceProps, boolean synch) {
+
+        if (!synch) {
+            //add work to the pool
+            startServicePool.execute( new Runnable() {
+				public void run() {
+					startService(clientServiceRegistry, serviceID, deployedComponent,serviceClassName, pscID, serviceProps);					
+				}
+            });
+        } else {
+            //start synchronously
+            try {
+            	startService(clientServiceRegistry, serviceID, deployedComponent,serviceClassName, pscID, serviceProps);
+			} catch (Exception e) {
+				throw new ServiceException(e);
+			}  
+        }
+    }
+    
+    private void startService(ClientServiceRegistry serverListenerRegistry, ServiceID serviceID, DeployedComponent deployedComponent,final String serviceClass,ProductServiceConfigID pscID,Properties serviceProps) {
+        String serviceInstanceName = null;
+
+        try {
+        	if (serviceID == null) {
+        		serviceID = this.createServiceID();        		
+        	}
+        	
+            serviceInstanceName = serviceProps.getProperty(ServicePropertyNames.INSTANCE_NAME);
+            String componentType = serviceProps.getProperty(ServicePropertyNames.COMPONENT_TYPE_NAME);
+            String serviceType = serviceProps.getProperty(ServicePropertyNames.SERVICE_NAME);
+            String routingID = serviceProps.getProperty(ServicePropertyNames.SERVICE_ROUTING_ID);
+            String essentialStr = serviceProps.getProperty(ServicePropertyNames.SERVICE_ESSENTIAL);
+
+
+            boolean essential = false;
+            if (essentialStr != null && essentialStr.trim().length() != 0) {
+                essential = Boolean.valueOf(essentialStr).booleanValue();
+            }
+
+            // Create an instance of serviceClass
+            final ServiceInterface service  = (ServiceInterface) Class.forName(serviceClass).newInstance();
+
+            // Create ServiceRegistryBinding and register
+            final ServiceRegistryBinding binding = new ServiceRegistryBinding(serviceID, service, routingID,serviceInstanceName, componentType, serviceInstanceName,host.getFullName(), deployedComponent, pscID, service.getCurrentState(), service.getStateChangeTime(),essential, this.messageBus);
+            
+            logMessage(PlatformPlugin.Util.getString("ServiceController.0",serviceInstanceName)); //$NON-NLS-1$
+            
+            events.serviceAdded(binding);
+
+            // Initialize service
+            final Object[] param1 = new Object[] { serviceID };
+            DeployedComponentID deployedComponentID = (DeployedComponentID) deployedComponent.getID();
+            logMessage(PlatformPlugin.Util.getString("ServiceController.1",param1)); //$NON-NLS-1$
+            binding.getService().init(serviceID, deployedComponentID, serviceProps, serverListenerRegistry); 
+            logMessage(PlatformPlugin.Util.getString("ServiceController.2",param1)); //$NON-NLS-1$
+            logMessage(PlatformPlugin.Util.getString("ServiceController.3",param1)); //$NON-NLS-1$                
+                               
+            logMessage(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0009, serviceType, serviceInstanceName));
+
+        } catch (Exception e) {
+            throw new ServiceException(e, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0028, serviceInstanceName));
+        }
+    }    
+    
+
+    /**
+     * Stop all the services in this vm.
+     *
+     * @param now If true do not wait for work to complete in services.
+     * @throws ServiceException if an error occurs stopping 1 or more services.
+     */
+    private void stopServices(boolean now, boolean shutdown) throws MultipleException {
+
+        MultipleException multipleException = new MultipleException();
+
+        List<ServiceRegistryBinding> bindings = this.registry.getServiceBindings(host.getFullName(), this.processName);
+        
+        for (ServiceRegistryBinding binding:bindings) {
+            try {
+                stopService(binding, now, shutdown);
+            } catch (ServiceException se) {
+                multipleException.getExceptions().add(se);
+            }
+        }
+
+        int numExceptions = multipleException.getExceptions().size();
+        if (numExceptions == 1) {
+            //if there is one ServiceException, throw it
+            throw (ServiceException) multipleException.getExceptions().get(0);
+        } else if (numExceptions > 1) {
+            //if there are many, throw the MultipleException containing all of them
+            throw multipleException;
+        }
+    }
+
+    /**
+     * Stop service, if now flag is true then stop service immediately, do not wait for work to complete.
+     *
+     * @param serviceID Identifies service to be stopped
+     * @param now If true, stop service without waiting for work to complete
+     * @throws ServiceException if an error occurs while stopping service or if attempting shutdown the last essential service.
+     */
+    private synchronized void stopService(ServiceRegistryBinding binding, boolean now, boolean shutdown) {
+        ServiceInterface service = null;
+        int currentState;
+
+        if (!shutdown && !canServiceBeShutdown(binding)) {
+            throw new ServiceException(ErrorMessageKeys.SERVICE_0017, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0017, binding.getServiceID()));
+        }
+
+        try {
+            service = binding.getService();
+            // check for null service in case the service was stopped.  When servcie is stopped,
+            // the binding service reference is nulled out.
+            if (service == null) {
+                return;
+            }
+            currentState = binding.getCurrentState();
+        } catch (Exception e) {
+            throw new ServiceException(e, ErrorMessageKeys.SERVICE_0018, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0018, binding.getServiceID()));
+        }
+
+        // Do not kill a service that was not intialized. May throw meaningless exception
+        if (currentState != ServiceState.STATE_INIT_FAILED &&
+            currentState != ServiceState.STATE_CLOSED) {
+            if (!now) {
+                service.die(); // throws ServiceException
+            } else {
+                service.dieNow(); // do not wait for work to complete.
+            }
+        }
+        
+        // Leave binding in registry but remove service instance.
+        if (shutdown) {
+        	events.serviceRemoved(binding.getServiceID());
+        }
+        else {
+        	events.serviceUpdated(binding);
+        }
+    }
+    
+    
+    /**
+     * Check a service, and updates the state in some cases.  
+     * Catches any ServiceExceptions, so that the caller doesn't have to deal with them.
+     * @param serviceID Identifies service to be stopped
+     */
+    public void checkService(ServiceID serviceID) {
+        logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0054, serviceID));
+        validateServiceID(serviceID);
+    	
+        ServiceInterface service = null;
+        int currentState = 0;
+
+        try {
+            ServiceRegistryBinding binding = this.registry.getServiceBinding(serviceID.getHostName(), serviceID.getProcessName(), serviceID);
+            service = binding.getService();
+            // check for null service in case the service was stopped.  When service is stopped,
+            // the binding service reference is nulled out.
+            
+            if (service != null) {
+                currentState = binding.getCurrentState();
+            } else {
+                return;
+            }
+        } catch (Exception e) {
+            logException(e, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0068, serviceID));
+            return;
+        }
+
+        try {
+            //Only check state of OPEN and DATA_SOURCE_UNAVAILABLE services
+            if (currentState == ServiceState.STATE_OPEN ||
+                currentState == ServiceState.STATE_DATA_SOURCE_UNAVAILABLE) {
+                service.checkState(); // throws ServiceException
+            }
+        } catch (ServiceException e) {
+            logException(e, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0068, serviceID)); 
+        } 
+    }
+
+    protected Properties getProperties() {
+    	return this.vmProps;
+    }
+   
+    /**
+     * Return TRUE if the system's services are started; i.e. at least one of every essential services
+     * in a product is running. Authorization, Configuration, Membership and Session
+     * services are considered to be essential.
+     *
+     * @param callerSessionID ID of the caller's current session.
+     * @return Boolean - TRUE if system is started, FALSE if not.
+     * @throws MetaMatrixComponentException if an error occurred in communicating with a component.
+     */
+    protected boolean isStarted() {
+
+        boolean servicesStarted = false;
+        List authServices = this.registry.getActiveServiceBindings(null, null, AuthorizationServiceInterface.NAME);
+        List sessionServices = this.registry.getActiveServiceBindings(null, null,SessionServiceInterface.NAME);
+        List membershipServices = this.registry.getActiveServiceBindings(null, null,MembershipServiceInterface.NAME);
+        List configurationServices = this.registry.getActiveServiceBindings(null, null,ConfigurationServiceInterface.NAME);
+        
+        if ( (authServices.size() > 0) &&
+             (sessionServices.size()) > 0 &&
+             (membershipServices.size() > 0) &&
+             (configurationServices.size() > 0)
+             ) {
+
+            servicesStarted = true;
+        }
+        return servicesStarted;
+    }    
+    
+    /**
+     * Create a globally unique ServiceID
+     *
+     * @return ServiceID
+     */
+    private ServiceID createServiceID() {
+        try {
+            return new ServiceID(DBIDGenerator.getInstance().getID(DBIDGenerator.SERVICE_ID), host.getFullName(), this.processName);
+        } catch (DBIDGeneratorException e) {
+            throw new ServiceException(e, ErrorMessageKeys.SERVICE_0025, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0025));
+        }
+    }
+
+    /**
+     * True indicates service can be
+     */
+    private boolean canServiceBeShutdown(ServiceRegistryBinding binding) {
+
+        boolean shutdown = true;
+        try {
+            if (binding.isEssential()) {
+                List services = this.registry.getActiveServiceBindings(null, null, binding.getServiceType());
+                if (services.size() < 2) {
+                    shutdown = false;
+                }
+            }
+        } catch (Exception e) {
+            logException(e, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0026, binding.getServiceID()));
+        }
+        return shutdown;
+    }
+
+    // ---------------------------------------------------------------------
+    // Logging helpers
+    // ---------------------------------------------------------------------
+
+    private void logException(Throwable e, String msg) {
+        LogManager.logError(LogPlatformConstants.CTX_SERVICE_CONTROLLER, e, msg);
+    }
+
+
+	public InetAddress getAddress() {
+		return VMNaming.getHostAddress();
+	}
+
+
+	public String getName() {
+		return processName;
+	}
+	
+}

Modified: trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ServerEvents.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ServerEvents.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ServerEvents.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -23,16 +23,16 @@
 package com.metamatrix.platform.vm.controller;
 
 import com.metamatrix.platform.registry.ServiceRegistryBinding;
-import com.metamatrix.platform.registry.VMRegistryBinding;
+import com.metamatrix.platform.registry.ProcessRegistryBinding;
 import com.metamatrix.platform.service.api.ServiceID;
 
 public interface ServerEvents {
 
-	void vmAdded(VMRegistryBinding binding);
+	void processAdded(ProcessRegistryBinding binding);
 	
-	void vmRemoved(VMControllerID id);
+	void processRemoved(String hostName, String processName);
 	
-	void vmUpdated(VMRegistryBinding binding);
+	void processUpdated(ProcessRegistryBinding binding);
 	
 	void serviceAdded(ServiceRegistryBinding binding);
 	

Deleted: trunk/server/src/main/java/com/metamatrix/platform/vm/controller/VMController.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/vm/controller/VMController.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/platform/vm/controller/VMController.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -1,973 +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.platform.vm.controller;
-
-import java.io.File;
-import java.lang.reflect.Proxy;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import com.metamatrix.admin.api.exception.AdminException;
-import com.metamatrix.admin.api.server.ServerAdmin;
-import com.metamatrix.admin.server.ServerAdminImpl;
-import com.metamatrix.admin.util.AdminMethodRoleResolver;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.MultipleException;
-import com.metamatrix.common.comm.ClientServiceRegistry;
-import com.metamatrix.common.comm.platform.socket.server.AdminAuthorizationInterceptor;
-import com.metamatrix.common.comm.platform.socket.server.LogonImpl;
-import com.metamatrix.common.config.CurrentConfiguration;
-import com.metamatrix.common.config.JDBCConnectionPoolHelper;
-import com.metamatrix.common.config.api.ComponentTypeID;
-import com.metamatrix.common.config.api.ConfigurationModelContainer;
-import com.metamatrix.common.config.api.DeployedComponent;
-import com.metamatrix.common.config.api.DeployedComponentID;
-import com.metamatrix.common.config.api.Host;
-import com.metamatrix.common.config.api.HostID;
-import com.metamatrix.common.config.api.HostType;
-import com.metamatrix.common.config.api.ProductServiceConfigID;
-import com.metamatrix.common.config.api.ServiceComponentDefn;
-import com.metamatrix.common.config.api.ServiceComponentDefnID;
-import com.metamatrix.common.config.api.VMComponentDefn;
-import com.metamatrix.common.config.api.VMComponentDefnID;
-import com.metamatrix.common.config.api.VMComponentDefnType;
-import com.metamatrix.common.config.api.exceptions.ConfigurationException;
-import com.metamatrix.common.id.dbid.DBIDGenerator;
-import com.metamatrix.common.id.dbid.DBIDGeneratorException;
-import com.metamatrix.common.log.LogConfiguration;
-import com.metamatrix.common.log.LogManager;
-import com.metamatrix.common.messaging.MessageBus;
-import com.metamatrix.common.queue.WorkerPool;
-import com.metamatrix.common.queue.WorkerPoolFactory;
-import com.metamatrix.common.queue.WorkerPoolStats;
-import com.metamatrix.common.util.CommonPropertyNames;
-import com.metamatrix.common.util.LogCommonConstants;
-import com.metamatrix.common.util.PropertiesUtils;
-import com.metamatrix.common.util.VMNaming;
-import com.metamatrix.common.util.LogContextsUtil.PlatformAdminConstants;
-import com.metamatrix.core.util.FileUtil;
-import com.metamatrix.core.util.ZipFileUtil;
-import com.metamatrix.metadata.runtime.RuntimeMetadataCatalog;
-import com.metamatrix.platform.PlatformPlugin;
-import com.metamatrix.platform.admin.api.AuthorizationAdminAPI;
-import com.metamatrix.platform.admin.api.ConfigurationAdminAPI;
-import com.metamatrix.platform.admin.api.ExtensionSourceAdminAPI;
-import com.metamatrix.platform.admin.api.MembershipAdminAPI;
-import com.metamatrix.platform.admin.api.RuntimeStateAdminAPI;
-import com.metamatrix.platform.admin.api.SessionAdminAPI;
-import com.metamatrix.platform.admin.apiimpl.AdminHelper;
-import com.metamatrix.platform.admin.apiimpl.AuthorizationAdminAPIImpl;
-import com.metamatrix.platform.admin.apiimpl.ConfigurationAdminAPIImpl;
-import com.metamatrix.platform.admin.apiimpl.ExtensionSourceAdminAPIImpl;
-import com.metamatrix.platform.admin.apiimpl.MembershipAdminAPIImpl;
-import com.metamatrix.platform.admin.apiimpl.RuntimeStateAdminAPIImpl;
-import com.metamatrix.platform.admin.apiimpl.SessionAdminAPIImpl;
-import com.metamatrix.platform.config.api.service.ConfigurationServiceInterface;
-import com.metamatrix.platform.registry.ClusteredRegistryState;
-import com.metamatrix.platform.registry.ResourceNotBoundException;
-import com.metamatrix.platform.registry.ServiceRegistryBinding;
-import com.metamatrix.platform.registry.VMRegistryBinding;
-import com.metamatrix.platform.security.api.ILogon;
-import com.metamatrix.platform.security.api.service.AuthorizationServiceInterface;
-import com.metamatrix.platform.security.api.service.MembershipServiceInterface;
-import com.metamatrix.platform.security.api.service.SessionServiceInterface;
-import com.metamatrix.platform.service.api.ServiceID;
-import com.metamatrix.platform.service.api.ServiceInterface;
-import com.metamatrix.platform.service.api.ServiceState;
-import com.metamatrix.platform.service.api.exception.ServiceException;
-import com.metamatrix.platform.service.controller.ServicePropertyNames;
-import com.metamatrix.platform.util.ErrorMessageKeys;
-import com.metamatrix.platform.util.LogMessageKeys;
-import com.metamatrix.platform.util.LogPlatformConstants;
-import com.metamatrix.platform.util.PlatformProxyHelper;
-import com.metamatrix.platform.vm.api.controller.VMControllerInterface;
-import com.metamatrix.server.HostManagement;
-import com.metamatrix.server.ResourceFinder;
-import com.metamatrix.server.admin.api.QueryAdminAPI;
-import com.metamatrix.server.admin.api.RuntimeMetadataAdminAPI;
-import com.metamatrix.server.admin.api.TransactionAdminAPI;
-import com.metamatrix.server.admin.apiimpl.QueryAdminAPIImpl;
-import com.metamatrix.server.admin.apiimpl.RuntimeMetadataAdminAPIImpl;
-import com.metamatrix.server.admin.apiimpl.TransactionAdminAPIImpl;
-
-/**
- * This class is used to start up and bind VM's to the naming server.
- *
- * The following command will startup a standalone vm with no services.
- * <p><blockquote><pre>
- *   java com.metamatrix.framework.vm.controller.VMController <VM_Name> false log.txt
- * </pre></blockquote>
- *
- * The following command will startup a vm and start services as defined in the deployment model.
- * The vmName must exist in the property service.
- *
- * <p><blockquote><pre>
- *   java com.metamatrix.framework.vm.controller.VMController vmName true log.txt
- * </pre></blockquote>
- *
- *
- */
-public abstract class VMController implements VMControllerInterface {
-
-    public static final String STARTER_MAX_THREADS = "vm.starter.maxThreads"; //$NON-NLS-1$
-    /**Time-to-live for threads used to start services (ms)*/    
-    public static final String STARTER_TIMETOLIVE = "vm.starter.timetolive"; //$NON-NLS-1$
-    /**Interval to check the state of services (ms)*/    
-    public static final String SERVICE_MONITOR_INTERVAL = "metamatrix.server.serviceMonitorInterval"; //$NON-NLS-1$
-        
-    // this is a 4.2.2 property used for command line setting
-    private static final String STOP_DELAY_TIME = "metamatrix.vm.stop.delay.sec"; //$NON-NLS-1$
-    
-    private static final int DEFAULT_FORCE_SHUTDOWN_TIME = 30;
-    public static final int DEFAULT_STARTER_MAX_THREADS = 15; 
-    public static final int DEFAULT_STARTER_TIMETOLIVE = 15000;
-    
-    protected Host host;
-    protected String vmName;
-    protected VMControllerID id;
-    
-	private Date startTime;
-	private Properties vmProps;
-	VMComponentDefn vmComponentDefn;
-
-    private boolean shuttingDown = false;
-
-    //WorkerPool used for starting services asynchronously
-    private WorkerPool startServicePool;    
-    
-    protected ClusteredRegistryState registry;
-    
-    private MessageBus messageBus;
-    
-    // Server events that are being generated
-    ServerEvents events;
-    
-    protected ClientServiceRegistry clientServices;
-    private Map<ComponentTypeID, Properties> defaultPropertiesCache = new HashMap<ComponentTypeID, Properties>();
-    private Properties hostProperties;
-
-    private int force_shutdown_time = DEFAULT_FORCE_SHUTDOWN_TIME;
-
-    /**
-     * Create a new instance of VMController.
-     *
-     * @param vmName Name of VM
-     * @param startDeployedServices If true all services that are deployed to this vm are started.
-     * @param standalone If true indicates that VMController is running in its own vm.
-     * @throws Exception if an error occurs initializing vmController
-     */
-    public VMController(Host host, String vmName, VMControllerID vmId, ClusteredRegistryState registry, ServerEvents serverEvents, MessageBus bus, HostManagement hostManagement) throws Exception {
-    	this.host = host;
-    	this.vmName = vmName;
-    	
-    	this.registry = registry;
-    	this.events = serverEvents;
-    	this.messageBus = bus;
-    	    	
-        Properties configProps = CurrentConfiguration.getInstance().getProperties(); 
-        int maxThreads = PropertiesUtils.getIntProperty(configProps, STARTER_MAX_THREADS, DEFAULT_STARTER_MAX_THREADS);
-        int timeToLive = PropertiesUtils.getIntProperty(configProps, STARTER_TIMETOLIVE, DEFAULT_STARTER_TIMETOLIVE);
-    	
-        this.startServicePool = WorkerPoolFactory.newWorkerPool("StartServiceQueue", maxThreads, timeToLive); //$NON-NLS-1$
-        
-        this.id = vmId;
-		
-		initVMProperties(host.getFullName(), vmName);
-		
-        this.startTime = new Date();
-
-        //Register with registry
-        logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0006, id));
-
-        this.clientServices = new ClientServiceRegistry();
-
-        RuntimeMetadataCatalog.getInstance().init(CurrentConfiguration.getInstance().getProperties(), ResourceFinder.getMessageBus(), ResourceFinder.getCacheFactory());
-        
-        this.registerILogonAPI();
-        this.registerAdmin(hostManagement);
-        
-        this.registerSubSystemAdminAPIs(hostManagement);
-        
-        addShutdownHook();        
-    }
-
-	
-    /**
-     * Register the ServiceInterceptors for the SubSystemAdminAPIs 
-     * @throws MetaMatrixComponentException
-     */
-    private void registerSubSystemAdminAPIs(HostManagement hostManagement) throws MetaMatrixComponentException {
-        this.clientServices.registerClientService(ConfigurationAdminAPI.class, ConfigurationAdminAPIImpl.getInstance(this.registry), PlatformAdminConstants.CTX_CONFIGURATION_ADMIN_API);
-        this.clientServices.registerClientService(RuntimeStateAdminAPI.class, RuntimeStateAdminAPIImpl.getInstance(this.registry, hostManagement), PlatformAdminConstants.CTX_RUNTIME_STATE_ADMIN_API);
-        this.clientServices.registerClientService(MembershipAdminAPI.class, MembershipAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
-        this.clientServices.registerClientService(SessionAdminAPI.class, SessionAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
-        this.clientServices.registerClientService(AuthorizationAdminAPI.class, AuthorizationAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_AUTHORIZATION_ADMIN_API);
-        this.clientServices.registerClientService(ExtensionSourceAdminAPI.class, ExtensionSourceAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
-        this.clientServices.registerClientService(QueryAdminAPI.class, QueryAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
-        this.clientServices.registerClientService(RuntimeMetadataAdminAPI.class, RuntimeMetadataAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_RUNTIME_METADATA_ADMIN_API);
-        this.clientServices.registerClientService(TransactionAdminAPI.class, TransactionAdminAPIImpl.getInstance(), PlatformAdminConstants.CTX_ADMIN_API);
-    }	
-    
-    
-    /**
-     * Register a ServiceInterceptor for the new Admin API, so that the client can access it via messaging.
-     * @throws AdminException 
-     * 
-     * @throws MetaMatrixComponentException
-     */
-    private void registerAdmin(HostManagement hostManagement) throws AdminException {
-    	ServerAdminImpl serverAdminImpl = new ServerAdminImpl(this.registry, hostManagement);
-    	AdminMethodRoleResolver adminMethodRoleResolver = new AdminMethodRoleResolver();
-    	adminMethodRoleResolver.init();
-    	ServerAdmin roleCheckedServerAdmin = (ServerAdmin)Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class[] {ServerAdmin.class}, new AdminAuthorizationInterceptor(new AdminHelper(), adminMethodRoleResolver, serverAdminImpl));
-    	this.clientServices.registerClientService(ServerAdmin.class, roleCheckedServerAdmin, PlatformAdminConstants.CTX_ADMIN);
-    }
-    
-    /** 
-     * Register ILogonAPI's ServiceInterceptor
-     * @throws ServiceException 
-     * @throws ConfigurationException 
-     */
-    private void registerILogonAPI() throws ConfigurationException, ServiceException {
-    	this.clientServices.registerClientService(ILogon.class, new LogonImpl(PlatformProxyHelper.getSessionServiceProxy(PlatformProxyHelper.ROUND_ROBIN_LOCAL), CurrentConfiguration.getInstance().getClusterName()), LogCommonConstants.CTX_LOGON);
-    }    
-
-	private void addShutdownHook() {
-        Runtime.getRuntime().addShutdownHook(new Thread() {
-            public void run() {
-            	try {
-					shutdown(false);
-				} catch (Exception e) {
-					// ignore
-				}
-            }            	
-        });
-	}
-    
-    /**
-     * Lazily get Current Configuration
-     */
-    ConfigurationModelContainer getConfigurationModel() throws ConfigurationException {
-        return CurrentConfiguration.getInstance().getConfigurationModel();
-    }    
-
-    /**
-     * Initialize vm properties.
-     * This method initializes the following global attributes.
-     *
-     *  - hostID
-     *  - vmComponentDefnID
-     *  - vmProps
-     */
-	private void initVMProperties(String hostname, String vmName) throws Exception {
-        ConfigurationModelContainer config = getConfigurationModel();
-        
-        VMComponentDefn deployedVM = config.getConfiguration().getVMForHost(hostname, vmName);
-
-        if (deployedVM != null) {
-        	this.vmComponentDefn = deployedVM;
-        	            
-           vmProps = config.getDefaultPropertyValues(deployedVM.getComponentTypeID());
-           Properties props = config.getConfiguration().getAllPropertiesForComponent(deployedVM.getID());
-           vmProps.putAll(props);
-           
-           // this system property setting will override the setting in the VM
-           // this is done because the command line argument
-           force_shutdown_time = PropertiesUtils.getIntProperty(System.getProperties(), STOP_DELAY_TIME, DEFAULT_FORCE_SHUTDOWN_TIME);
-           if (DEFAULT_FORCE_SHUTDOWN_TIME == force_shutdown_time) {
-               force_shutdown_time = PropertiesUtils.getIntProperty(vmProps, VMComponentDefnType.FORCED_SHUTDOWN_TIME, DEFAULT_FORCE_SHUTDOWN_TIME);
-           }
-           
-           Properties allProps = new Properties();
-           allProps.putAll(System.getProperties());
-           allProps.putAll(config.getConfiguration().getProperties());
-           allProps.putAll(host.getProperties());
-           allProps.putAll(props);
-           System.setProperties(allProps);
-           
-           logMessage(PlatformPlugin.Util.getString("VMController.VM_Force_Shutdown_Time", force_shutdown_time)); //$NON-NLS-1$
-           
-           // add the vm to registry
-           VMRegistryBinding binding = new VMRegistryBinding(host.getFullName(), id, deployedVM, this, this.messageBus);        
-           this.events.vmAdded(binding);
-        }
-	}
-
-    protected void logMessage(String s) {
-        LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, s);
-    }
-
-    protected static void doUsage() {
-        System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.VM_0010));
-        System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.VM_0011));
-    }
-
-    public VMControllerID getID() {
-        return id;
-    }
-
-	public void start() {
-    			
-        logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0013));
-        VMComponentDefnID vmComponentDefnID = (VMComponentDefnID)this.vmComponentDefn.getID();
-
-        try {
-            ConfigurationModelContainer configuration = getConfigurationModel();
-
-            Collection deployedServices = configuration.getConfiguration().getDeployedServicesForVM(this.vmComponentDefn);
-            
-            logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0014, new Integer(deployedServices.size()), vmComponentDefnID.getName()));
-
-            ArrayList essentialServices = new ArrayList();
-            ArrayList otherServices = new ArrayList();
-            
-            // create a list of platform services and other services
-            Iterator servicesIterator = deployedServices.iterator();
-            while (servicesIterator.hasNext()) {
-                DeployedComponent depComp = (DeployedComponent) servicesIterator.next();
-
-                ServiceComponentDefn scd = (ServiceComponentDefn) depComp.getDeployedComponentDefn(configuration.getConfiguration());
-
-                if (scd.isEssential()) {
-                    essentialServices.add(depComp);
-                } else {
-                    otherServices.add(depComp);
-                }
-            }
-
-            // start platform services first (synchronously) 
-            boolean errored = false;
-            servicesIterator = essentialServices.iterator();
-            while (servicesIterator.hasNext()) {
-                DeployedComponent depComp = (DeployedComponent) servicesIterator.next();
-                try {
-                    startDeployedService(depComp, null, configuration, true);
-                } catch (Exception e) {
-                    errored = true;
-                    // error already logged from startDeployedService method.
-                    // continue starting services.
-                }
-            }
-            
-            if (errored) return;
-            
-
-            // now start the rest of the services asynchronously
-            servicesIterator = otherServices.iterator();
-            while (servicesIterator.hasNext()) {
-                DeployedComponent depComp = (DeployedComponent) servicesIterator.next();
-                try {
-                    startDeployedService(depComp, null, configuration, false);
-                } catch (Exception e) {
-                    // error already logged from startDeployedService method.
-                    // continue starting services.
-                }
-            }
-            logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0016, new Integer(deployedServices.size()),  vmComponentDefnID.getName()));
-
-        } catch (ConfigurationException e) {
-            logException(e, PlatformPlugin.Util.getString(LogMessageKeys.VM_0017, vmComponentDefnID.getName(), host.getID().getName()));
-        }
-    }
-
-
-    public void startService(ServiceID serviceID) {
-        logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0018, serviceID));
-
-        ServiceRegistryBinding binding = null;
-
-        try {
-            binding = this.registry.getServiceBinding(serviceID.getHostName(), serviceID.getVMControllerID().toString(), serviceID);
-        } catch (ResourceNotBoundException e) {
-            String msg = PlatformPlugin.Util.getString(LogMessageKeys.VM_0019, serviceID);
-            throw new ServiceException(e, msg);
-        } catch (Exception e) {
-            String msg = PlatformPlugin.Util.getString(LogMessageKeys.VM_0020, serviceID);
-            throw new ServiceException(e, msg);
-        }
-
-        if (!binding.isServiceBad()) {
-            throw new ServiceException(PlatformPlugin.Util.getString(LogMessageKeys.VM_0021, serviceID));
-        }
-
-        try {
-            ConfigurationModelContainer configuration = getConfigurationModel();
-            startDeployedService(binding.getDeployedComponent(), serviceID, configuration, true);
-
-        } catch (Exception e) {
-            throw new ServiceException(e, PlatformPlugin.Util.getString(LogMessageKeys.VM_0022, serviceID));
-        }
-    }
-
-    public void startDeployedService(ServiceComponentDefnID id) {
-        logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0023, id));
-        startDeployedService(id, null);
-    }
-
-	private void startDeployedService(ServiceComponentDefnID defnID, ServiceID serviceID) {
-        try {
-            ConfigurationModelContainer configuration = getConfigurationModel();
-            VMComponentDefnID vmComponentDefnID = (VMComponentDefnID)this.vmComponentDefn.getID();
-            DeployedComponent deployedService = configuration.getConfiguration().getDeployedServiceForVM(defnID, vmComponentDefnID, (HostID) getConfigHost().getID());
-            startDeployedService(deployedService, serviceID, configuration, true);
-        } catch (Exception e) {
-            String msg = PlatformPlugin.Util.getString(LogMessageKeys.VM_0024, defnID);
-            throw new ServiceException(e, msg);
-        }
-    }
-
-	/**
-	 *  Start the service identified by the DeployedComponentID
-	 *  If synch is true then wait for service to start before returning.
-	 *  Any exceptions will then be thrown to the caller.
-	 *  If synch is false then start service asynchronously.
-	 * @throws ConfigurationException 
-	 */
-	private void startDeployedService(DeployedComponent deployedService, ServiceID serviceID, ConfigurationModelContainer configModel, boolean synch) throws ConfigurationException {
-        Properties defaultProps = null;
-        synchronized (this) {
-            defaultProps = defaultPropertiesCache.get(deployedService.getComponentTypeID());
-            
-            if (defaultProps == null) {
-                if (hostProperties == null) {
-                    hostProperties = CurrentConfiguration.getInstance().getSystemBootStrapProperties();
-                    hostProperties = new Properties(hostProperties);
-                    PropertiesUtils.putAll(hostProperties, host.getProperties());
-                }
-                defaultProps = new Properties(hostProperties);
-                defaultProps.putAll(configModel.getDefaultPropertyValues(deployedService.getComponentTypeID()));
-                defaultPropertiesCache.put(deployedService.getComponentTypeID(), defaultProps);
-            }
-        }
-        Properties serviceProps = new Properties(defaultProps);
-        Properties props = configModel.getConfiguration().getAllPropertiesForComponent(deployedService.getID());
-        serviceProps.putAll(props);
-        PropertiesUtils.setOverrideProperies(serviceProps, hostProperties);
-        
-        ProductServiceConfigID pscID = deployedService.getProductServiceConfigID();
-        String serviceClassName = serviceProps.getProperty( ServicePropertyNames.SERVICE_CLASS_NAME );
-
-        if (serviceClassName != null && serviceClassName.length() > 0) {
-            logMessage( PlatformPlugin.Util.getString(LogMessageKeys.VM_0025, deployedService.getServiceComponentDefnID().getName(), vmName, host.getID().getName()));
-
-            serviceProps.put(ServicePropertyNames.INSTANCE_NAME, deployedService.getName());
-            serviceProps.put(ServicePropertyNames.SERVICE_NAME, deployedService.getServiceComponentDefnID().getName());
-            serviceProps.put(ServicePropertyNames.COMPONENT_TYPE_NAME, deployedService.getComponentTypeID().getFullName());
-
-            // get routing id.
-            if (!deployedService.isDeployedConnector()) {
-                serviceProps.put(ServicePropertyNames.SERVICE_ROUTING_ID, deployedService.getComponentTypeID().getFullName());
-            } else {
-                ServiceComponentDefn scd = (ServiceComponentDefn) deployedService.getDeployedComponentDefn(configModel.getConfiguration());
-                String routingID = scd.getRoutingUUID();
-                serviceProps.put(ServicePropertyNames.SERVICE_ROUTING_ID, routingID);
-            }
-            startService(this.clientServices, serviceClassName, serviceID, deployedService, pscID, serviceProps, synch );
-
-        } else {
-            String msg = PlatformPlugin.Util.getString(LogMessageKeys.VM_0026, new Object[] {ServicePropertyNames.SERVICE_CLASS_NAME, deployedService.getServiceComponentDefnID().getName(), vmName, host.getID().getName()});
-            throw new ServiceException(msg);
-        }
-
-    }
-	
-    /**
-     * Shut down all services waiting for work to complete.
-     * Essential services will also be shutdown.
-     */
-	public synchronized void shutdown(boolean now) {
-		logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0041));
-		
-		try {
-            stopServices(now, true);
-        } catch (MultipleException e) {
-        	logException(e, e.getMessage());
-        } catch (ServiceException e) {
-            logException(e, e.getMessage());
-        } 
-
-		JDBCConnectionPoolHelper.getInstance().shutDown();
-
-        // unregister VMController
-        events.vmRemoved(id);
-        
-        this.shuttingDown = true;
-
-        notifyAll();        
-        
-		this.startServicePool.execute(new Runnable() {
-            public void run() {
-                // Wait before killing the VM.
-                try {
-                    Thread.sleep(force_shutdown_time * 1000);
-                } catch (Exception e) {}
-                // And exit.
-                System.exit(1);
-            }
-        });
-    }
-
-
-	/**
-	 * Kill service once work is complete
-	 */
-	public void stopService(ServiceID id, boolean now, boolean shutdown) {
-        try {
-			logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0035, id));
-			validateServiceID(id);
-			ServiceRegistryBinding binding = this.registry.getServiceBinding(id.getHostName(), id.getVMControllerID().toString(), id);
-			stopService(binding, now, shutdown);
-		} catch (ResourceNotBoundException e) {
-			throw new ServiceException(e);
-		}
-    }
-
-    /**
-     * Set the current log configuration for this vm.
-     */
-    public void setCurrentLogConfiguration(LogConfiguration logConfiguration) {
-        logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0046, logConfiguration));
-        LogManager.setLogConfiguration(logConfiguration);
-    }
-
-	/**
-	 * Get the time the VM was initialized.
-	 */
-    public Date getStartTime() {
-        return this.startTime;
-    }
-
-    
-    public Host getConfigHost() {
-        return this.host;
-    }
-       
-    /**
-	 * Method called from registries to determine if VMController is alive.
-	 */
-	public void ping() {
-	}
-
-	public synchronized boolean isShuttingDown() {
-		return shuttingDown;
-	}
-
-    /**
-	 * Return information about VM. totalMemory, freeMemory, threadCount
-	 */
-    public VMStatistics getVMStatistics() {
-        VMStatistics vmStats = new VMStatistics();
-        Runtime rt = Runtime.getRuntime();
-        vmStats.freeMemory = rt.freeMemory();
-        vmStats.totalMemory = rt.totalMemory();
-
-        // get total thread count.
-        ThreadGroup root, tg;
-        root = Thread.currentThread().getThreadGroup();
-        while ((tg = root.getParent()) != null) {
-            root = tg;
-        }
-        vmStats.threadCount = root.activeCount();
-        vmStats.name = vmName;
-        
-        
-        vmStats.processPoolStats = getProcessPoolStats(); 
-        vmStats.socketListenerStats = getSocketListenerStats();
-        
-        return vmStats;
-    }
-
-    /**
-     * Prints thread information to a log file.
-     * Does not include the stacktrace - that is not available in 1.4.
-     */
-    public void dumpThreads() {
-
-        ThreadGroup root, tg;
-        root = Thread.currentThread().getThreadGroup();
-        while ((tg = root.getParent()) != null) {
-            root = tg;
-        }
-        listThreads(root, 0);
-    }
-
-    /**
-     * Print information about the specified thread group.
-     */
-    private void listThreads(ThreadGroup tg, int indent) {
-
-        for (int i = 0; i < indent; i++) {
-            System.out.print("    "); //$NON-NLS-1$
-        }
-        System.out.println(tg);
-        indent++;
-
-        //Recursively print information threads in this group
-        int cnt = tg.activeCount();
-        Thread[] threads = new Thread[cnt];
-        tg.enumerate(threads, false);
-        for (int i = 0; i < cnt; i++) {
-            if (threads[i] != null) {
-                for (int j = 0; j < indent; j++) {
-                    System.out.print("    "); //$NON-NLS-1$
-                }
-                System.out.println(threads[i]);
-            }
-        }
-
-        //Recursively print information about child thread groups
-        cnt = tg.activeGroupCount();
-        ThreadGroup[] groups = new ThreadGroup[cnt];
-        tg.enumerate(groups);
-        for (int i = 0; i < cnt; i++) {
-            listThreads(groups[i], indent);
-        }
-    }
-
-    /**
-     * Private helper method that verifies service belongs to this vm
-     */
-    private void validateServiceID(ServiceID serviceID) {
-        if (!serviceID.getVMControllerID().equals(getID())) {
-            throw new ServiceException(PlatformPlugin.Util.getString(LogMessageKeys.VM_0047, serviceID, this.id));
-        }
-    }
-        
-    /** 
-     * @see com.metamatrix.platform.vm.api.controller.VMControllerInterface#exportLogs()
-     * @since 4.3
-     */
-    public byte[] exportLogs() {
-        File tmpFile = null;
-        try {
-            tmpFile = File.createTempFile("logs", ".zip");  //$NON-NLS-1$ //$NON-NLS-2$
-            tmpFile.deleteOnExit();
-            
-            String mainLogDirectory = host.getLogDirectory();
-            ZipFileUtil.addAll(tmpFile, mainLogDirectory, "log"); //$NON-NLS-1$ 
-            
-            String hostLogDirectory = host.getProperty(HostType.HOST_DIRECTORY) + File.separator + "log"; //$NON-NLS-1$ 
-            ZipFileUtil.addAll(tmpFile, hostLogDirectory, "hosts_"+host.getName()+"_log"); //$NON-NLS-1$//$NON-NLS-2$
-            
-            String servletLogDirectory = host.getProperty(HostType.HOST_DIRECTORY) + File.separator + "servletengine" + File.separator + "logs"; //$NON-NLS-1$ //$NON-NLS-2$
-            ZipFileUtil.addAll(tmpFile, servletLogDirectory, "hosts_"+host.getName()+"_servletengine_log"); //$NON-NLS-1$//$NON-NLS-2$
-            
-            return new FileUtil(tmpFile.getAbsolutePath()).readBytes();
-            
-        } catch (Exception e) {
-            throw new ServiceException(e);
-        } finally {
-            try {
-                tmpFile.delete();
-            } catch (Exception e) {
-            }
-        }
-    }
-    
-    public abstract SocketListenerStats getSocketListenerStats();
-    public abstract WorkerPoolStats getProcessPoolStats();
-
-    
-    /**
-     * Start a service in this VM. If synch flag is true then what for the service to start
-     * before returning. Starting a service in this manner is typically done from the console so
-     * any errors can be reported. Starting a service asynchronously (synch == false) is intended for
-     * starting up the server. This prevents any race conditions due to service dependencies.
-     *
-     * @param ClientServiceRegistry Class to registry ServerListener
-     * @param serviceClassName Class to instantiate as a service.
-     * @param serviceID - null if a new service, if non-null then we are re-starting a service.
-     * @param serviceProps Properties required to start service.
-     * @param synch Flag to indicate if service should be started synchronously are asynchronously.
-     */
-    private void startService(final ClientServiceRegistry clientServiceRegistry, final String serviceClassName, final ServiceID serviceID, final DeployedComponent deployedComponent, final ProductServiceConfigID pscID, final Properties serviceProps, boolean synch) {
-
-        if (!synch) {
-            //add work to the pool
-            startServicePool.execute( new Runnable() {
-				public void run() {
-					startService(clientServiceRegistry, serviceID, deployedComponent,serviceClassName, pscID, serviceProps);					
-				}
-            });
-        } else {
-            //start synchronously
-            try {
-            	startService(clientServiceRegistry, serviceID, deployedComponent,serviceClassName, pscID, serviceProps);
-			} catch (Exception e) {
-				throw new ServiceException(e);
-			}  
-        }
-    }
-    
-    private void startService(ClientServiceRegistry serverListenerRegistry, ServiceID serviceID, DeployedComponent deployedComponent,final String serviceClass,ProductServiceConfigID pscID,Properties serviceProps) {
-        String serviceInstanceName = null;
-
-        try {
-        	if (serviceID == null) {
-        		serviceID = this.createServiceID();        		
-        	}
-        	
-            serviceInstanceName = serviceProps.getProperty(ServicePropertyNames.INSTANCE_NAME);
-            String componentType = serviceProps.getProperty(ServicePropertyNames.COMPONENT_TYPE_NAME);
-            String serviceType = serviceProps.getProperty(ServicePropertyNames.SERVICE_NAME);
-            String routingID = serviceProps.getProperty(ServicePropertyNames.SERVICE_ROUTING_ID);
-            String essentialStr = serviceProps.getProperty(ServicePropertyNames.SERVICE_ESSENTIAL);
-
-
-            boolean essential = false;
-            if (essentialStr != null && essentialStr.trim().length() != 0) {
-                essential = Boolean.valueOf(essentialStr).booleanValue();
-            }
-
-            // Create an instance of serviceClass
-            final ServiceInterface service  = (ServiceInterface) Class.forName(serviceClass).newInstance();
-
-            // Create ServiceRegistryBinding and register
-            final ServiceRegistryBinding binding = new ServiceRegistryBinding(serviceID, service, routingID,serviceInstanceName, componentType, serviceInstanceName,host.getFullName(), deployedComponent, pscID, service.getCurrentState(), service.getStateChangeTime(),essential, this.messageBus);
-            
-            logMessage(PlatformPlugin.Util.getString("ServiceController.0",serviceInstanceName)); //$NON-NLS-1$
-            
-            events.serviceAdded(binding);
-
-            // Initialize service
-            final Object[] param1 = new Object[] { serviceID };
-            DeployedComponentID deployedComponentID = (DeployedComponentID) deployedComponent.getID();
-            logMessage(PlatformPlugin.Util.getString("ServiceController.1",param1)); //$NON-NLS-1$
-            binding.getService().init(serviceID, deployedComponentID, serviceProps, serverListenerRegistry); 
-            logMessage(PlatformPlugin.Util.getString("ServiceController.2",param1)); //$NON-NLS-1$
-            logMessage(PlatformPlugin.Util.getString("ServiceController.3",param1)); //$NON-NLS-1$                
-                               
-            logMessage(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0009, serviceType, serviceInstanceName));
-
-        } catch (Exception e) {
-            throw new ServiceException(e, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0028, serviceInstanceName));
-        }
-    }    
-    
-
-    /**
-     * Stop all the services in this vm.
-     *
-     * @param now If true do not wait for work to complete in services.
-     * @throws ServiceException if an error occurs stopping 1 or more services.
-     */
-    private void stopServices(boolean now, boolean shutdown) throws MultipleException {
-
-        MultipleException multipleException = new MultipleException();
-
-        List<ServiceRegistryBinding> bindings = this.registry.getServiceBindings(host.getFullName(), id.toString());
-        
-        for (ServiceRegistryBinding binding:bindings) {
-            try {
-                stopService(binding, now, shutdown);
-            } catch (ServiceException se) {
-                multipleException.getExceptions().add(se);
-            }
-        }
-
-        int numExceptions = multipleException.getExceptions().size();
-        if (numExceptions == 1) {
-            //if there is one ServiceException, throw it
-            throw (ServiceException) multipleException.getExceptions().get(0);
-        } else if (numExceptions > 1) {
-            //if there are many, throw the MultipleException containing all of them
-            throw multipleException;
-        }
-    }
-
-    /**
-     * Stop service, if now flag is true then stop service immediately, do not wait for work to complete.
-     *
-     * @param serviceID Identifies service to be stopped
-     * @param now If true, stop service without waiting for work to complete
-     * @throws ServiceException if an error occurs while stopping service or if attempting shutdown the last essential service.
-     */
-    private synchronized void stopService(ServiceRegistryBinding binding, boolean now, boolean shutdown) {
-        ServiceInterface service = null;
-        int currentState;
-
-        if (!shutdown && !canServiceBeShutdown(binding)) {
-            throw new ServiceException(ErrorMessageKeys.SERVICE_0017, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0017, binding.getServiceID()));
-        }
-
-        try {
-            service = binding.getService();
-            // check for null service in case the service was stopped.  When servcie is stopped,
-            // the binding service reference is nulled out.
-            if (service == null) {
-                return;
-            }
-            currentState = binding.getCurrentState();
-        } catch (Exception e) {
-            throw new ServiceException(e, ErrorMessageKeys.SERVICE_0018, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0018, binding.getServiceID()));
-        }
-
-        // Do not kill a service that was not intialized. May throw meaningless exception
-        if (currentState != ServiceState.STATE_INIT_FAILED &&
-            currentState != ServiceState.STATE_CLOSED) {
-            if (!now) {
-                service.die(); // throws ServiceException
-            } else {
-                service.dieNow(); // do not wait for work to complete.
-            }
-        }
-        
-        // Leave binding in registry but remove service instance.
-        if (shutdown) {
-        	events.serviceRemoved(binding.getServiceID());
-        }
-        else {
-        	events.serviceUpdated(binding);
-        }
-    }
-    
-    
-    /**
-     * Check a service, and updates the state in some cases.  
-     * Catches any ServiceExceptions, so that the caller doesn't have to deal with them.
-     * @param serviceID Identifies service to be stopped
-     */
-    public void checkService(ServiceID serviceID) {
-        logMessage(PlatformPlugin.Util.getString(LogMessageKeys.VM_0054, serviceID));
-        validateServiceID(serviceID);
-    	
-        ServiceInterface service = null;
-        int currentState = 0;
-
-        try {
-            ServiceRegistryBinding binding = this.registry.getServiceBinding(serviceID.getHostName(), serviceID.getVMControllerID().toString(), serviceID);
-            service = binding.getService();
-            // check for null service in case the service was stopped.  When service is stopped,
-            // the binding service reference is nulled out.
-            
-            if (service != null) {
-                currentState = binding.getCurrentState();
-            } else {
-                return;
-            }
-        } catch (Exception e) {
-            logException(e, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0068, serviceID));
-            return;
-        }
-
-        try {
-            //Only check state of OPEN and DATA_SOURCE_UNAVAILABLE services
-            if (currentState == ServiceState.STATE_OPEN ||
-                currentState == ServiceState.STATE_DATA_SOURCE_UNAVAILABLE) {
-                service.checkState(); // throws ServiceException
-            }
-        } catch (ServiceException e) {
-            logException(e, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0068, serviceID)); 
-        } 
-    }
-
-    protected Properties getProperties() {
-    	return this.vmProps;
-    }
-   
-    /**
-     * Return TRUE if the system's services are started; i.e. at least one of every essential services
-     * in a product is running. Authorization, Configuration, Membership and Session
-     * services are considered to be essential.
-     *
-     * @param callerSessionID ID of the caller's current session.
-     * @return Boolean - TRUE if system is started, FALSE if not.
-     * @throws MetaMatrixComponentException if an error occurred in communicating with a component.
-     */
-    protected boolean isStarted() {
-
-        boolean servicesStarted = false;
-        List authServices = this.registry.getActiveServiceBindings(null, null, AuthorizationServiceInterface.NAME);
-        List sessionServices = this.registry.getActiveServiceBindings(null, null,SessionServiceInterface.NAME);
-        List membershipServices = this.registry.getActiveServiceBindings(null, null,MembershipServiceInterface.NAME);
-        List configurationServices = this.registry.getActiveServiceBindings(null, null,ConfigurationServiceInterface.NAME);
-        
-        if ( (authServices.size() > 0) &&
-             (sessionServices.size()) > 0 &&
-             (membershipServices.size() > 0) &&
-             (configurationServices.size() > 0)
-             ) {
-
-            servicesStarted = true;
-        }
-        return servicesStarted;
-    }    
-    
-    /**
-     * Create a globally unique ServiceID
-     *
-     * @return ServiceID
-     */
-    private ServiceID createServiceID() {
-        try {
-            return new ServiceID(DBIDGenerator.getInstance().getID(DBIDGenerator.SERVICE_ID), id);
-        } catch (DBIDGeneratorException e) {
-            throw new ServiceException(e, ErrorMessageKeys.SERVICE_0025, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0025));
-        }
-    }
-
-    /**
-     * True indicates service can be
-     */
-    private boolean canServiceBeShutdown(ServiceRegistryBinding binding) {
-
-        boolean shutdown = true;
-        try {
-            if (binding.isEssential()) {
-                List services = this.registry.getActiveServiceBindings(null, null, binding.getServiceType());
-                if (services.size() < 2) {
-                    shutdown = false;
-                }
-            }
-        } catch (Exception e) {
-            logException(e, PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0026, binding.getServiceID()));
-        }
-        return shutdown;
-    }
-
-    // ---------------------------------------------------------------------
-    // Logging helpers
-    // ---------------------------------------------------------------------
-
-    private void logException(Throwable e, String msg) {
-        LogManager.logError(LogPlatformConstants.CTX_SERVICE_CONTROLLER, e, msg);
-    }
-
-
-	public InetAddress getAddress() {
-		return VMNaming.getHostAddress();
-	}
-
-
-	public String getName() {
-		return vmName;
-	}
-	
-}

Modified: trunk/server/src/main/java/com/metamatrix/server/Configuration.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/Configuration.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/Configuration.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -25,8 +25,7 @@
 public interface Configuration {
 	final String HOST = "Host"; //$NON-NLS-1$
 	final String HOSTNAME = "HostName"; //$NON-NLS-1$
-	final String VMNAME = "VMName"; //$NON-NLS-1$
-	final String VMID = "VMId"; //$NON-NLS-1$
+	final String PROCESSNAME = "ProcessName"; //$NON-NLS-1$
 	final String CLUSTERNAME = "ClusterName"; //$NON-NLS-1$
 	final String LOGFILE = "LogFile"; //$NON-NLS-1$
 	final String LOGDIR = "LogDir"; //$NON-NLS-1$

Modified: trunk/server/src/main/java/com/metamatrix/server/HostController.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/HostController.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/HostController.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -53,7 +53,7 @@
 import com.metamatrix.platform.registry.ClusteredRegistryState;
 import com.metamatrix.platform.registry.HostControllerRegistryBinding;
 import com.metamatrix.platform.registry.HostMonitor;
-import com.metamatrix.platform.registry.VMRegistryBinding;
+import com.metamatrix.platform.registry.ProcessRegistryBinding;
 import com.metamatrix.platform.util.ErrorMessageKeys;
 import com.metamatrix.platform.util.LogMessageKeys;
 
@@ -178,23 +178,23 @@
         vmPropsAndConfigProps.putAll(props);
         vmPropsAndConfigProps.putAll(this.host.getProperties());                    
         vmPropsAndConfigProps.putAll(vmProps);
-		String vmName = deployedVM.getID().getName();
+		String processName = deployedVM.getID().getName();
 
         // pass the instance name and its properties
-        String name = vmName.toUpperCase();
+        String name = processName.toUpperCase();
 		if (processMap.containsKey(name)) {
-			LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, PlatformPlugin.Util.getString(LogMessageKeys.HOST_0011,vmName));
+			LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, PlatformPlugin.Util.getString(LogMessageKeys.HOST_0011,processName));
 		    try {
-				killServer(hostname, vmName, true);
+				killServer(hostname, processName, true);
 			} catch (MetaMatrixComponentException e) {
 				LogManager.logError(LogCommonConstants.CTX_CONTROLLER, e, e.getMessage());
 			}
 		}
 		
 		if (deployedVM.isEnabled()) {
-		    processMap.put(name, startDeployVM(vmName, hostname, vmPropsAndConfigProps));
+		    processMap.put(name, startDeployVM(processName, hostname, vmPropsAndConfigProps));
 		} else {
-			LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, PlatformPlugin.Util.getString("HostController.VM_is_not_enabled_to_start", vmName));//$NON-NLS-1$
+			LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, PlatformPlugin.Util.getString("HostController.VM_is_not_enabled_to_start", processName));//$NON-NLS-1$
 		}
     }
 
@@ -290,13 +290,13 @@
 		return injector.getInstance(HostController.class);
 	}    
     
-   private Process startDeployVM( String vmName, String hostName, Properties vmprops) {
-	   LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, "Start deploy VM = " + vmName + " on host = "+ hostName); //$NON-NLS-1$ //$NON-NLS-2$
-       String command = buildVMCommand(vmName, vmprops);
+   private Process startDeployVM( String processName, String hostName, Properties vmprops) {
+	   LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, "Start deploy VM = " + processName + " on host = "+ hostName); //$NON-NLS-1$ //$NON-NLS-2$
+       String command = buildVMCommand(processName, vmprops);
        return execCommand(command);
    }
 
-   private String buildVMCommand(String vmName, Properties vmprops) {
+   private String buildVMCommand(String processName, Properties vmprops) {
 	   String java = null;
 	   String java_home = System.getProperty("java.home"); //$NON-NLS-1$
 	   if (java_home != null) {
@@ -310,7 +310,7 @@
 	   java = replaceToken(java, vmprops);
 	   java_opts = replaceToken(java_opts, vmprops);
    
-	   String cmd = java + " " +java_opts+ " " + DEFAULT_JAVA_MAIN + " " + vmName; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
+	   String cmd = java + " " +java_opts+ " " + DEFAULT_JAVA_MAIN + " " + processName; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
        return cmd;
    }
    
@@ -352,18 +352,18 @@
    }
 
 	@Override
-	public void killServer(String hostName, String vmName, boolean stopNow) throws MetaMatrixComponentException {
+	public void killServer(String hostName, String processName, boolean stopNow) throws MetaMatrixComponentException {
 		
 		if (isRootHost(hostName)) {
-	    	LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, "KillVM " + vmName); //$NON-NLS-1$
+	    	LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, "KillVM " + processName); //$NON-NLS-1$
 	        
 	        // find the vm and shut it down.
-	        List<VMRegistryBinding> vms = HostController.this.registry.getVMs(null);
-	        for (VMRegistryBinding vm:vms) {
+	        List<ProcessRegistryBinding> vms = HostController.this.registry.getVMs(null);
+	        for (ProcessRegistryBinding vm:vms) {
 	            if (vm.getHostName().equalsIgnoreCase(this.host.getFullName())) {
-	                if (vm.getVMName().equalsIgnoreCase(vmName)) {
+	                if (vm.getProcessName().equalsIgnoreCase(processName)) {
 	                    try {
-                    		vm.getVMController().shutdown(stopNow);
+                    		vm.getProcessController().shutdown(stopNow);
 	                    } catch (Exception e) {
 	                        // ignore
 	                    }
@@ -372,16 +372,16 @@
 	            }
 	        }
 	        
-	        Process process = (Process) processMap.get(vmName.toUpperCase());
+	        Process process = (Process) processMap.get(processName.toUpperCase());
 	        if (process != null) {
-	            processMap.remove(vmName.toUpperCase());
+	            processMap.remove(processName.toUpperCase());
 	            process.destroy();
 	        }
 		}
 		else {
 			HostManagement remoteHost = getRemoteHost(hostName);
 			if (remoteHost != null) {
-				remoteHost.killServer(hostName, vmName, stopNow);
+				remoteHost.killServer(hostName, processName, stopNow);
 			}
 			else {
 				throw new MetaMatrixComponentException("HostController for host = " + hostName + " can not be reached"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -403,8 +403,8 @@
 	
 	        Iterator processes = copyMap.keySet().iterator();
 	        while (processes.hasNext()) {
-	            String vmName = (String) processes.next();
-	            killServer(hostName, vmName, stopNow);
+	            String processName = (String) processes.next();
+	            killServer(hostName, processName, stopNow);
 	        }
 	        processMap.clear();
 		}
@@ -448,7 +448,7 @@
 
 	
 	@Override
-	public boolean pingServer(String hostName, String vmName) {
+	public boolean pingServer(String hostName, String processName) {
 		return true;
 	}
 	
@@ -487,26 +487,26 @@
 	}
 	
 	@Override
-	public void startServer(String hostName, String vmName) throws MetaMatrixComponentException {
+	public void startServer(String hostName, String processName) throws MetaMatrixComponentException {
 		if (isRootHost(hostName)) {
 	    	try {
-				LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, "StartVM " + vmName); //$NON-NLS-1$
+				LogManager.logInfo(LogCommonConstants.CTX_CONTROLLER, "StartVM " + processName); //$NON-NLS-1$
 				CurrentConfiguration.getInstance().verifyBootstrapProperties();
 				ConfigurationModelContainer currentConfig = CurrentConfiguration.getInstance().getConfigurationModel();
 	
-				VMComponentDefn deployedVM = currentConfig.getConfiguration().getVMForHost(this.host.getFullName(), vmName);
+				VMComponentDefn deployedVM = currentConfig.getConfiguration().getVMForHost(this.host.getFullName(), processName);
 	
 				if (deployedVM != null) {
 					startVM(deployedVM, this.host.getFullName(), currentConfig);
 				}
 			} catch (ConfigurationException e) {
-				LogManager.logError(LogCommonConstants.CTX_CONTROLLER, e, "Error starting the vm = "+vmName); //$NON-NLS-1$
+				LogManager.logError(LogCommonConstants.CTX_CONTROLLER, e, "Error starting the vm = "+processName); //$NON-NLS-1$
 			} 
 		}
 		else {
 			HostManagement remoteHost = getRemoteHost(hostName);
 			if (remoteHost != null) {
-				remoteHost.startServer(hostName, vmName);
+				remoteHost.startServer(hostName, processName);
 			}
 			else {
 				throw new MetaMatrixComponentException("HostController for host = " + hostName + " can not be reached"); //$NON-NLS-1$ //$NON-NLS-2$

Modified: trunk/server/src/main/java/com/metamatrix/server/HostManagement.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/HostManagement.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/HostManagement.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -64,26 +64,26 @@
 	void bounceServers(String hostName) throws MetaMatrixComponentException;
 	
 	/**
-	 * Start a server process on this host with specified vmName
+	 * Start a server process on this host with specified processName
 	 * @param hostName - name of the host; can not be null
-	 * @param vmName - virtual machine name
+	 * @param processName - virtual machine name
 	 */
-	void startServer(String hostName, String vmName) throws MetaMatrixComponentException ;
+	void startServer(String hostName, String processName) throws MetaMatrixComponentException ;
 	
 	/**
-	 * Kill the server process on this host with specified vmName
+	 * Kill the server process on this host with specified processName
 	 * @param hostName - name of the host; can not be null
-	 * @param vmName
+	 * @param processName
 	 */
-	void killServer(String hostName, String vmName, boolean stopNow) throws MetaMatrixComponentException;
+	void killServer(String hostName, String processName, boolean stopNow) throws MetaMatrixComponentException;
 	
 	/**
-	 * Ping the server process on this host with given vmName.
+	 * Ping the server process on this host with given processName.
 	 * @param hostName - name of the host; can not be null
-	 * @param vmName
+	 * @param processName
 	 * @return true if available; false otherwise
 	 */
-	boolean pingServer(String hostName, String vmName);
+	boolean pingServer(String hostName, String processName);
 	
 	/**
 	 * Ping the local host controller 

Modified: trunk/server/src/main/java/com/metamatrix/server/LogApplicationInfo.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/LogApplicationInfo.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/LogApplicationInfo.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -54,13 +54,13 @@
 	String applFileName = null;
     String logPath = null;
     String hostName;
-    String vmName;
+    String processName;
     
-    public LogApplicationInfo(String hostName, String vmName, String path, String fileName) {
+    public LogApplicationInfo(String hostName, String processName, String path, String fileName) {
 		applFileName = fileName;
         logPath = path;
         this.hostName = hostName;
-        this.vmName = vmName;
+        this.processName = processName;
     }
     
     public void run() {
@@ -68,7 +68,7 @@
         try {
                            
             ConfigurationModelContainer configmodel = CurrentConfiguration.getInstance().getConfigurationModel();
-            VMComponentDefn deployedVM = configmodel.getConfiguration().getVMForHost(this.hostName, this.vmName);
+            VMComponentDefn deployedVM = configmodel.getConfiguration().getVMForHost(this.hostName, this.processName);
 
             Properties configprops = null;
             

Modified: trunk/server/src/main/java/com/metamatrix/server/Main.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/Main.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/Main.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -39,7 +39,7 @@
 import com.metamatrix.core.util.StringUtil;
 import com.metamatrix.dqp.ResourceFinder;
 import com.metamatrix.platform.PlatformPlugin;
-import com.metamatrix.platform.vm.api.controller.VMControllerInterface;
+import com.metamatrix.platform.vm.api.controller.ProcessManagement;
 
 /**
  * This is main server starter class.
@@ -50,7 +50,7 @@
 	MessageBus messageBus;
 	
 	@Inject
-	VMControllerInterface vmController;
+	ProcessManagement vmController;
 	
 	@Inject
 	LogListener logListener;
@@ -63,7 +63,7 @@
 			    System.exit(1);        	
 			}
 
-			String vmName = args[0];
+			String processName = args[0];
 
 			Host host = null;
 			try {
@@ -76,19 +76,19 @@
 			    System.exit(-1);
 			}
 			
-			VMComponentDefn deployedVM = CurrentConfiguration.getInstance().getConfiguration().getVMForHost(host.getName(), vmName);
+			VMComponentDefn deployedVM = CurrentConfiguration.getInstance().getConfiguration().getVMForHost(host.getName(), processName);
 			String bindAddress = deployedVM.getBindAddress();
 			
-			VMNaming.setVMName(vmName);
+			VMNaming.setProcessName(processName);
 			VMNaming.setup(host.getFullName(), host.getHostAddress(), bindAddress);
 			
 			// write info log
-			writeInfoLog(host, vmName);
+			writeInfoLog(host, processName);
 			        
 			createTempDirectory();                    
 			
 			// wire up guice modules
-			Main main = loadMain(host, vmName);
+			Main main = loadMain(host, processName);
 			
 			// launch the server
 			
@@ -100,8 +100,8 @@
 	}
 	
 	
-	private static Main loadMain(Host host, String vmName) {
-		Injector injector = Guice.createInjector(new ServerGuiceModule(host, vmName));
+	private static Main loadMain(Host host, String processName) {
+		Injector injector = Guice.createInjector(new ServerGuiceModule(host, processName));
 		// Until we get the all the DI working we have to resort to this kind of stuff..
 		ResourceFinder.setInjector(injector); 
 		return injector.getInstance(Main.class);
@@ -144,15 +144,15 @@
 		}
 	}		
 
-	private static String buildPrefix(String hostName, String vmName){
+	private static String buildPrefix(String hostName, String processName){
 	    String hostFileName = StringUtil.replaceAll(hostName, ".", "_"); //$NON-NLS-1$ //$NON-NLS-2$
-	    return hostFileName + "_" + vmName; //$NON-NLS-1$
+	    return hostFileName + "_" + processName; //$NON-NLS-1$
 	}   
 
 
-    private static void writeInfoLog(Host host, String vmName) {
+    private static void writeInfoLog(Host host, String processName) {
         // trigger the logging of the current application info to a log file for debugging        
-        LogApplicationInfo logApplInfo = new LogApplicationInfo(host.getFullName(), vmName, host.getLogDirectory(), buildPrefix(host.getFullName(), vmName) + "_info.log"); //$NON-NLS-1$
+        LogApplicationInfo logApplInfo = new LogApplicationInfo(host.getFullName(), processName, host.getLogDirectory(), buildPrefix(host.getFullName(), processName) + "_info.log"); //$NON-NLS-1$
         logApplInfo.start();        	
     }
     

Modified: trunk/server/src/main/java/com/metamatrix/server/ServerGuiceModule.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/ServerGuiceModule.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/ServerGuiceModule.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -34,42 +34,31 @@
 import com.metamatrix.common.config.CurrentConfiguration;
 import com.metamatrix.common.config.api.Host;
 import com.metamatrix.common.config.api.exceptions.ConfigurationException;
-import com.metamatrix.common.id.dbid.DBIDGenerator;
-import com.metamatrix.common.id.dbid.DBIDGeneratorException;
 import com.metamatrix.common.log.LogConfiguration;
 import com.metamatrix.common.log.LogManager;
 import com.metamatrix.common.messaging.MessageBus;
 import com.metamatrix.common.messaging.VMMessageBus;
-import com.metamatrix.core.MetaMatrixRuntimeException;
 import com.metamatrix.core.log.LogListener;
 import com.metamatrix.core.util.StringUtil;
 import com.metamatrix.platform.registry.ClusteredRegistryState;
-import com.metamatrix.platform.registry.VMMonitor;
+import com.metamatrix.platform.registry.ProcessMonitor;
 import com.metamatrix.platform.service.proxy.ProxyManager;
 import com.metamatrix.platform.util.PlatformProxyHelper;
-import com.metamatrix.platform.vm.api.controller.VMControllerInterface;
+import com.metamatrix.platform.vm.api.controller.ProcessManagement;
 import com.metamatrix.platform.vm.controller.ServerEvents;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 
 class ServerGuiceModule extends AbstractModule {
 
 	Host host;
-	String vmName;
+	String processName;
 
-	public ServerGuiceModule(Host host, String vmName) {
+	public ServerGuiceModule(Host host, String processName) {
 		this.host = host;
-		this.vmName = vmName;
+		this.processName = processName;
 	}
 	
 	@Override
 	protected void configure() {
-
-		long vmID = 1;
-		try {
-			vmID = DBIDGenerator.getInstance().getID(DBIDGenerator.VM_ID);
-		} catch (DBIDGeneratorException e1) {
-			throw new MetaMatrixRuntimeException(e1);
-		}
 		
 		String systemName = null;
 		try {
@@ -79,16 +68,14 @@
 		}
 		
 		bindConstant().annotatedWith(Names.named(Configuration.HOSTNAME)).to(host.getFullName());
-		bindConstant().annotatedWith(Names.named(Configuration.VMNAME)).to(vmName);
-		bindConstant().annotatedWith(Names.named(Configuration.VMID)).to(vmID);
+		bindConstant().annotatedWith(Names.named(Configuration.PROCESSNAME)).to(processName);
 		bind(Host.class).annotatedWith(Names.named(Configuration.HOST)).toInstance(host);
 		bindConstant().annotatedWith(Names.named(Configuration.CLUSTERNAME)).to(systemName);
-		bindConstant().annotatedWith(Names.named(Configuration.LOGFILE)).to(StringUtil.replaceAll(host.getFullName(), ".", "_")+"_"+this.vmName+".log"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		bindConstant().annotatedWith(Names.named(Configuration.LOGFILE)).to(StringUtil.replaceAll(host.getFullName(), ".", "_")+"_"+this.processName+".log"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 		bindConstant().annotatedWith(Names.named(Configuration.LOGDIR)).to(host.getLogDirectory());
 				
 		Names.bindProperties(binder(), CurrentConfiguration.getInstance().getProperties());
 		
-		bind(VMControllerID.class).toInstance(new VMControllerID(vmID, host.getFullName()));
 		bind(Multiplexer.class).toProvider(JGroupsProvider.class).in(Scopes.SINGLETON);
 		bind(ChannelProvider.class).in(Scopes.SINGLETON);
 		bind(Cache.class).toProvider(CacheProvider.class).in(Scopes.SINGLETON);
@@ -96,8 +83,8 @@
 		bind(ClusteredRegistryState.class).in(Scopes.SINGLETON);
 		bind(ProxyManager.class).in(Scopes.SINGLETON);
 		bind(MessageBus.class).to(VMMessageBus.class).in(Scopes.SINGLETON); // VM Message bus is in common-internal
-		bind(VMControllerInterface.class).to(SocketVMController.class).in(Scopes.SINGLETON);
-		bind(ServerEvents.class).to(VMMonitor.class).in(Scopes.SINGLETON);
+		bind(ProcessManagement.class).to(SocketVMController.class).in(Scopes.SINGLETON);
+		bind(ServerEvents.class).to(ProcessMonitor.class).in(Scopes.SINGLETON);
 		bind(HostManagement.class).toProvider(HostManagementProvider.class).in(Scopes.SINGLETON);
 		
 		// this needs to be removed.

Modified: trunk/server/src/main/java/com/metamatrix/server/ServiceManager.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/ServiceManager.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/ServiceManager.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -31,6 +31,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.StringTokenizer;
 
 import com.google.inject.Guice;
 import com.google.inject.Inject;
@@ -57,14 +58,14 @@
 import com.metamatrix.platform.registry.ClusteredRegistryState;
 import com.metamatrix.platform.registry.HostControllerRegistryBinding;
 import com.metamatrix.platform.registry.ServiceRegistryBinding;
-import com.metamatrix.platform.registry.VMRegistryBinding;
+import com.metamatrix.platform.registry.ProcessRegistryBinding;
 import com.metamatrix.platform.service.api.CacheAdmin;
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.service.api.ServiceInterface;
 import com.metamatrix.platform.util.ErrorMessageKeys;
 import com.metamatrix.platform.util.LogMessageKeys;
-import com.metamatrix.platform.vm.api.controller.VMControllerInterface;
-import com.metamatrix.platform.vm.controller.VMStatistics;
+import com.metamatrix.platform.vm.api.controller.ProcessManagement;
+import com.metamatrix.platform.vm.controller.ProcessStatistics;
 
 /**
  *  Utility class that allows users to view the state of the services.
@@ -305,8 +306,8 @@
                 if (numTokens < 2) {
                     System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0013));
                 } else {
-                    String vmName = (String) parsedCommand.get(1);
-                    doStartVM(vmName);
+                    String processName = (String) parsedCommand.get(1);
+                    doStartVM(processName);
                 }
                 break;
 
@@ -314,8 +315,8 @@
                 if (numTokens < 2) {
                     System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0013));
                 } else {
-                    String vmName = (String) parsedCommand.get(1);
-                    doStopVM(vmName);
+                    String processName = (String) parsedCommand.get(1);
+                    doStopVM(processName);
                 }
                 break;
 
@@ -341,59 +342,34 @@
                 break;
 
             case COMMAND_STOP_SERVICE:
-                if (numTokens < 2) {
-                    System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0015));
-                } else {
-                    String id = (String) parsedCommand.get(1);
-                    long value;
-                    try {
-                        value = Long.parseLong(id);
-                    } catch (Exception e) {
-                        System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0016));
-                        break;
-                    }
-                    doStopService(new ServiceID(value, null));
-                }
+            	ServiceID id = parseServiceID(parsedCommand);
+            	if (id != null) {
+            		doStopService(id);
+            	} 
                 break;
 
             case COMMAND_GET_SERVICE_STATUS:
-                if (numTokens < 2) {
-                    System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0015));
-                } else {
-                    String id = (String) parsedCommand.get(1);
-                    long value;
-                    try {
-                        value = Long.parseLong(id);
-                    } catch (Exception e) {
-                        System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0016));
-                        break;
-                    }
-                    doGetServiceStatus(new ServiceID(value, null));
-                }
+            {
+            	ServiceID service = parseServiceID(parsedCommand);
+            	if (service != null) {
+            		doGetServiceStatus(service);
+            	}            	
                 break;
-
+            }
             case COMMAND_MARK_SERVICE_AS_BAD:
-                if (numTokens < 2) {
-                    System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0015));
-                } else {
-                    String id = (String) parsedCommand.get(1);
-                    long value;
-                    try {
-                        value = Long.parseLong(id);
-                    } catch (Exception e) {
-                        System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0016));
-                        break;
-                    }
-                    doMarkServiceAsBad(new ServiceID(value, null));
-                }
+            {
+            	ServiceID service = parseServiceID(parsedCommand);
+            	if (service != null) {
+                    doMarkServiceAsBad(service);
+            	}
                 break;
-
+            }
             case COMMAND_LIST_VM_PROPERTIES:
                 if (numTokens < 2) {
                     System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0013));
                 } else {
-                    String vmName = (String) parsedCommand.get(1);
-                    doListVMProps(vmName);
+                    String processName = (String) parsedCommand.get(1);
+                    doListVMProps(processName);
                 }
                 break;
 
@@ -410,8 +386,8 @@
                 if (numTokens < 2) {
                     System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0013));
                 } else {
-                    String vmName = (String) parsedCommand.get(1);
-                    doShutdownVM(vmName, false);
+                    String processName = (String) parsedCommand.get(1);
+                    doShutdownVM(processName, false);
                 }
                 break;
 
@@ -442,8 +418,8 @@
                 if (numTokens < 2) {
                     System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0013));
                 } else {
-                    String vmName = (String) parsedCommand.get(1);
-                    doGetVMStats(vmName);
+                    String processName = (String) parsedCommand.get(1);
+                    doGetVMStats(processName);
                 }
                 break;
 
@@ -451,31 +427,23 @@
                 if (numTokens < 2) {
                     System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0013));
                 } else {
-                    String vmName = (String) parsedCommand.get(1);
-                    doDumpThreads(vmName);
+                    String processName = (String) parsedCommand.get(1);
+                    doDumpThreads(processName);
                 }
                 break;
 
             case COMMAND_GET_SERVICE_QUEUES:
-                if (numTokens < 2) {
-                    System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0015));
-                } else {
-                    String id = (String) parsedCommand.get(1);
-                    long value;
-                    try {
-                        value = Long.parseLong(id);
-                    } catch (Exception e) {
-                        System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0016));
-                        break;
-                    }
+            {
+            	ServiceID id1 = parseServiceID(parsedCommand);
+            	if (id1 != null) {
                     String queueName = null;
                     if (numTokens > 2) {
                         queueName = (String) parsedCommand.get(2);
                     }
-                    doGetServiceQueues(new ServiceID(value, null), queueName);
-                }
+            		doGetServiceQueues(id1, queueName);
+            	}
                 break;
-
+            }
             case COMMAND_SYNCH_SERVER:
                 this.doSynchronize();
                 break;
@@ -502,23 +470,38 @@
                 break;
 
             case COMMAND_START_SERVICE:
-                if (numTokens < 2) {
-                    System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0015));
-                } else {
-                    String id = (String) parsedCommand.get(1);
-                    long value;
-                    try {
-                        value = Long.parseLong(id);
-                    } catch (Exception e) {
-                        System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0016));
-                        break;
-                    }
-                    doStartService(new ServiceID(value, null));
-                }
+            {
+            	ServiceID id1 = parseServiceID(parsedCommand);
+            	if (id1 != null) {
+            		doStartService(id1);
+            	}
                 break;
+            }
         }
     }
 
+    private ServiceID parseServiceID(List parsedCommand) {
+        if (parsedCommand.size() < 2) {
+            System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0015));
+            return null;
+        } else {
+            String id = (String) parsedCommand.get(1);
+            StringTokenizer st = new StringTokenizer(id, "|"); //$NON-NLS-1$
+            if (st.countTokens() != 3) {
+            	System.out.println("Service id must be in the format <id|hostname|processname>"); //$NON-NLS-1$
+            	return null;
+            }
+            long value;
+            try {
+                value = Long.parseLong(st.nextToken());
+            } catch (Exception e) {
+                System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0016));
+                return null;
+            }
+            return new ServiceID(value, st.nextToken(), st.nextToken());
+        }    	
+    }
+    
 
 	public void doBounceService(String name) {
 
@@ -542,9 +525,9 @@
 	            	se.printStackTrace();
 				}
 				try {
-		            VMRegistryBinding vmBinding = registry.getVM(binding.getHostName(), binding.getServiceID().getVMControllerID().toString());
+		            ProcessRegistryBinding vmBinding = registry.getProcessBinding(binding.getHostName(), binding.getServiceID().getProcessName());
 		            if (vmBinding != null) {
-		            	vmBinding.getVMController().startService(binding.getServiceID());
+		            	vmBinding.getProcessController().startService(binding.getServiceID());
 		            	System.out.println("Starting " + binding.getServiceID()); //$NON-NLS-1$
 		            }
 		            else {
@@ -707,50 +690,50 @@
 		}
     }
 
-    private void doGetVMStats(String vmName) {
-        VMControllerInterface vm = getVMController(vmName);
+    private void doGetVMStats(String processName) {
+        ProcessManagement vm = getVMController(processName);
         if (vm != null) {
             try {
-                VMStatistics stats = vm.getVMStatistics();
+                ProcessStatistics stats = vm.getVMStatistics();
                 System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0019, stats.name));
                 System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0020, stats.totalMemory));
                 System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0021, stats.freeMemory));
                 System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0022, stats.threadCount));
             } catch (Exception e) {
-                System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0031, vmName));
+                System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0031, processName));
                 e.printStackTrace();
             }
 
         } else {
-            System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0030, vmName));
+            System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0030, processName));
         }
     }
 
-    private void doDumpThreads(String vmName) {
-        VMControllerInterface vm = getVMController(vmName);
+    private void doDumpThreads(String processName) {
+        ProcessManagement vm = getVMController(processName);
         if (vm != null) {
             try {
                 System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0023));
                 vm.dumpThreads();
-                System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0024, vmName));
+                System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0024, processName));
             } catch (Exception e) {
-                System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0031, vmName));
+                System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0031, processName));
                 e.printStackTrace();
             }
         } else {
-            System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0030, vmName));
+            System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0030, processName));
         }
     }
 
-    private VMControllerInterface getVMController(String vmName) {
+    private ProcessManagement getVMController(String processName) {
 
         // find vm
         try {
             Iterator vmIter = registry.getVMs(null).iterator();
             while (vmIter.hasNext()) {
-                VMRegistryBinding vmBinding = (VMRegistryBinding) vmIter.next();
-                if (vmBinding.getVMName().equalsIgnoreCase(vmName)) {
-                    return vmBinding.getVMController();
+                ProcessRegistryBinding vmBinding = (ProcessRegistryBinding) vmIter.next();
+                if (vmBinding.getProcessName().equalsIgnoreCase(processName)) {
+                    return vmBinding.getProcessController();
                 }
             }
             return null;
@@ -778,7 +761,7 @@
         }
     }
 
-    private void doStartVM(String vmName) {
+    private void doStartVM(String processName) {
 
         String host = null;
         // get host to connect to.
@@ -786,7 +769,7 @@
             Iterator vmIter = getDeployedVMs().iterator();
             while (vmIter.hasNext()) {
                 VMComponentDefn vmDefn = (VMComponentDefn) vmIter.next();
-                if (vmDefn.getName().equalsIgnoreCase(vmName)) {
+                if (vmDefn.getName().equalsIgnoreCase(processName)) {
                     host = vmDefn.getHostID().getName();
                     break;
                 }
@@ -801,14 +784,14 @@
         }
 
         try {
-        	this.hostManager.startServer(host, vmName);
+        	this.hostManager.startServer(host, processName);
         } catch (Exception e) {
             e.printStackTrace();
         }
     }
 
 
-    public void doListVMProps(String vmName) {
+    public void doListVMProps(String processName) {
 
         String host = null;
         // get host to connect to.
@@ -816,10 +799,10 @@
             Iterator vmIter = getDeployedVMs().iterator();
             while (vmIter.hasNext()) {
                 VMComponentDefn vmDefn = (VMComponentDefn) vmIter.next();
-                if (vmDefn.getName().equalsIgnoreCase(vmName)) {
+                if (vmDefn.getName().equalsIgnoreCase(processName)) {
                     host = vmDefn.getHostID().getName();
                     Properties vmPropsAndConfigProps = currentConfig.getAllPropertiesForComponent(vmDefn.getID());
-                    System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0025, vmName));
+                    System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0025, processName));
                     Iterator iter = vmPropsAndConfigProps.keySet().iterator();
                     while (iter.hasNext()) {
                         String key = (String) iter.next();
@@ -873,27 +856,27 @@
         }
     }
 
-    public void doStopVM(String vmName) {
+    public void doStopVM(String processName) {
 
         // find vm
         try {
             Iterator vmIter = registry.getVMs(null).iterator();
-            VMRegistryBinding vmBinding = null;
+            ProcessRegistryBinding vmBinding = null;
             while (vmIter.hasNext()) {
-                vmBinding = (VMRegistryBinding) vmIter.next();
-                if (vmBinding.getVMName().equalsIgnoreCase(vmName)) {
-                    this.hostManager.killServer(vmBinding.getHostName(),vmBinding.getVMName(), false);
+                vmBinding = (ProcessRegistryBinding) vmIter.next();
+                if (vmBinding.getProcessName().equalsIgnoreCase(processName)) {
+                    this.hostManager.killServer(vmBinding.getHostName(),vmBinding.getProcessName(), false);
                     break;
                 }
             }
         } catch (Exception e) {
-            System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0034, vmName));
+            System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0034, processName));
             System.out.println(PlatformPlugin.Util.getString(LogMessageKeys.SERVICE_0028));
-            killVM(vmName);
+            killVM(processName);
         }
     }
 
-    private void killVM(String vmName) {
+    private void killVM(String processName) {
 
         String host = null;
         // get host to connect to.
@@ -901,7 +884,7 @@
             Iterator vmIter = getDeployedVMs().iterator();
             while (vmIter.hasNext()) {
                 VMComponentDefn vmDefn = (VMComponentDefn) vmIter.next();
-                if (vmDefn.getName().equalsIgnoreCase(vmName)) {
+                if (vmDefn.getName().equalsIgnoreCase(processName)) {
                     host = vmDefn.getHostID().getName();
                     break;
                 }
@@ -916,24 +899,24 @@
         }
 
         try {
-        	this.hostManager.killServer(host, vmName, false);
+        	this.hostManager.killServer(host, processName, false);
         } catch (Exception e) {
             e.printStackTrace();
         }
     }
 
-    public void doShutdownVM(String vmName, boolean now) {
+    public void doShutdownVM(String processName, boolean now) {
         try {
             Iterator vmIter = registry.getVMs(null).iterator();
             while (vmIter.hasNext()) {
-                VMRegistryBinding vmBinding = (VMRegistryBinding) vmIter.next();
-                if (vmBinding.getVMName().equalsIgnoreCase(vmName)) {
-                    this.hostManager.killServer(vmBinding.getHostName(), vmName, now);
+                ProcessRegistryBinding vmBinding = (ProcessRegistryBinding) vmIter.next();
+                if (vmBinding.getProcessName().equalsIgnoreCase(processName)) {
+                    this.hostManager.killServer(vmBinding.getHostName(), processName, now);
                     return;
                 }
             }
         } catch (Exception e) {
-            System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0034, vmName));
+            System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0034, processName));
             e.printStackTrace();
         }
     }
@@ -1040,12 +1023,12 @@
                 System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0039));
                 return;
             }
-            VMRegistryBinding vmBinding = registry.getVM(id.getHostName(), id.getVMControllerID().toString());
+            ProcessRegistryBinding vmBinding = registry.getProcessBinding(id.getHostName(), id.getProcessName());
             if (vmBinding != null) {
-            	vmBinding.getVMController().stopService(id, false, false);
+            	vmBinding.getProcessController().stopService(id, false, false);
             }
             else {
-            	System.out.println("No VM found on host="+id.getHostName()+" with id="+id.getVMControllerID().toString()); //$NON-NLS-1$ //$NON-NLS-2$
+            	System.out.println("No VM found on host="+id.getHostName()+" with process name ="+id.getProcessName()); //$NON-NLS-1$ //$NON-NLS-2$
             }
         } catch (Exception e) {
             System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0015, id));
@@ -1086,7 +1069,7 @@
                 System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0039));
                 return;
             }
-            System.out.println(registry.getServiceBinding(id.getHostName(), id.getVMControllerID().toString(), id));
+            System.out.println(registry.getServiceBinding(id.getHostName(), id.getProcessName(), id));
         } catch (Exception e) {
             System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0043));
             e.printStackTrace();
@@ -1102,7 +1085,7 @@
                 System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0039));
                 return;
             }
-            ServiceRegistryBinding serviceBinding = this.registry.getServiceBinding(id.getHostName(), id.getVMControllerID().toString(), id);
+            ServiceRegistryBinding serviceBinding = this.registry.getServiceBinding(id.getHostName(), id.getProcessName(), id);
             
             ServiceInterface service = null;
             if (serviceBinding != null) {
@@ -1154,12 +1137,12 @@
                 System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0039));
                 return;
             }
-            VMRegistryBinding vmBinding = registry.getVM(id.getHostName(), id.getVMControllerID().toString());
+            ProcessRegistryBinding vmBinding = registry.getProcessBinding(id.getHostName(), id.getProcessName());
             if (vmBinding != null) {
-            	vmBinding.getVMController().startService(id);
+            	vmBinding.getProcessController().startService(id);
             }
             else {
-            	System.out.println("No VM found on host="+id.getHostName()+" with id="+id.getVMControllerID().toString());   //$NON-NLS-1$ //$NON-NLS-2$         	
+            	System.out.println("No VM found on host="+id.getHostName()+" with process name ="+id.getProcessName());   //$NON-NLS-1$ //$NON-NLS-2$         	
             }            
         } catch (Exception e) {
             System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0047));
@@ -1175,7 +1158,7 @@
                 System.out.println(PlatformPlugin.Util.getString(ErrorMessageKeys.SERVICE_0039));
                 return;
             }
-            ServiceRegistryBinding binding = this.registry.getServiceBinding(serviceID.getHostName(), serviceID.getVMControllerID().toString(), serviceID);
+            ServiceRegistryBinding binding = this.registry.getServiceBinding(serviceID.getHostName(), serviceID.getProcessName(), serviceID);
             if (binding != null) {
             	binding.markServiceAsBad();
             }

Modified: trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -243,10 +243,10 @@
             
             // Create a stringified connector ID from the serviceID
             ServiceID id = this.getID();
-            String connID = id.getVMControllerID().getID() + "|" + id.getID();         //$NON-NLS-1$
+            String connID = id.getHostName()+"|"+ id.getProcessName() + "|" + id.getID();   //$NON-NLS-1$ //$NON-NLS-2$
             deMaskedProps.put(ConnectorPropertyNames.CONNECTOR_ID, connID);
             deMaskedProps.put(ConnectorPropertyNames.CONNECTOR_BINDING_NAME, getInstanceName());
-            deMaskedProps.put(ConnectorPropertyNames.CONNECTOR_VM_NAME, VMNaming.getVMName());
+            deMaskedProps.put(ConnectorPropertyNames.CONNECTOR_VM_NAME, VMNaming.getProcessName());
             connectorManager.setClassloader(loader);
             connectorManager.initialize(deMaskedProps);
             return connectorManager;

Modified: trunk/server/src/main/java/com/metamatrix/server/dqp/config/PlatformConfigSource.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/dqp/config/PlatformConfigSource.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/dqp/config/PlatformConfigSource.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -59,9 +59,9 @@
     private Properties dqpProps;
     
     private Host host;
-    private String vmName;
+    private String processName;
     
-    public PlatformConfigSource(Properties queryServiceProps, Properties currentConfiguration, Object clientId, Host host, String vmName) {
+    public PlatformConfigSource(Properties queryServiceProps, Properties currentConfiguration, Object clientId, Host host, String processName) {
         dqpProps = PropertiesUtils.clone(queryServiceProps, currentConfiguration, true);
         dqpProps.setProperty(DQPConfigSource.PROCESS_POOL_MAX_THREADS, queryServiceProps.getProperty(QueryServicePropertyNames.PROCESS_POOL_MAX_THREADS));
         dqpProps.setProperty(DQPConfigSource.PROCESS_POOL_THREAD_TTL, queryServiceProps.getProperty(QueryServicePropertyNames.PROCESS_POOL_THREAD_TTL));
@@ -93,7 +93,7 @@
         }
         
         this.host = host;
-        this.vmName = vmName;
+        this.processName = processName;
     }
 
     /*
@@ -125,7 +125,7 @@
 		} catch (VirtualDatabaseException e) {
 			throw new MetaMatrixRuntimeException(e);
 		}
-		binder.bindConstant().annotatedWith(Names.named(Configuration.VMNAME)).to(vmName);
+		binder.bindConstant().annotatedWith(Names.named(Configuration.PROCESSNAME)).to(processName);
 		binder.bind(Host.class).annotatedWith(Names.named(Configuration.HOST)).toInstance(host);
 	}
     

Modified: trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformBufferService.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformBufferService.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformBufferService.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -47,13 +47,13 @@
     private BufferManager bufferMgr;
     private Properties props;
     
-    private String vmName;
+    private String processName;
     private Host host;
     
     @Inject
-    public PlatformBufferService(@Named(Configuration.HOST) Host host, @Named(Configuration.VMNAME) String vmName) {
+    public PlatformBufferService(@Named(Configuration.HOST) Host host, @Named(Configuration.PROCESSNAME) String processName) {
     	this.host = host;
-    	this.vmName = vmName;
+    	this.processName = processName;
 	}
 
     /* 
@@ -83,7 +83,7 @@
 		props.setProperty(BufferManagerPropertyNames.BUFFER_STORAGE_DIRECTORY, dir);
 
 		try {
-			bufferMgr = BufferManagerFactory.getServerBufferManager(host.getFullName()+"-"+vmName, props); //$NON-NLS-1$
+			bufferMgr = BufferManagerFactory.getServerBufferManager(host.getFullName()+"-"+processName, props); //$NON-NLS-1$
 		} catch (MetaMatrixComponentException e) {
 			throw new ApplicationLifecycleException(e);
 		} 

Modified: trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformTransactionService.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformTransactionService.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformTransactionService.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -80,7 +80,7 @@
             props.putAll(env);
             props.setProperty(TransactionService.TXN_MGR_LOG_DIR, logDir);
             props.setProperty(TransactionService.HOSTNAME, host.getFullName());
-            props.setProperty(TransactionService.VMNAME, VMNaming.getVMName());
+            props.setProperty(TransactionService.VMNAME, VMNaming.getProcessName());
             props.setProperty(TransactionService.TXN_STORE_DIR, host.getDataDirectory()); 
 
             arjunaTs.init(ArjunaTransactionProvider.getInstance(props));

Modified: trunk/server/src/main/java/com/metamatrix/server/query/service/QueryService.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/query/service/QueryService.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/java/com/metamatrix/server/query/service/QueryService.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -95,7 +95,7 @@
             LogManager.logError(LogConstants.CTX_QUERY_SERVICE, t, ServerPlugin.Util.getString("QueryService.Unable_to_register_user-defined_function_source__{0}_1", udfSource)); //$NON-NLS-1$
         }
 
-        DQPConfigSource configSource = new PlatformConfigSource(props, CurrentConfiguration.getInstance().getProperties(), new Long(getID().getID()), CurrentConfiguration.getInstance().getDefaultHost(), VMNaming.getVMName());
+        DQPConfigSource configSource = new PlatformConfigSource(props, CurrentConfiguration.getInstance().getProperties(), new Long(getID().getID()), CurrentConfiguration.getInstance().getDefaultHost(), VMNaming.getProcessName());
         dqp = new DQPCore();
         dqp.start(configSource);
     }

Modified: trunk/server/src/main/resources/com/metamatrix/platform/i18n.properties
===================================================================
--- trunk/server/src/main/resources/com/metamatrix/platform/i18n.properties	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/main/resources/com/metamatrix/platform/i18n.properties	2009-03-04 23:29:07 UTC (rev 537)
@@ -1132,7 +1132,7 @@
 MSG.014.010.0044 = Error removing {0} from registry.
 MSG.014.010.0045 = Resuming service: {0}
 MSG.014.010.0046 = Setting log config: {0}
-MSG.014.010.0047 = Service {0} does not belong to this VM: {1}
+MSG.014.010.0047 = Service {0} does not belong to this VM: <{1}.{2}>
 MSG.014.010.0048 = Property "{0}" not defined. Using default command "{1}"
 MSG.014.010.0049 = Starting command " {0} "
 MSG.014.010.0050 = Command started.

Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeCacheAdmin.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeCacheAdmin.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeCacheAdmin.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -40,7 +40,6 @@
 import com.metamatrix.platform.service.api.CacheAdmin;
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.service.api.ServiceInterface;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 
 
 public class FakeCacheAdmin implements CacheAdmin, ServiceInterface {
@@ -126,7 +125,7 @@
         return null;
     }
 
-    public VMControllerID getVMID(){
+    public String getProcessName(){
         return null;
     }
 

Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfiguration.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfiguration.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfiguration.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -272,7 +272,7 @@
     }
 
     public VMComponentDefn getVMForHost(String hostname,
-                                        String vmname) {
+                                        String processName) {
         return null;
     }
 

Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -76,7 +76,6 @@
 import com.metamatrix.platform.PlatformPlugin;
 import com.metamatrix.platform.config.api.service.ConfigurationServiceInterface;
 import com.metamatrix.platform.service.api.ServiceID;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 
 public class FakeConfigurationService implements ConfigurationServiceInterface {
 
@@ -713,7 +712,7 @@
     /** 
      * @see com.metamatrix.platform.service.api.ServiceInterface#getVMID()
      */
-    public VMControllerID getVMID()  {
+    public String getProcessName()  {
         return null;
     }
 

Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -42,7 +42,6 @@
 import com.metamatrix.platform.security.api.MetaMatrixSessionID;
 import com.metamatrix.platform.security.api.SessionToken;
 import com.metamatrix.platform.service.api.ServiceID;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 import com.metamatrix.server.query.service.QueryServiceInterface;
 import com.metamatrix.server.serverapi.RequestInfo;
 
@@ -71,32 +70,32 @@
     public Collection getAllQueries() {
         List results = new ArrayList();
         
-        RequestInfo info1 = new RequestInfo(new RequestID("1", 1L), "sql1", new Date(), new Date()); //$NON-NLS-1$
-        SessionToken token1 = new SessionToken(new MetaMatrixSessionID(1), "user1"); //$NON-NLS-1$ //$NON-NLS-2$
+        RequestInfo info1 = new RequestInfo(new RequestID("1", 1L), "sql1", new Date(), new Date()); //$NON-NLS-1$ //$NON-NLS-2$
+        SessionToken token1 = new SessionToken(new MetaMatrixSessionID(1), "user1"); //$NON-NLS-1$ 
         info1.setSessionToken(token1);
         results.add(info1);
         
         
-        RequestInfo info2 = new RequestInfo(new RequestID("2", 2), "sql2", new Date(), new Date()); //$NON-NLS-1$
-        SessionToken token2 = new SessionToken(new MetaMatrixSessionID(2), "user2"); //$NON-NLS-1$ //$NON-NLS-2$
+        RequestInfo info2 = new RequestInfo(new RequestID("2", 2), "sql2", new Date(), new Date()); //$NON-NLS-1$ //$NON-NLS-2$
+        SessionToken token2 = new SessionToken(new MetaMatrixSessionID(2), "user2"); //$NON-NLS-1$ 
         info2.setSessionToken(token2);
         results.add(info2);
 
         
         
         //SourceRequests
-        RequestInfo info1A = new RequestInfo(new RequestID("1", 1), "sql1", new Date(), new Date()); //$NON-NLS-1$
-        SessionToken token1A = new SessionToken(new MetaMatrixSessionID(1), "user1"); //$NON-NLS-1$ //$NON-NLS-2$
+        RequestInfo info1A = new RequestInfo(new RequestID("1", 1), "sql1", new Date(), new Date()); //$NON-NLS-1$ //$NON-NLS-2$
+        SessionToken token1A = new SessionToken(new MetaMatrixSessionID(1), "user1"); //$NON-NLS-1$ 
         info1A.setSessionToken(token1A);
-        info1A.setConnectorBindingUUID("connectorBinding1");
+        info1A.setConnectorBindingUUID("connectorBinding1");//$NON-NLS-1$ 
         info1A.setNodeID(1);
         results.add(info1A);
         
 
-        RequestInfo info2A = new RequestInfo(new RequestID("2", 2), "sql2", new Date(), new Date()); //$NON-NLS-1$
-        SessionToken token2A = new SessionToken(new MetaMatrixSessionID(2), "user2"); //$NON-NLS-1$ //$NON-NLS-2$
+        RequestInfo info2A = new RequestInfo(new RequestID("2", 2), "sql2", new Date(), new Date()); //$NON-NLS-1$ //$NON-NLS-2$
+        SessionToken token2A = new SessionToken(new MetaMatrixSessionID(2), "user2"); //$NON-NLS-1$ 
         info2A.setSessionToken(token2A);
-        info2A.setConnectorBindingUUID("connectorBinding2");
+        info2A.setConnectorBindingUUID("connectorBinding2");//$NON-NLS-1$ 
         info2A.setNodeID(2);
         
         results.add(info2A);
@@ -181,7 +180,7 @@
     /** 
      * @see com.metamatrix.platform.service.api.ServiceInterface#getVMID()
      */
-    public VMControllerID getVMID(){
+    public String getProcessName(){
         return null;
     }
 

Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeRuntimeStateAdminAPIHelper.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeRuntimeStateAdminAPIHelper.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeRuntimeStateAdminAPIHelper.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -37,7 +37,6 @@
 import com.metamatrix.common.config.api.Configuration;
 import com.metamatrix.common.config.api.ConnectorBindingType;
 import com.metamatrix.common.config.api.DeployedComponent;
-import com.metamatrix.common.config.api.ServiceComponentDefnID;
 import com.metamatrix.common.config.api.exceptions.ConfigurationException;
 import com.metamatrix.common.config.api.exceptions.ConfigurationLockException;
 import com.metamatrix.common.log.LogConfiguration;
@@ -53,8 +52,7 @@
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.service.api.ServiceState;
 import com.metamatrix.platform.service.api.exception.ServiceException;
-import com.metamatrix.platform.vm.controller.VMControllerID;
-import com.metamatrix.platform.vm.controller.VMStatistics;
+import com.metamatrix.platform.vm.controller.ProcessStatistics;
 import com.metamatrix.server.connector.service.ConnectorService;
 import com.metamatrix.server.query.service.QueryService;
 
@@ -207,19 +205,17 @@
     public List getServices() throws MetaMatrixComponentException {
         List results = new ArrayList();
         
-        VMControllerID vmControllerID2 = new VMControllerID(2, "2.2.2.2"); //$NON-NLS-1$
-        ServiceID serviceID2 = new ServiceID(2, vmControllerID2);
+        ServiceID serviceID2 = new ServiceID(2, "2.2.2.2", "process2"); //$NON-NLS-1$ //$NON-NLS-2$
         results.add(serviceID2);
         
-        VMControllerID vmControllerID3 = new VMControllerID(3, "3.3.3.3"); //$NON-NLS-1$
-        ServiceID serviceID3 = new ServiceID(3, vmControllerID3);
+        ServiceID serviceID3 = new ServiceID(3, "3.3.3.3", "process3");//$NON-NLS-1$ //$NON-NLS-2$
         results.add(serviceID3);
         
         
-        ServiceID serviceID2A = new ServiceID(5, vmControllerID2);
+        ServiceID serviceID2A = new ServiceID(5, "2.2.2.2", "process2"); //$NON-NLS-1$ //$NON-NLS-2$
         results.add(serviceID2A);
         
-        ServiceID serviceID3A = new ServiceID(6, vmControllerID3);
+        ServiceID serviceID3A = new ServiceID(6, "3.3.3.3", "process3");//$NON-NLS-1$ //$NON-NLS-2$
         results.add(serviceID3A);
 
         
@@ -238,15 +234,13 @@
         List hosts = new ArrayList();
         
         List processes2 = new ArrayList();   
-        VMControllerID vmControllerID1 = new VMControllerID(2, "2.2.2.2"); //$NON-NLS-1$
-        ProcessData process2 = new ProcessData(vmControllerID1, null, "2.2.2.2", new ArrayList(), "process2", "31000", true, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        ProcessData process2 = new ProcessData("2.2.2.2", "process2", "31000", null,  new ArrayList(), true, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         processes2.add(process2);        
         HostData host2 = new HostData("2.2.2.2", processes2, true, true, new Properties()); //$NON-NLS-1$
         hosts.add(host2);
 
         List processes3 = new ArrayList();        
-        VMControllerID vmControllerID3 = new VMControllerID(3, "3.3.3.3"); //$NON-NLS-1$
-        ProcessData process3 = new ProcessData(vmControllerID3, null, "3.3.3.3", new ArrayList(), "process3", "31001", true, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        ProcessData process3 = new ProcessData("3.3.3.3", "process3", "31001", null, new ArrayList(), true, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         processes3.add(process3);        
         HostData host3 = new HostData("3.3.3.3", processes3, true, true, new Properties()); //$NON-NLS-1$
         hosts.add(host3);
@@ -263,10 +257,10 @@
      * @see com.metamatrix.platform.admin.apiimpl.RuntimeStateAdminAPIHelper#getSystemState()
      * @since 4.3
      */
-    public VMStatistics getVMStatistics(VMControllerID vmID) throws MetaMatrixComponentException {
+    public ProcessStatistics getVMStatistics(String hostName, String processName) throws MetaMatrixComponentException {
     
-        if (vmID.getID() == 2) {
-            VMStatistics statistics = new VMStatistics();    
+        if (processName.equals("process2")) { //$NON-NLS-1$
+            ProcessStatistics statistics = new ProcessStatistics();    
             statistics.freeMemory = 2;
             statistics.threadCount = 2;
             statistics.socketListenerStats.sockets = 2;
@@ -274,8 +268,8 @@
             statistics.processPoolStats.queued = 2;
             
             return statistics;
-        } else if (vmID.getID() == 3) {
-            VMStatistics statistics = new VMStatistics();
+        } else if (processName.equals("process3")) { //$NON-NLS-1$
+            ProcessStatistics statistics = new ProcessStatistics();
             statistics.freeMemory = 3;
             statistics.threadCount = 3;
             statistics.socketListenerStats.sockets = 3;
@@ -313,10 +307,6 @@
         shutdownSystem = true;
     }
 
-    public void startDeployedService(ServiceComponentDefnID serviceID,
-                                     VMControllerID vmID) throws MetaMatrixComponentException {
-    }
-
     public void startHost(String host) throws MetaMatrixComponentException {
         startedHosts.add(host);
     }
@@ -332,10 +322,10 @@
         stoppedHosts.add(host);
     }
 
-    public void stopProcess(VMControllerID processID,
+    public void stopProcess(String hostName, String processName,
                             boolean stopNow) throws AuthorizationException,
                                             MetaMatrixComponentException {
-        stoppedProcesses.add(processID.toString());
+        stoppedProcesses.add(hostName+"|"+processName); //$NON-NLS-1$
     }
 
     public void stopService(ServiceID serviceID,

Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerAdminImpl.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerAdminImpl.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerAdminImpl.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -37,7 +37,6 @@
 import com.metamatrix.platform.security.api.service.SessionServiceInterface;
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.service.api.exception.ServiceException;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 import com.metamatrix.server.query.service.QueryServiceInterface;
 
 
@@ -61,7 +60,7 @@
     public FakeServerAdminImpl(ClusteredRegistryState registry) {
     	super(registry,null);
     	DQPWorkContext.setWorkContext(new DQPWorkContext());
-    	DQPWorkContext.getWorkContext().setSessionToken(new SessionToken(new MetaMatrixSessionID(1), "fakeadminuser"));
+    	DQPWorkContext.getWorkContext().setSessionToken(new SessionToken(new MetaMatrixSessionID(1), "fakeadminuser")); //$NON-NLS-1$
     }
     
     public void close() {        
@@ -90,7 +89,7 @@
     
     protected synchronized QueryServiceInterface getQueryServiceProxy() throws ServiceException {
         if (fqs == null) {
-            fqs = new FakeQueryService(new ServiceID(1, new VMControllerID(2, "dummy"))); //$NON-NLS-1$
+            fqs = new FakeQueryService(new ServiceID(1, "dummy", "2")); //$NON-NLS-1$ //$NON-NLS-2$
         }
         return fqs; 
     }

Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -45,7 +45,6 @@
 import com.metamatrix.platform.security.api.service.SessionServiceInterface;
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.util.ProductInfoConstants;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 
 public class FakeServerSessionService implements SessionServiceInterface {
 
@@ -186,7 +185,7 @@
     /** 
      * @see com.metamatrix.platform.service.api.ServiceInterface#getVMID()
      */
-    public VMControllerID getVMID() {
+    public String getProcessName() {
         return null;
     }
 

Modified: trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/TestServerMonitoringAdminImpl.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -51,7 +51,6 @@
 import com.metamatrix.platform.registry.ResourceNotBoundException;
 import com.metamatrix.platform.registry.ServiceRegistryBinding;
 import com.metamatrix.platform.service.api.ServiceID;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 
 
 /** 
@@ -100,9 +99,8 @@
      */
     public void testGetConnectorBindings() throws AdminException {
     	
-        VMControllerID vmId = new VMControllerID(3, "3.3.3.3"); //$NON-NLS-1$
         try {
-			ServiceRegistryBinding binding = admin.registry.getServiceBinding(vmId.getHostName(), vmId.toString(), new ServiceID(3,vmId));
+			ServiceRegistryBinding binding = admin.registry.getServiceBinding("3.3.3.3","3", new ServiceID(3, "3.3.3.3", "3")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 			binding.updateState(ConnectorBinding.STATE_CLOSED);
 		} catch (ResourceNotBoundException e1) {
 		}

Modified: trunk/server/src/test/java/com/metamatrix/admin/server/TestServerRuntimeStateAdminImpl.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/TestServerRuntimeStateAdminImpl.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/TestServerRuntimeStateAdminImpl.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -35,7 +35,6 @@
 import com.metamatrix.platform.registry.ResourceNotBoundException;
 import com.metamatrix.platform.registry.ServiceRegistryBinding;
 import com.metamatrix.platform.service.api.ServiceID;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 
 
 /** 
@@ -189,15 +188,17 @@
         //positive case
         assertTrue(FakeRuntimeStateAdminAPIHelper.restartedServices.isEmpty());
         
-        VMControllerID vmId = new VMControllerID(2, "2.2.2.2"); //$NON-NLS-1$
+        String host = "2.2.2.2"; //$NON-NLS-1$
+        String process = "process2"; //$NON-NLS-1$
+        
         try {
-			ServiceRegistryBinding binding = admin.registry.getServiceBinding(vmId.getHostName(), vmId.toString(), new ServiceID(2,vmId));
+			ServiceRegistryBinding binding = admin.registry.getServiceBinding(host, process, new ServiceID(2,host,process));
 			binding.updateState(ConnectorBinding.STATE_CLOSED);
 		} catch (ResourceNotBoundException e1) {
 		}
         
         admin.startConnectorBinding(AdminObject.WILDCARD + "connectorBinding2"); //$NON-NLS-1$
-        assertTrue(FakeRuntimeStateAdminAPIHelper.restartedServices.contains("ServiceID<2> VMControllerID<2>:2.2.2.2")); //$NON-NLS-1$
+        assertTrue(FakeRuntimeStateAdminAPIHelper.restartedServices.contains("Service<2|2.2.2.2|process2>")); //$NON-NLS-1$
         
         
         //failure case: unknown connectorBinding
@@ -281,7 +282,7 @@
         assertTrue(FakeRuntimeStateAdminAPIHelper.stoppedServices.isEmpty());
         
         admin.stopConnectorBinding(AdminObject.WILDCARD + "connectorBinding2", true); //$NON-NLS-1$
-        assertTrue(FakeRuntimeStateAdminAPIHelper.stoppedServices.contains("ServiceID<2> VMControllerID<2>:2.2.2.2")); //$NON-NLS-1$
+        assertTrue(FakeRuntimeStateAdminAPIHelper.stoppedServices.contains("Service<2|2.2.2.2|process2>")); //$NON-NLS-1$
         
 
         //failure case: unknown connectorBinding
@@ -336,7 +337,7 @@
         assertTrue(FakeRuntimeStateAdminAPIHelper.stoppedProcesses.isEmpty());
         
         admin.stopProcess(AdminObject.WILDCARD + "process2", true, false); //$NON-NLS-1$
-        assertTrue(FakeRuntimeStateAdminAPIHelper.stoppedProcesses.contains("VMControllerID<2>:2.2.2.2")); //$NON-NLS-1$
+        assertTrue(FakeRuntimeStateAdminAPIHelper.stoppedProcesses.contains("2.2.2.2|process2")); //$NON-NLS-1$
         
 
         //failure case: unknown process

Modified: trunk/server/src/test/java/com/metamatrix/platform/registry/FakeRegistryUtil.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/platform/registry/FakeRegistryUtil.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/platform/registry/FakeRegistryUtil.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -49,8 +49,7 @@
 import com.metamatrix.common.messaging.NoOpMessageBus;
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.service.api.ServiceState;
-import com.metamatrix.platform.vm.api.controller.VMControllerInterface;
-import com.metamatrix.platform.vm.controller.VMControllerID;
+import com.metamatrix.platform.vm.api.controller.ProcessManagement;
 import com.metamatrix.server.query.service.QueryService;
 
 @CacheListener
@@ -71,31 +70,31 @@
 		registry.addHost(host1);
 		registry.addHost(host2);
 		
-		VMRegistryBinding vmBinding2  = buildVMRegistryBinding("2.2.2.2", 2, "process2");             //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vmBinding2  = buildVMRegistryBinding("2.2.2.2", "process2");             //$NON-NLS-1$ //$NON-NLS-2$ 
         ServiceRegistryBinding serviceBinding2 = buildServiceRegistryBinding("connectorBinding2", 2, vmBinding2, "Cache","psc2");  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		
-        registry.addVM(vmBinding2.getHostName(), vmBinding2.getVMControllerID().toString(), vmBinding2);
-        registry.addServiceBinding(vmBinding2.getHostName(), vmBinding2.getVMControllerID().toString(), serviceBinding2);
+        registry.addProcess(vmBinding2.getHostName(), vmBinding2.getProcessName(), vmBinding2);
+        registry.addServiceBinding(vmBinding2.getHostName(), vmBinding2.getProcessName(), serviceBinding2);
 		
 		
-		VMRegistryBinding vmBinding3  = buildVMRegistryBinding("3.3.3.3", 3, "process3");             //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vmBinding3  = buildVMRegistryBinding("3.3.3.3", "process3");             //$NON-NLS-1$ //$NON-NLS-2$ 
         ServiceRegistryBinding serviceBinding3 = buildServiceRegistryBinding("connectorBinding3", 3, vmBinding3, "Cache", "psc3");  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		
-        registry.addVM(vmBinding3.getHostName(), vmBinding3.getVMControllerID().toString(), vmBinding3);
-        registry.addServiceBinding(vmBinding3.getHostName(), vmBinding3.getVMControllerID().toString(), serviceBinding3);
+        registry.addProcess(vmBinding3.getHostName(), vmBinding3.getProcessName(), vmBinding3);
+        registry.addServiceBinding(vmBinding3.getHostName(), vmBinding3.getProcessName(), serviceBinding3);
 		
 		
 		// dqps
-		ServiceID sid1 = new ServiceID(5, vmBinding2.getVMControllerID());
-		registry.addServiceBinding(vmBinding2.getHostName(), vmBinding2.getVMControllerID().toString(), new ServiceRegistryBinding(sid1, new FakeQueryService(sid1), QueryService.SERVICE_NAME,
+		ServiceID sid1 = new ServiceID(5, vmBinding2.getHostName(),vmBinding2.getProcessName());
+		registry.addServiceBinding(vmBinding2.getHostName(), vmBinding2.getProcessName(), new ServiceRegistryBinding(sid1, new FakeQueryService(sid1), QueryService.SERVICE_NAME,
                                                                     "dqp2", "QueryService", //$NON-NLS-1$ //$NON-NLS-2$
                                                                     "dqp2", "2.2.2.2",(DeployedComponent)new FakeConfiguration().deployedComponents.get(4), null, //$NON-NLS-1$ //$NON-NLS-2$ 
                                                                     ServiceState.STATE_CLOSED,
                                                                     new Date(),  
                                                                     false, new NoOpMessageBus()));
 
-		ServiceID sid2 = new ServiceID(6, vmBinding3.getVMControllerID());	
-		registry.addServiceBinding(vmBinding3.getHostName(), vmBinding3.getVMControllerID().toString(), new ServiceRegistryBinding(sid2, new FakeQueryService(sid2), QueryService.SERVICE_NAME,
+		ServiceID sid2 = new ServiceID(6, vmBinding3.getHostName(),vmBinding3.getProcessName());	
+		registry.addServiceBinding(vmBinding3.getHostName(), vmBinding3.getProcessName(), new ServiceRegistryBinding(sid2, new FakeQueryService(sid2), QueryService.SERVICE_NAME,
                 "dqp3", "QueryService", //$NON-NLS-1$ //$NON-NLS-2$
                 "dqp3", "3.3.3.3", (DeployedComponent)new FakeConfiguration().deployedComponents.get(5), null, //$NON-NLS-1$ //$NON-NLS-2$ 
                 ServiceState.STATE_CLOSED,
@@ -107,22 +106,21 @@
 	}
 	
 	
-	public static VMRegistryBinding buildVMRegistryBinding(String hostName, int vmID, String process) throws Exception {
-	    VMControllerID vmID1 = new VMControllerID(vmID, hostName);             
+	public static ProcessRegistryBinding buildVMRegistryBinding(String hostName, String processName) throws Exception {
 	    HostID hostID1 = new HostID(hostName); 
-	    VMComponentDefnID defnID1 = new VMComponentDefnID(Configuration.NEXT_STARTUP_ID, hostID1, process);  
+	    VMComponentDefnID defnID1 = new VMComponentDefnID(Configuration.NEXT_STARTUP_ID, hostID1, processName);  
 	    VMComponentDefn defn1 = new BasicVMComponentDefn(Configuration.NEXT_STARTUP_ID, hostID1, defnID1, new ComponentTypeID(VMComponentDefnType.COMPONENT_TYPE_NAME)); 
-	    VMControllerInterface vmInterface1 = Mockito.mock(VMControllerInterface.class);
+	    ProcessManagement vmInterface1 = Mockito.mock(ProcessManagement.class);
 		Mockito.stub(vmInterface1.getAddress()).toReturn(InetAddress.getLocalHost());
 
 	    
-	    VMRegistryBinding binding = new VMRegistryBinding(hostName, vmID1, defn1, vmInterface1, new NoOpMessageBus());
+	    ProcessRegistryBinding binding = new ProcessRegistryBinding(hostName, processName, defn1, vmInterface1, new NoOpMessageBus());
 	    binding.setAlive(true);
 	    return binding;
 	}
 
-	public static ServiceRegistryBinding buildServiceRegistryBinding(String name, int id, VMRegistryBinding vm, String type, String psc) {
-		ServiceID sid = new ServiceID(id, vm.getVMControllerID());	
+	public static ServiceRegistryBinding buildServiceRegistryBinding(String name, int id, ProcessRegistryBinding vm, String type, String psc) {
+		ServiceID sid = new ServiceID(id, vm.getHostName(), vm.getProcessName());	
 		
         DeployedComponentID deployedComponentID1 = new DeployedComponentID(name, Configuration.NEXT_STARTUP_ID, vm.getDeployedComponent().getHostID(), (VMComponentDefnID)vm.getDeployedComponent().getID());
 		ConnectorBindingID connectorBindingID1 = new ConnectorBindingID(Configuration.NEXT_STARTUP_ID, name); 

Modified: trunk/server/src/test/java/com/metamatrix/platform/registry/TestClusteredRegistryState.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/platform/registry/TestClusteredRegistryState.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/platform/registry/TestClusteredRegistryState.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -43,8 +43,7 @@
 import com.metamatrix.platform.registry.ClusteredRegistryState.CacheNodeNotFoundException;
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.service.api.ServiceState;
-import com.metamatrix.platform.vm.api.controller.VMControllerInterface;
-import com.metamatrix.platform.vm.controller.VMControllerID;
+import com.metamatrix.platform.vm.api.controller.ProcessManagement;
 
 public class TestClusteredRegistryState extends TestCase {
 	CacheFactory factory = new FakeCacheFactory();
@@ -62,13 +61,13 @@
 		state.addHost(host1);
 		state.addHost(host2);
 		
-		VMRegistryBinding vm1 = buildVMRegistryBinding("host-1", 1); //$NON-NLS-1$
-		VMRegistryBinding vm2 = buildVMRegistryBinding("host-1", 2); //$NON-NLS-1$
-		VMRegistryBinding vm3 = buildVMRegistryBinding("host-1", 3); //$NON-NLS-1$
+		ProcessRegistryBinding vm1 = buildVMRegistryBinding("host-1", "1"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm2 = buildVMRegistryBinding("host-1", "2"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm3 = buildVMRegistryBinding("host-1", "3"); //$NON-NLS-1$ //$NON-NLS-2$
 
-		state.addVM("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
 		
 		assertEquals(rootNode.getChildren().size(), 2);
 		assertNotNull(rootNode.getChild(key("host-1"))); //$NON-NLS-1$
@@ -88,17 +87,17 @@
 		state.addHost(host1);
 		state.addHost(host2);
 		
-		VMRegistryBinding vm1 = buildVMRegistryBinding("host-1", 1); //$NON-NLS-1$
-		VMRegistryBinding vm2 = buildVMRegistryBinding("host-1", 2); //$NON-NLS-1$
-		VMRegistryBinding vm3 = buildVMRegistryBinding("host-1", 3); //$NON-NLS-1$
+		ProcessRegistryBinding vm1 = buildVMRegistryBinding("host-1", "1"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm2 = buildVMRegistryBinding("host-1", "2"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm3 = buildVMRegistryBinding("host-1", "3"); //$NON-NLS-1$ //$NON-NLS-2$
 		
-		state.addVM("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
 		
 		assertEquals(rootNode.getChildren().size(), 2);
 		
-		state.removeVM("host-1", "vm-1"); //$NON-NLS-1$ //$NON-NLS-2$
+		state.removeProcess("host-1", "vm-1"); //$NON-NLS-1$ //$NON-NLS-2$
 		
 		assertNull(rootNode.getChild(key("host-1")).getChild(key("vm-1"))); //$NON-NLS-1$ //$NON-NLS-2$
 		assertNotNull(rootNode.getChild(key("host-1")).getChild(key("vm-2"))); //$NON-NLS-1$ //$NON-NLS-2$
@@ -113,20 +112,20 @@
 		state.addHost(host1);
 		state.addHost(host2);
 		
-		VMRegistryBinding vm1 = buildVMRegistryBinding("host-1", 1); //$NON-NLS-1$
-		VMRegistryBinding vm2 = buildVMRegistryBinding("host-1", 2); //$NON-NLS-1$
-		VMRegistryBinding vm3 = buildVMRegistryBinding("host-1", 3); //$NON-NLS-1$
+		ProcessRegistryBinding vm1 = buildVMRegistryBinding("host-1", "1"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm2 = buildVMRegistryBinding("host-1", "2"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm3 = buildVMRegistryBinding("host-1", "3"); //$NON-NLS-1$ //$NON-NLS-2$
 		
-		state.addVM("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
 		
 		assertEquals(0, state.getVMs("unknown").size()); //$NON-NLS-1$
 		assertEquals(2, state.getVMs("host-1").size()); //$NON-NLS-1$
 		assertEquals(1, state.getVMs("host-2").size()); //$NON-NLS-1$
 		assertEquals(3, state.getVMs(null).size());
 				
-		assertEquals(vm2, state.getVM("host-1", "vm-2")); //$NON-NLS-1$ //$NON-NLS-2$
+		assertEquals(vm2, state.getProcessBinding("host-1", "vm-2")); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 
 	public void testHosts() throws Exception {
@@ -137,13 +136,13 @@
 		state.addHost(host1);
 		state.addHost(host2);
 		
-		VMRegistryBinding vm1 = buildVMRegistryBinding("host-1", 1); //$NON-NLS-1$
-		VMRegistryBinding vm2 = buildVMRegistryBinding("host-1", 2); //$NON-NLS-1$
-		VMRegistryBinding vm3 = buildVMRegistryBinding("host-1", 3); //$NON-NLS-1$
+		ProcessRegistryBinding vm1 = buildVMRegistryBinding("host-1", "1"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm2 = buildVMRegistryBinding("host-1", "2"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm3 = buildVMRegistryBinding("host-1", "3"); //$NON-NLS-1$ //$NON-NLS-2$
 		
-		state.addVM("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
 
 		assertEquals(2, state.getHosts().size());
 		
@@ -168,20 +167,20 @@
 		state.addHost(host1);
 		state.addHost(host2);
 		
-		VMRegistryBinding vm1 = buildVMRegistryBinding("host-1", 1); //$NON-NLS-1$
-		VMRegistryBinding vm2 = buildVMRegistryBinding("host-1", 2); //$NON-NLS-1$
-		VMRegistryBinding vm3 = buildVMRegistryBinding("host-1", 3); //$NON-NLS-1$
+		ProcessRegistryBinding vm1 = buildVMRegistryBinding("host-1", "1"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm2 = buildVMRegistryBinding("host-1", "2"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm3 = buildVMRegistryBinding("host-1", "3"); //$NON-NLS-1$ //$NON-NLS-2$
 		
-		state.addVM("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
 		
-		ServiceRegistryBinding s1 = buildServiceRegistryBinding(1, vm1.getVMControllerID(), "Query"); //$NON-NLS-1$
-		ServiceRegistryBinding s2 = buildServiceRegistryBinding(2, vm2.getVMControllerID(), "Query"); //$NON-NLS-1$
-		ServiceRegistryBinding s3 = buildServiceRegistryBinding(3, vm1.getVMControllerID(), "Index"); //$NON-NLS-1$
-		ServiceRegistryBinding s4 = buildServiceRegistryBinding(4, vm3.getVMControllerID(), "Query"); //$NON-NLS-1$
-		ServiceRegistryBinding s5 = buildServiceRegistryBinding(5, vm3.getVMControllerID(), "Session"); //$NON-NLS-1$
-		ServiceRegistryBinding s6 = buildServiceRegistryBinding(6, vm3.getVMControllerID(), "Auth"); //$NON-NLS-1$
+		ServiceRegistryBinding s1 = buildServiceRegistryBinding(1, vm1, "Query"); //$NON-NLS-1$
+		ServiceRegistryBinding s2 = buildServiceRegistryBinding(2, vm2, "Query"); //$NON-NLS-1$
+		ServiceRegistryBinding s3 = buildServiceRegistryBinding(3, vm1, "Index"); //$NON-NLS-1$
+		ServiceRegistryBinding s4 = buildServiceRegistryBinding(4, vm3, "Query"); //$NON-NLS-1$
+		ServiceRegistryBinding s5 = buildServiceRegistryBinding(5, vm3, "Session"); //$NON-NLS-1$
+		ServiceRegistryBinding s6 = buildServiceRegistryBinding(6, vm3, "Auth"); //$NON-NLS-1$
 		
 		state.addServiceBinding("host-1", "vm-1", s1); //$NON-NLS-1$ //$NON-NLS-2$
 		state.addServiceBinding("host-1", "vm-1", s3); //$NON-NLS-1$ //$NON-NLS-2$
@@ -225,20 +224,20 @@
 		state.addHost(host1);
 		state.addHost(host2);
 		
-		VMRegistryBinding vm1 = buildVMRegistryBinding("host-1", 1); //$NON-NLS-1$
-		VMRegistryBinding vm2 = buildVMRegistryBinding("host-1", 2); //$NON-NLS-1$
-		VMRegistryBinding vm3 = buildVMRegistryBinding("host-1", 3); //$NON-NLS-1$
+		ProcessRegistryBinding vm1 = buildVMRegistryBinding("host-1", "1"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm2 = buildVMRegistryBinding("host-1", "2"); //$NON-NLS-1$ //$NON-NLS-2$
+		ProcessRegistryBinding vm3 = buildVMRegistryBinding("host-1", "3"); //$NON-NLS-1$ //$NON-NLS-2$
 		
-		state.addVM("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
-		state.addVM("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-1", vm1); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-1", "vm-2", vm2); //$NON-NLS-1$ //$NON-NLS-2$
+		state.addProcess("host-2", "vm-1", vm3); //$NON-NLS-1$ //$NON-NLS-2$
 		
-		ServiceRegistryBinding s1 = buildServiceRegistryBinding(1, vm1.getVMControllerID(), "Query"); //$NON-NLS-1$
-		ServiceRegistryBinding s2 = buildServiceRegistryBinding(2, vm2.getVMControllerID(), "Query"); //$NON-NLS-1$
-		ServiceRegistryBinding s3 = buildServiceRegistryBinding(3, vm1.getVMControllerID(), "Index"); //$NON-NLS-1$
-		ServiceRegistryBinding s4 = buildServiceRegistryBinding(4, vm3.getVMControllerID(), "Query"); //$NON-NLS-1$
-		ServiceRegistryBinding s5 = buildServiceRegistryBinding(5, vm3.getVMControllerID(), "Session"); //$NON-NLS-1$
-		ServiceRegistryBinding s6 = buildServiceRegistryBinding(6, vm3.getVMControllerID(), "Auth"); //$NON-NLS-1$
+		ServiceRegistryBinding s1 = buildServiceRegistryBinding(1, vm1, "Query"); //$NON-NLS-1$
+		ServiceRegistryBinding s2 = buildServiceRegistryBinding(2, vm2, "Query"); //$NON-NLS-1$
+		ServiceRegistryBinding s3 = buildServiceRegistryBinding(3, vm1, "Index"); //$NON-NLS-1$
+		ServiceRegistryBinding s4 = buildServiceRegistryBinding(4, vm3, "Query"); //$NON-NLS-1$
+		ServiceRegistryBinding s5 = buildServiceRegistryBinding(5, vm3, "Session"); //$NON-NLS-1$
+		ServiceRegistryBinding s6 = buildServiceRegistryBinding(6, vm3, "Auth"); //$NON-NLS-1$
 		
 		state.addServiceBinding("host-1", "vm-1", s1); //$NON-NLS-1$ //$NON-NLS-2$
 		state.addServiceBinding("host-1", "vm-1", s3); //$NON-NLS-1$ //$NON-NLS-2$
@@ -291,21 +290,20 @@
 	}
 	
 	
-	static VMRegistryBinding buildVMRegistryBinding(String hostName, int vmID) {
-	    VMControllerID vmID1 = new VMControllerID(vmID, hostName);             
+	static ProcessRegistryBinding buildVMRegistryBinding(String hostName, String vmID) {
 	    HostID hostID1 = new HostID(hostName); 
 	    VMComponentDefnID defnID1 = new VMComponentDefnID(Configuration.NEXT_STARTUP_ID, hostID1, "process1");  //$NON-NLS-1$
 	    VMComponentDefn defn1 = new BasicVMComponentDefn(Configuration.NEXT_STARTUP_ID, hostID1, defnID1, new ComponentTypeID(VMComponentDefnType.COMPONENT_TYPE_NAME)); 
-	    VMControllerInterface vmInterface1 = SimpleMock.createSimpleMock(VMControllerInterface.class);
-	    VMRegistryBinding binding =  new VMRegistryBinding(hostName, vmID1, defn1,vmInterface1, new NoOpMessageBus());
+	    ProcessManagement vmInterface1 = SimpleMock.createSimpleMock(ProcessManagement.class);
+	    ProcessRegistryBinding binding =  new ProcessRegistryBinding(hostName, vmID, defn1,vmInterface1, new NoOpMessageBus());
 	    binding.setAlive(true);
 	    return binding;
 	}
 
-	static ServiceRegistryBinding buildServiceRegistryBinding(int id, VMControllerID vmId, String type) {
-		ServiceID sid = new ServiceID(id, vmId);
+	static ServiceRegistryBinding buildServiceRegistryBinding(int id, ProcessRegistryBinding process, String type) {
+		ServiceID sid = new ServiceID(id, process.getHostName(), process.getProcessName());
 		//ServiceInterface si = SimpleMock.createSimpleMock(ServiceInterface.class);
-	    return new ServiceRegistryBinding(sid, null, type,"instance-"+id, null,"deployed-"+id, vmId.getHostName(), null, null, ServiceState.STATE_OPEN,new Date(), false, new NoOpMessageBus());	 //$NON-NLS-1$ //$NON-NLS-2$
+	    return new ServiceRegistryBinding(sid, null, type,"instance-"+id, null,"deployed-"+id, process.getHostName(), null, null, ServiceState.STATE_OPEN,new Date(), false, new NoOpMessageBus());	 //$NON-NLS-1$ //$NON-NLS-2$
 	}
 	
 	static HostControllerRegistryBinding buildHostRegistryBinding(String name) {

Modified: trunk/server/src/test/java/com/metamatrix/platform/registry/TestServiceRegistryBinding.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/platform/registry/TestServiceRegistryBinding.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/platform/registry/TestServiceRegistryBinding.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -76,8 +76,8 @@
 		System.setProperty(MessageBusConstants.MESSAGE_BUS_TYPE, MessageBusConstants.TYPE_NOOP);
 		FakeServiceImpl service = new FakeServiceImpl();
 		
-    	VMRegistryBinding vmBinding2  = FakeRegistryUtil.buildVMRegistryBinding("2.2.2.2", 2, "process2");             //$NON-NLS-1$ //$NON-NLS-2$
-    	ServiceID sid1 = new ServiceID(5, vmBinding2.getVMControllerID());
+    	ProcessRegistryBinding vmBinding2  = FakeRegistryUtil.buildVMRegistryBinding("2.2.2.2", "process2");             //$NON-NLS-1$ //$NON-NLS-2$ 
+    	ServiceID sid1 = new ServiceID(5, vmBinding2.getHostName(), vmBinding2.getProcessName());
     	ServiceRegistryBinding binding = new ServiceRegistryBinding(sid1, service, QueryService.SERVICE_NAME,
                                                                     "dqp2", "QueryService", //$NON-NLS-1$ //$NON-NLS-2$
                                                                     "dqp2", "2.2.2.2",(DeployedComponent)new FakeConfiguration().deployedComponents.get(4), null, //$NON-NLS-1$ //$NON-NLS-2$ 

Modified: trunk/server/src/test/java/com/metamatrix/platform/service/controller/FakeService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/platform/service/controller/FakeService.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/platform/service/controller/FakeService.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -32,7 +32,6 @@
 import com.metamatrix.common.config.api.DeployedComponentID;
 import com.metamatrix.common.queue.WorkerPoolStats;
 import com.metamatrix.platform.service.api.ServiceID;
-import com.metamatrix.platform.vm.controller.VMControllerID;
 
 public class FakeService implements FakeServiceInterface {
 
@@ -71,7 +70,7 @@
     public Date getStateChangeTime() {
         return null;
     }
-    public VMControllerID getVMID() {
+    public String getProcessName() {
         return null;
     }
     public boolean isAlive() {

Modified: trunk/server/src/test/java/com/metamatrix/platform/service/proxy/TestProxies.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/platform/service/proxy/TestProxies.java	2009-03-03 23:48:40 UTC (rev 536)
+++ trunk/server/src/test/java/com/metamatrix/platform/service/proxy/TestProxies.java	2009-03-04 23:29:07 UTC (rev 537)
@@ -36,7 +36,7 @@
 import com.metamatrix.common.messaging.NoOpMessageBus;
 import com.metamatrix.platform.registry.FakeRegistryUtil;
 import com.metamatrix.platform.registry.ServiceRegistryBinding;
-import com.metamatrix.platform.registry.VMRegistryBinding;
+import com.metamatrix.platform.registry.ProcessRegistryBinding;
 import com.metamatrix.platform.service.api.ServiceID;
 import com.metamatrix.platform.service.api.ServiceState;
 import com.metamatrix.platform.service.api.exception.ServiceNotFoundException;
@@ -76,8 +76,6 @@
 		@Override
 		public void updateServices(List<ServiceRegistryBinding> localServices,
 				List<ServiceRegistryBinding> remoteServices) {
-			// rameshTODO Auto-generated method stub
-			
 		}
     }
 
@@ -92,8 +90,8 @@
         final List serviceBindings = new ArrayList();
         
         for (int i = 0; i < fakeServices.length; i++) {
-        	VMRegistryBinding vmBinding2  = FakeRegistryUtil.buildVMRegistryBinding("2.2.2.2", 2, "process2");             //$NON-NLS-1$ //$NON-NLS-2$
-        	ServiceID sid1 = new ServiceID(i, vmBinding2.getVMControllerID());
+        	ProcessRegistryBinding vmBinding2  = FakeRegistryUtil.buildVMRegistryBinding("2.2.2.2", "process2");             //$NON-NLS-1$ //$NON-NLS-2$ 
+        	ServiceID sid1 = new ServiceID(i, vmBinding2.getHostName(), vmBinding2.getProcessName());
         	ServiceRegistryBinding binding = new ServiceRegistryBinding(sid1, fakeServices[i], QueryService.SERVICE_NAME,
                                                                         "dqp2", "QueryService", //$NON-NLS-1$ //$NON-NLS-2$
                                                                         "dqp2", "2.2.2.2",(DeployedComponent)new FakeConfiguration().deployedComponents.get(4), null, //$NON-NLS-1$ //$NON-NLS-2$ 
@@ -146,8 +144,8 @@
         
         for (int i = 0; i < fakeServices.length; i++) {
         	
-        	VMRegistryBinding vmBinding2  = FakeRegistryUtil.buildVMRegistryBinding("2.2.2.2", 2, "process2");             //$NON-NLS-1$ //$NON-NLS-2$
-        	ServiceID sid1 = new ServiceID(i, vmBinding2.getVMControllerID());
+        	ProcessRegistryBinding vmBinding2  = FakeRegistryUtil.buildVMRegistryBinding("2.2.2.2", "process2");             //$NON-NLS-1$ //$NON-NLS-2$ 
+        	ServiceID sid1 = new ServiceID(i, vmBinding2.getHostName(), vmBinding2.getProcessName());
         	ServiceRegistryBinding binding = new ServiceRegistryBinding(sid1, fakeServices[i], QueryService.SERVICE_NAME,
                                                                         "dqp2", "QueryService", //$NON-NLS-1$ //$NON-NLS-2$
                                                                         "dqp2", "2.2.2.2",(DeployedComponent)new FakeConfiguration().deployedComponents.get(4), null, //$NON-NLS-1$ //$NON-NLS-2$ 




More information about the teiid-commits mailing list