You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/08/12 17:23:08 UTC

svn commit: r232310 [60/92] - in /beehive/trunk/controls/test: common/ infra/gtlf/ infra/gtlf/xsl/ infra/mantis/ infra/tch/ infra/tch/messages/ infra/tch/runtime/ infra/tch/schema/ perf/ perf/bin/ perf/cases/ perf/ctlsrc/org/apache/beehive/controls/per...

Modified: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessRegistry.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessRegistry.java?rev=232310&r1=232309&r2=232310&view=diff
==============================================================================
--- beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessRegistry.java (original)
+++ beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessRegistry.java Fri Aug 12 08:12:28 2005
@@ -1,507 +1,507 @@
-package org.apache.beehive.test.tools.tch.core.process;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.apache.tools.ant.BuildException;
-
-import org.apache.beehive.test.tools.tch.core.PropertyNames;
-import org.apache.beehive.test.tools.tch.core.configuration.InvalidationManager;
-import org.apache.beehive.test.tools.tch.core.configuration.MinimalConfigurationInfo;
-import org.apache.beehive.test.tools.tch.core.configuration.NonfatalValidationException;
-import org.apache.beehive.test.tools.tch.core.configuration.ProcessConfiguration;
-import org.apache.beehive.test.tools.tch.core.configuration.ProcessConfigurationManager;
-import org.apache.beehive.test.tools.tch.util.CaseInsensitiveStringKey;
-import org.apache.beehive.test.tools.tch.util.TchUtils;
-
-public class ProcessRegistry
-{
-
-  public static final String IMPLICIT_PROCESS_NAME =
-    Process.IMPLICIT_PROCESS_NAME;
-
-  private static ProcessRegistry reg = null;
-
-  // String (name) -> String (value)
-  private Map activeProcessesAttributes = null;
-
-  // Maps ProcessOverrideKey(process name, (testname or testunit name)) -> ProcessOverride
-  private Map processOverrideMap = new HashMap();
-
-  private Map processes = new HashMap(); //String (name) ->  Entry
-
-  private ProcessRegistry()
-  {
-  }
-
-  public synchronized static ProcessRegistry getRegistry()
-  {
-    if (reg == null)
-      reg = new ProcessRegistry();
-    return reg;
-  }
-
-  public static Map getAttributesForActiveProcessesWithPrefix()
-  {
-    return getRegistry().getAttributesForActiveProcessesWithPrefixInteral();
-  }
-
-  public static Map getAttributesForActiveProcesses()
-  {
-    return getRegistry().getAttributesForActiveProcessesInternal();
-  }
-
-  public synchronized void addProcessEntry(
-    Process p,
-    ConfiguredProcessType cpt)
-  {
-    addProcessEntry(p.getName(), new ProcessRegistry.Entry(p, cpt));
-  }
-
-  public void setImplicitProcessEntry(Process p)
-  {
-    Entry entry = new ProcessRegistry.Entry(p, p.getConfiguredProcess());
-    addProcessEntry(IMPLICIT_PROCESS_NAME, entry);
-    addProcessEntry(p.getName(), entry);
-  }
-
-  public ProcessRegistry.Entry getProcessEntry(String name)
-    throws NonfatalValidationException
-  {
-    ProcessRegistry.Entry entry =
-      (ProcessRegistry.Entry)processes.get(new CaseInsensitiveStringKey(name));
-    if (entry != null)
-      return entry;
-    else
-    {
-      throw new NonfatalValidationException(
-        ErrorMessageConstants.NO_PROCESS_REGISTERED_ERROR_CODE,
-        ErrorMessageConstants.PROCESS,
-        name);
-    }
-  }
-
-  /**
-   * Creates a ProcessRegistry.Entry on-the-fly containing the specified process
-   * along with any overrides that are in effect for the current test. Basically
-   * this will get the existing ProcessRegistry.Entry for that process name, and
-   * create a copy of it and clone the process with the appropriate overrides.
-   * This seems safe to do as long as the entry will not be changed by the caller.
-   * @param name Name of the process
-   * @param logicalTestName Fully qualified test name or test-unit name
-   */
-  public ProcessRegistry.Entry getProcessEntryForTest(
-    String name,
-    String logicalTestName)
-    throws NonfatalValidationException
-  {
-    ProcessOverride override = getProcessOverride(name, logicalTestName);
-    //    System.out.println(
-    //      "Got override for process: "
-    //        + name
-    //        + " testname: "
-    //        + logicalTestName
-    //        + " : "
-    //        + override);
-    Map local_override_map = getProcessOverrideMapForTest(logicalTestName);
-    // This will be used to map (process name -> process handler) for all locally
-    // overridden processes
-    HashMap local_ph_map = new HashMap();
-    // First we actually need to create a map (process name -> process override)
-    // for all processes that have local overrides
-    for (Iterator iter = local_override_map.keySet().iterator();
-      iter.hasNext();
-      )
-    {
-      String processname = (String)iter.next();
-      ProcessRegistry.Entry processentry =
-        (ProcessRegistry.Entry)processes.get(
-          new CaseInsensitiveStringKey(processname));
-      if (processentry != null)
-      {
-        ProcessOverride processoverride =
-          (ProcessOverride)local_override_map.get(processname);
-        processentry = (Entry)processentry.cloneWithOverride(processoverride);
-        local_ph_map.put(processname, processentry.getProcessHandler());
-      }
-    }
-
-    ProcessRegistry.Entry entry =
-      (ProcessRegistry.Entry)processes.get(new CaseInsensitiveStringKey(name));
-    if (entry != null)
-    {
-      if (override != null)
-      {
-        // Note: This entry is created on the fly. It is not stored on the processes map
-        // we just want to clone the existing entry and reset the proces/process handler with
-        // a cloned process
-        // NOTE: We need to pass in ALL overrides which correspond to the current test since
-        // the ProcessHandler for the admin servers, nested processes, etc. may need to be
-        // explicitly set if it is overridden as well
-        entry = (Entry)entry.cloneWithOverride(override, local_ph_map);
-      }
-      return entry;
-    }
-    else
-    {
-      throw new NonfatalValidationException(
-        ErrorMessageConstants.NO_PROCESS_REGISTERED_ERROR_CODE,
-        ErrorMessageConstants.PROCESS,
-        name);
-    }
-  }
-
-  public ProcessRegistry.Entry getProcessEntryAssumeValidated(String name)
-  {
-    try
-    {
-      return getProcessEntry(name);
-    }
-    catch (NonfatalValidationException ex)
-    {
-      throw new BuildException(ex);
-    }
-  }
-
-  private Map getAttributesForActiveProcessesWithPrefixInteral()
-  {
-    // cache this also?
-    Map rtn = new HashMap();
-    for (Iterator iter =
-      getAttributesForActiveProcessesInternal().entrySet().iterator();
-      iter.hasNext();
-      )
-    {
-      Map.Entry entry = (Map.Entry)iter.next();
-      rtn.put(
-        PropertyNames.TCH_PREFIX
-          + PropertyNames.TCH_PROCESS_CONFIGURED_PREFIX
-          + entry.getKey(),
-        entry.getValue());
-    }
-    return rtn;
-  }
-
-  private synchronized Map getAttributesForActiveProcessesInternal()
-  {
-    if (activeProcessesAttributes == null)
-    {
-      activeProcessesAttributes = new TreeMap();
-      for (Iterator iter = processes.entrySet().iterator(); iter.hasNext();)
-      {
-        Map.Entry entry = (Map.Entry)iter.next();
-        String name = String.valueOf(entry.getKey()).toLowerCase();
-        Entry processEntry = (Entry)entry.getValue();
-        if (processEntry.getProcess().isActive())
-          activeProcessesAttributes.putAll(
-            TchUtils.runAllNoArgGetters(
-              processEntry.getProcessHandler(),
-              name + PropertyNames.PROP_NAME_DELIMITER,
-              true,
-              true));
-      }
-
-      activeProcessesAttributes =
-        Collections.unmodifiableMap(activeProcessesAttributes);
-    }
-    return activeProcessesAttributes;
-  }
-
-  public Entry getImplicitProcessEntry()
-  {
-    Entry entry = null;
-    try
-    {
-      entry = getProcessEntry(IMPLICIT_PROCESS_NAME);
-    }
-    catch (NonfatalValidationException ex)
-    {
-      // swallow
-    }
-    return entry;
-  }
-
-  // convenience method
-  public boolean hasImplicitProcessEntry()
-  {
-    return getImplicitProcessEntry() != null;
-  }
-
-  public String getImplicitProcessName()
-  {
-    Entry entry = getImplicitProcessEntry();
-    if (entry != null)
-      return entry.getProcess().getName();
-    else
-      return null;
-  }
-
-  public Iterator getEntryIterator()
-  {
-    return new HashSet(processes.values()).iterator();
-  }
-
-  public void cleanUpProcessManagers()
-  {
-    for (Iterator iter = getEntryIterator(); iter.hasNext();)
-    {
-      Entry entry = (Entry)iter.next();
-      if (entry.getProcess().isActive())
-      {
-        System.out.println("  ... process: " + entry.getProcess().getName());
-        entry.getProcessManager().cleanup(entry.getProcess());
-      }
-    }
-  }
-
-  public String toString()
-  {
-    return processes.toString();
-  }
-
-  public String dump()
-  {
-    StringBuffer ret = new StringBuffer();
-    for (Iterator iter = processes.entrySet().iterator(); iter.hasNext();)
-    {
-      Map.Entry entry = (Map.Entry)iter.next();
-      Process process = ((Entry)entry.getValue()).getProcess();
-      ret.append(process.dump());
-      ret.append("\n\n");
-    }
-    return ret.toString();
-  }
-
-  private synchronized void addProcessEntry(String name, Entry inEntry)
-  {
-    Object key = new CaseInsensitiveStringKey(name);
-    if (processes.containsKey(key))
-    {
-      //VALIDATION ERROR
-      InvalidationManager.addFatalInvalidation(
-        new NonfatalValidationException(
-          ErrorMessageConstants.PROCESS_ALREADY_REGISTERED_ERROR_CODE,
-          ErrorMessageConstants.PROCESS,
-          name));
-    }
-    else
-    {
-      // check if we already have an entry with this process object
-      // if that is the case, map the new entry name to that
-      Entry entryForSameProcess = getSameProcessEntry(inEntry);
-      if (entryForSameProcess != null)
-      {
-        processes.put(key, entryForSameProcess);
-      }
-      else
-        processes.put(key, inEntry);
-    }
-  }
-
-  private Entry getSameProcessEntry(Entry in)
-  {
-    for (Iterator iter = getEntryIterator(); iter.hasNext();)
-    {
-      Entry entry = (Entry)iter.next();
-      if (entry.getProcess() == in.getProcess())
-        return entry;
-    }
-    return null;
-  }
-
-  /**
-   * Add a new ProcessOverride to the map
-   * @param processName name of the process
-   * @param testName fully qualified test name
-   * @param processOverride the process override object to store
-   */
-  public void addProcessOverride(
-    String processName,
-    String testName,
-    ProcessOverride processOverride)
-  {
-    processOverrideMap.put(
-      new ProcessOverrideKey(processName, testName),
-      processOverride);
-  }
-
-  /**
-   * Gets an existing ProcessOverride for the specified process, test combination
-   * @param processName
-   * @param testName
-   * @return
-   */
-  public ProcessOverride getProcessOverride(
-    String processName,
-    String testName)
-  {
-    return (ProcessOverride)processOverrideMap.get(
-      new ProcessOverrideKey(processName, testName));
-  }
-
-  /**
-   * Gets a map (process name -> process override) for all overrides
-   * which are in effect for the specified test
-   */
-  public Map getProcessOverrideMapForTest(String testName)
-  {
-    HashMap overridemap = new HashMap();
-    for (Iterator iter = processOverrideMap.keySet().iterator();
-      iter.hasNext();
-      )
-    {
-      ProcessOverrideKey key = (ProcessOverrideKey)iter.next();
-      if (key.getTestName().equals(testName))
-      {
-        overridemap.put(key.getProcessName(), processOverrideMap.get(key));
-      }
-    }
-    return overridemap;
-  }
-
-  /**
-   * Entry is currently and should remain read-only. There are no setters and nothing should
-   * need to modify an Entry outside of ProcessRegistry.
-   */
-  public class Entry implements CloneOverrideable
-  {
-    private Process process = null;
-    private ConfiguredProcessType configProcessType = null;
-    private ProcessHandler processHandler = null;
-
-    public Entry(Process inProcess, ConfiguredProcessType inCPT)
-    {
-      process = inProcess;
-      configProcessType = inCPT;
-      getProcessHandlerAndConfigure();
-    }
-
-    public Process getProcess()
-    {
-      return process;
-    }
-
-    /**
-     * This is used for process overrides. Return a clone of the process
-     * which contains the overridden values.
-     * Not sure if the overridden process needs it's own Entry, but assume no for now
-     * @param testName logical test name, or test unit name
-     * @return
-     */
-    public Process getProcess(ProcessOverride processOverride)
-    {
-      return (Process) (process.cloneWithOverride(processOverride));
-    }
-
-    public ConfiguredProcessType getConfiguredProcessType()
-    {
-      return configProcessType;
-    }
-
-    public ProcessHandler getProcessHandler()
-    {
-      return processHandler;
-    }
-
-    //Some convenience methods
-
-    public ProcessType getProcessType()
-    {
-      return getConfiguredProcessType().getProcessType();
-    }
-
-    public ProcessConfiguration getProcessConfiguration()
-    {
-      return getProcessConfigurationManager().configure(
-        getMinimalConfigurationInfo(),
-        null);
-      //HACK
-    }
-
-    public MinimalConfigurationInfo getMinimalConfigurationInfo()
-    {
-      return getConfiguredProcessType().getMinimalConfigurationInfo();
-    }
-
-    public Class getProcessHandlerClass()
-    {
-      return getProcessType().getProcessHandlerClass();
-    }
-
-    public ProcessManager getProcessManager()
-    {
-      return getProcessType().getProcessManager();
-    }
-
-    public ProcessConfigurationManager getProcessConfigurationManager()
-    {
-      return getProcessType().getProcessConfigurationManager();
-    }
-
-    //End of some convenience methods
-    public String toString()
-    {
-      //return process.getName();
-      return "Process:  "
-        + process
-        + "\n"
-        + "ConfigProcessType:  "
-        + configProcessType
-        + "\n";
-    }
-
-    private void getProcessHandlerAndConfigure()
-    {
-      ProcessConfiguration pc = getProcessConfiguration();
-      process.setProcessConfiguration(pc);
-      processHandler = ProcessHandlerFactory.newInstance(process);
-    }
-
-    public Object cloneWithOverride(ProcessOverride override)
-    {
-      return cloneWithOverride(override, null);
-    }
-
-    /**
-     * This is used for process overrides. Clone an entry. Don't worry about configuration right now
-     * @param p
-     * @return
-     */
-    public Object cloneWithOverride(
-      ProcessOverride override,
-      Map localProcessHandlerMap)
-    {
-      Process oldprocess = getProcess();
-      Process cloned_process =
-        (Process)oldprocess.cloneWithOverride(override, localProcessHandlerMap);
-      Entry e = null;
-      try
-      {
-        e = (Entry)this.clone();
-      }
-      catch (CloneNotSupportedException ex)
-      {
-        throw new BuildException("clone() is not supported in ProcessRegistry.Entry");
-      }
-      e.process = cloned_process;
-      // Process cloning already handles a deep copy of the process configuration,
-      // so don't do any process configuration setup
-
-      // This will set a map of (process name -> process handler) for all locally overridden
-      // processes on the ProcessManager. The process manager can use this as needed
-      // (e.g. getAdmin() should check for the handler for an overridden admin server for instance)
-      ProcessManager processmanager =
-        e.process.getConfiguredProcess().getProcessType().getProcessManager();
-      processmanager.setOverrideProcessHandlerMap(localProcessHandlerMap);
-
-      // create the process handler for the new process
-      e.processHandler = ProcessHandlerFactory.newInstance(cloned_process);
-
-      return e;
-    }
-  }
-}
+package org.apache.beehive.test.tools.tch.core.process;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.tools.ant.BuildException;
+
+import org.apache.beehive.test.tools.tch.core.PropertyNames;
+import org.apache.beehive.test.tools.tch.core.configuration.InvalidationManager;
+import org.apache.beehive.test.tools.tch.core.configuration.MinimalConfigurationInfo;
+import org.apache.beehive.test.tools.tch.core.configuration.NonfatalValidationException;
+import org.apache.beehive.test.tools.tch.core.configuration.ProcessConfiguration;
+import org.apache.beehive.test.tools.tch.core.configuration.ProcessConfigurationManager;
+import org.apache.beehive.test.tools.tch.util.CaseInsensitiveStringKey;
+import org.apache.beehive.test.tools.tch.util.TchUtils;
+
+public class ProcessRegistry
+{
+
+  public static final String IMPLICIT_PROCESS_NAME =
+    Process.IMPLICIT_PROCESS_NAME;
+
+  private static ProcessRegistry reg = null;
+
+  // String (name) -> String (value)
+  private Map activeProcessesAttributes = null;
+
+  // Maps ProcessOverrideKey(process name, (testname or testunit name)) -> ProcessOverride
+  private Map processOverrideMap = new HashMap();
+
+  private Map processes = new HashMap(); //String (name) ->  Entry
+
+  private ProcessRegistry()
+  {
+  }
+
+  public synchronized static ProcessRegistry getRegistry()
+  {
+    if (reg == null)
+      reg = new ProcessRegistry();
+    return reg;
+  }
+
+  public static Map getAttributesForActiveProcessesWithPrefix()
+  {
+    return getRegistry().getAttributesForActiveProcessesWithPrefixInteral();
+  }
+
+  public static Map getAttributesForActiveProcesses()
+  {
+    return getRegistry().getAttributesForActiveProcessesInternal();
+  }
+
+  public synchronized void addProcessEntry(
+    Process p,
+    ConfiguredProcessType cpt)
+  {
+    addProcessEntry(p.getName(), new ProcessRegistry.Entry(p, cpt));
+  }
+
+  public void setImplicitProcessEntry(Process p)
+  {
+    Entry entry = new ProcessRegistry.Entry(p, p.getConfiguredProcess());
+    addProcessEntry(IMPLICIT_PROCESS_NAME, entry);
+    addProcessEntry(p.getName(), entry);
+  }
+
+  public ProcessRegistry.Entry getProcessEntry(String name)
+    throws NonfatalValidationException
+  {
+    ProcessRegistry.Entry entry =
+      (ProcessRegistry.Entry)processes.get(new CaseInsensitiveStringKey(name));
+    if (entry != null)
+      return entry;
+    else
+    {
+      throw new NonfatalValidationException(
+        ErrorMessageConstants.NO_PROCESS_REGISTERED_ERROR_CODE,
+        ErrorMessageConstants.PROCESS,
+        name);
+    }
+  }
+
+  /**
+   * Creates a ProcessRegistry.Entry on-the-fly containing the specified process
+   * along with any overrides that are in effect for the current test. Basically
+   * this will get the existing ProcessRegistry.Entry for that process name, and
+   * create a copy of it and clone the process with the appropriate overrides.
+   * This seems safe to do as long as the entry will not be changed by the caller.
+   * @param name Name of the process
+   * @param logicalTestName Fully qualified test name or test-unit name
+   */
+  public ProcessRegistry.Entry getProcessEntryForTest(
+    String name,
+    String logicalTestName)
+    throws NonfatalValidationException
+  {
+    ProcessOverride override = getProcessOverride(name, logicalTestName);
+    //    System.out.println(
+    //      "Got override for process: "
+    //        + name
+    //        + " testname: "
+    //        + logicalTestName
+    //        + " : "
+    //        + override);
+    Map local_override_map = getProcessOverrideMapForTest(logicalTestName);
+    // This will be used to map (process name -> process handler) for all locally
+    // overridden processes
+    HashMap local_ph_map = new HashMap();
+    // First we actually need to create a map (process name -> process override)
+    // for all processes that have local overrides
+    for (Iterator iter = local_override_map.keySet().iterator();
+      iter.hasNext();
+      )
+    {
+      String processname = (String)iter.next();
+      ProcessRegistry.Entry processentry =
+        (ProcessRegistry.Entry)processes.get(
+          new CaseInsensitiveStringKey(processname));
+      if (processentry != null)
+      {
+        ProcessOverride processoverride =
+          (ProcessOverride)local_override_map.get(processname);
+        processentry = (Entry)processentry.cloneWithOverride(processoverride);
+        local_ph_map.put(processname, processentry.getProcessHandler());
+      }
+    }
+
+    ProcessRegistry.Entry entry =
+      (ProcessRegistry.Entry)processes.get(new CaseInsensitiveStringKey(name));
+    if (entry != null)
+    {
+      if (override != null)
+      {
+        // Note: This entry is created on the fly. It is not stored on the processes map
+        // we just want to clone the existing entry and reset the proces/process handler with
+        // a cloned process
+        // NOTE: We need to pass in ALL overrides which correspond to the current test since
+        // the ProcessHandler for the admin servers, nested processes, etc. may need to be
+        // explicitly set if it is overridden as well
+        entry = (Entry)entry.cloneWithOverride(override, local_ph_map);
+      }
+      return entry;
+    }
+    else
+    {
+      throw new NonfatalValidationException(
+        ErrorMessageConstants.NO_PROCESS_REGISTERED_ERROR_CODE,
+        ErrorMessageConstants.PROCESS,
+        name);
+    }
+  }
+
+  public ProcessRegistry.Entry getProcessEntryAssumeValidated(String name)
+  {
+    try
+    {
+      return getProcessEntry(name);
+    }
+    catch (NonfatalValidationException ex)
+    {
+      throw new BuildException(ex);
+    }
+  }
+
+  private Map getAttributesForActiveProcessesWithPrefixInteral()
+  {
+    // cache this also?
+    Map rtn = new HashMap();
+    for (Iterator iter =
+      getAttributesForActiveProcessesInternal().entrySet().iterator();
+      iter.hasNext();
+      )
+    {
+      Map.Entry entry = (Map.Entry)iter.next();
+      rtn.put(
+        PropertyNames.TCH_PREFIX
+          + PropertyNames.TCH_PROCESS_CONFIGURED_PREFIX
+          + entry.getKey(),
+        entry.getValue());
+    }
+    return rtn;
+  }
+
+  private synchronized Map getAttributesForActiveProcessesInternal()
+  {
+    if (activeProcessesAttributes == null)
+    {
+      activeProcessesAttributes = new TreeMap();
+      for (Iterator iter = processes.entrySet().iterator(); iter.hasNext();)
+      {
+        Map.Entry entry = (Map.Entry)iter.next();
+        String name = String.valueOf(entry.getKey()).toLowerCase();
+        Entry processEntry = (Entry)entry.getValue();
+        if (processEntry.getProcess().isActive())
+          activeProcessesAttributes.putAll(
+            TchUtils.runAllNoArgGetters(
+              processEntry.getProcessHandler(),
+              name + PropertyNames.PROP_NAME_DELIMITER,
+              true,
+              true));
+      }
+
+      activeProcessesAttributes =
+        Collections.unmodifiableMap(activeProcessesAttributes);
+    }
+    return activeProcessesAttributes;
+  }
+
+  public Entry getImplicitProcessEntry()
+  {
+    Entry entry = null;
+    try
+    {
+      entry = getProcessEntry(IMPLICIT_PROCESS_NAME);
+    }
+    catch (NonfatalValidationException ex)
+    {
+      // swallow
+    }
+    return entry;
+  }
+
+  // convenience method
+  public boolean hasImplicitProcessEntry()
+  {
+    return getImplicitProcessEntry() != null;
+  }
+
+  public String getImplicitProcessName()
+  {
+    Entry entry = getImplicitProcessEntry();
+    if (entry != null)
+      return entry.getProcess().getName();
+    else
+      return null;
+  }
+
+  public Iterator getEntryIterator()
+  {
+    return new HashSet(processes.values()).iterator();
+  }
+
+  public void cleanUpProcessManagers()
+  {
+    for (Iterator iter = getEntryIterator(); iter.hasNext();)
+    {
+      Entry entry = (Entry)iter.next();
+      if (entry.getProcess().isActive())
+      {
+        System.out.println("  ... process: " + entry.getProcess().getName());
+        entry.getProcessManager().cleanup(entry.getProcess());
+      }
+    }
+  }
+
+  public String toString()
+  {
+    return processes.toString();
+  }
+
+  public String dump()
+  {
+    StringBuffer ret = new StringBuffer();
+    for (Iterator iter = processes.entrySet().iterator(); iter.hasNext();)
+    {
+      Map.Entry entry = (Map.Entry)iter.next();
+      Process process = ((Entry)entry.getValue()).getProcess();
+      ret.append(process.dump());
+      ret.append("\n\n");
+    }
+    return ret.toString();
+  }
+
+  private synchronized void addProcessEntry(String name, Entry inEntry)
+  {
+    Object key = new CaseInsensitiveStringKey(name);
+    if (processes.containsKey(key))
+    {
+      //VALIDATION ERROR
+      InvalidationManager.addFatalInvalidation(
+        new NonfatalValidationException(
+          ErrorMessageConstants.PROCESS_ALREADY_REGISTERED_ERROR_CODE,
+          ErrorMessageConstants.PROCESS,
+          name));
+    }
+    else
+    {
+      // check if we already have an entry with this process object
+      // if that is the case, map the new entry name to that
+      Entry entryForSameProcess = getSameProcessEntry(inEntry);
+      if (entryForSameProcess != null)
+      {
+        processes.put(key, entryForSameProcess);
+      }
+      else
+        processes.put(key, inEntry);
+    }
+  }
+
+  private Entry getSameProcessEntry(Entry in)
+  {
+    for (Iterator iter = getEntryIterator(); iter.hasNext();)
+    {
+      Entry entry = (Entry)iter.next();
+      if (entry.getProcess() == in.getProcess())
+        return entry;
+    }
+    return null;
+  }
+
+  /**
+   * Add a new ProcessOverride to the map
+   * @param processName name of the process
+   * @param testName fully qualified test name
+   * @param processOverride the process override object to store
+   */
+  public void addProcessOverride(
+    String processName,
+    String testName,
+    ProcessOverride processOverride)
+  {
+    processOverrideMap.put(
+      new ProcessOverrideKey(processName, testName),
+      processOverride);
+  }
+
+  /**
+   * Gets an existing ProcessOverride for the specified process, test combination
+   * @param processName
+   * @param testName
+   * @return
+   */
+  public ProcessOverride getProcessOverride(
+    String processName,
+    String testName)
+  {
+    return (ProcessOverride)processOverrideMap.get(
+      new ProcessOverrideKey(processName, testName));
+  }
+
+  /**
+   * Gets a map (process name -> process override) for all overrides
+   * which are in effect for the specified test
+   */
+  public Map getProcessOverrideMapForTest(String testName)
+  {
+    HashMap overridemap = new HashMap();
+    for (Iterator iter = processOverrideMap.keySet().iterator();
+      iter.hasNext();
+      )
+    {
+      ProcessOverrideKey key = (ProcessOverrideKey)iter.next();
+      if (key.getTestName().equals(testName))
+      {
+        overridemap.put(key.getProcessName(), processOverrideMap.get(key));
+      }
+    }
+    return overridemap;
+  }
+
+  /**
+   * Entry is currently and should remain read-only. There are no setters and nothing should
+   * need to modify an Entry outside of ProcessRegistry.
+   */
+  public class Entry implements CloneOverrideable
+  {
+    private Process process = null;
+    private ConfiguredProcessType configProcessType = null;
+    private ProcessHandler processHandler = null;
+
+    public Entry(Process inProcess, ConfiguredProcessType inCPT)
+    {
+      process = inProcess;
+      configProcessType = inCPT;
+      getProcessHandlerAndConfigure();
+    }
+
+    public Process getProcess()
+    {
+      return process;
+    }
+
+    /**
+     * This is used for process overrides. Return a clone of the process
+     * which contains the overridden values.
+     * Not sure if the overridden process needs it's own Entry, but assume no for now
+     * @param testName logical test name, or test unit name
+     * @return
+     */
+    public Process getProcess(ProcessOverride processOverride)
+    {
+      return (Process) (process.cloneWithOverride(processOverride));
+    }
+
+    public ConfiguredProcessType getConfiguredProcessType()
+    {
+      return configProcessType;
+    }
+
+    public ProcessHandler getProcessHandler()
+    {
+      return processHandler;
+    }
+
+    //Some convenience methods
+
+    public ProcessType getProcessType()
+    {
+      return getConfiguredProcessType().getProcessType();
+    }
+
+    public ProcessConfiguration getProcessConfiguration()
+    {
+      return getProcessConfigurationManager().configure(
+        getMinimalConfigurationInfo(),
+        null);
+      //HACK
+    }
+
+    public MinimalConfigurationInfo getMinimalConfigurationInfo()
+    {
+      return getConfiguredProcessType().getMinimalConfigurationInfo();
+    }
+
+    public Class getProcessHandlerClass()
+    {
+      return getProcessType().getProcessHandlerClass();
+    }
+
+    public ProcessManager getProcessManager()
+    {
+      return getProcessType().getProcessManager();
+    }
+
+    public ProcessConfigurationManager getProcessConfigurationManager()
+    {
+      return getProcessType().getProcessConfigurationManager();
+    }
+
+    //End of some convenience methods
+    public String toString()
+    {
+      //return process.getName();
+      return "Process:  "
+        + process
+        + "\n"
+        + "ConfigProcessType:  "
+        + configProcessType
+        + "\n";
+    }
+
+    private void getProcessHandlerAndConfigure()
+    {
+      ProcessConfiguration pc = getProcessConfiguration();
+      process.setProcessConfiguration(pc);
+      processHandler = ProcessHandlerFactory.newInstance(process);
+    }
+
+    public Object cloneWithOverride(ProcessOverride override)
+    {
+      return cloneWithOverride(override, null);
+    }
+
+    /**
+     * This is used for process overrides. Clone an entry. Don't worry about configuration right now
+     * @param p
+     * @return
+     */
+    public Object cloneWithOverride(
+      ProcessOverride override,
+      Map localProcessHandlerMap)
+    {
+      Process oldprocess = getProcess();
+      Process cloned_process =
+        (Process)oldprocess.cloneWithOverride(override, localProcessHandlerMap);
+      Entry e = null;
+      try
+      {
+        e = (Entry)this.clone();
+      }
+      catch (CloneNotSupportedException ex)
+      {
+        throw new BuildException("clone() is not supported in ProcessRegistry.Entry");
+      }
+      e.process = cloned_process;
+      // Process cloning already handles a deep copy of the process configuration,
+      // so don't do any process configuration setup
+
+      // This will set a map of (process name -> process handler) for all locally overridden
+      // processes on the ProcessManager. The process manager can use this as needed
+      // (e.g. getAdmin() should check for the handler for an overridden admin server for instance)
+      ProcessManager processmanager =
+        e.process.getConfiguredProcess().getProcessType().getProcessManager();
+      processmanager.setOverrideProcessHandlerMap(localProcessHandlerMap);
+
+      // create the process handler for the new process
+      e.processHandler = ProcessHandlerFactory.newInstance(cloned_process);
+
+      return e;
+    }
+  }
+}

Propchange: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessState.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessState.java?rev=232310&r1=232309&r2=232310&view=diff
==============================================================================
--- beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessState.java (original)
+++ beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessState.java Fri Aug 12 08:12:28 2005
@@ -1,11 +1,11 @@
-package org.apache.beehive.test.tools.tch.core.process;
-
-/**
- * Interface for a process state object.
- *  
- */
-
-public interface ProcessState
-{
-}
-
+package org.apache.beehive.test.tools.tch.core.process;
+
+/**
+ * Interface for a process state object.
+ *  
+ */
+
+public interface ProcessState
+{
+}
+

Propchange: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessState.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessSummaryProvider.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessSummaryProvider.java?rev=232310&r1=232309&r2=232310&view=diff
==============================================================================
--- beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessSummaryProvider.java (original)
+++ beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessSummaryProvider.java Fri Aug 12 08:12:28 2005
@@ -1,27 +1,27 @@
-/*
- * Created on Jul 1, 2003
- *
- */
-package org.apache.beehive.test.tools.tch.core.process;
-
-import org.apache.beehive.test.tools.tch.core.remote.ProcessSummary;
-import org.apache.beehive.test.tools.tch.core.remote.UnknownExecTaskException;
-
-/**
- *
- * Interface for all ProcessManager(s) which should provide a ProcessSummary.
- * This is currently used since the ProcessSummary is used to pass the
- * process output as well as the filenames of the process drain files to a
- * test result. AbstractTestTask will check that the ProcessManager implements this
- * interface before it associates a ProcessSummary to the result.
- */
-public interface ProcessSummaryProvider
-{
-	public ProcessSummary getProcessSummary(Process inProcess)
-		throws UnknownExecTaskException;
-
-	// this method will always return a ProcessSummary (no throws clause).
-	// Even if there are problems, the ProcessSummary instance itself will contain
-	// status information indicating the problem.
-	public ProcessSummary getProcessSummaryNoThrow(Process inProcess);
-}
+/*
+ * Created on Jul 1, 2003
+ *
+ */
+package org.apache.beehive.test.tools.tch.core.process;
+
+import org.apache.beehive.test.tools.tch.core.remote.ProcessSummary;
+import org.apache.beehive.test.tools.tch.core.remote.UnknownExecTaskException;
+
+/**
+ *
+ * Interface for all ProcessManager(s) which should provide a ProcessSummary.
+ * This is currently used since the ProcessSummary is used to pass the
+ * process output as well as the filenames of the process drain files to a
+ * test result. AbstractTestTask will check that the ProcessManager implements this
+ * interface before it associates a ProcessSummary to the result.
+ */
+public interface ProcessSummaryProvider
+{
+	public ProcessSummary getProcessSummary(Process inProcess)
+		throws UnknownExecTaskException;
+
+	// this method will always return a ProcessSummary (no throws clause).
+	// Even if there are problems, the ProcessSummary instance itself will contain
+	// status information indicating the problem.
+	public ProcessSummary getProcessSummaryNoThrow(Process inProcess);
+}

Propchange: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessSummaryProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessTerminatedException.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessTerminatedException.java?rev=232310&r1=232309&r2=232310&view=diff
==============================================================================
--- beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessTerminatedException.java (original)
+++ beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessTerminatedException.java Fri Aug 12 08:12:28 2005
@@ -1,23 +1,23 @@
-package org.apache.beehive.test.tools.tch.core.process;
-
-import org.apache.beehive.test.tools.tch.util.NestedException;
-
-public class ProcessTerminatedException
-  extends NestedException
-{
-  public ProcessTerminatedException(String message)
-  {
-    super(message);
-  }
-
-  public ProcessTerminatedException(Exception ex)
-  {
-    super(ex);
-  }
-
-  public ProcessTerminatedException(Exception ex, String message)
-  {
-    super(ex, message);
-  }
-}
-
+package org.apache.beehive.test.tools.tch.core.process;
+
+import org.apache.beehive.test.tools.tch.util.NestedException;
+
+public class ProcessTerminatedException
+  extends NestedException
+{
+  public ProcessTerminatedException(String message)
+  {
+    super(message);
+  }
+
+  public ProcessTerminatedException(Exception ex)
+  {
+    super(ex);
+  }
+
+  public ProcessTerminatedException(Exception ex, String message)
+  {
+    super(ex, message);
+  }
+}
+

Propchange: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessTerminatedException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessTimeoutException.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessTimeoutException.java?rev=232310&r1=232309&r2=232310&view=diff
==============================================================================
--- beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessTimeoutException.java (original)
+++ beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessTimeoutException.java Fri Aug 12 08:12:28 2005
@@ -1,23 +1,23 @@
-package org.apache.beehive.test.tools.tch.core.process;
-
-import org.apache.beehive.test.tools.tch.util.NestedException;
-
-public class ProcessTimeoutException
-  extends NestedException
-{
-  public ProcessTimeoutException(String message)
-  {
-    super(message);
-  }
-
-  public ProcessTimeoutException(Throwable ex)
-  {
-    super(ex);
-  }
-
-  public ProcessTimeoutException(Throwable ex, String message)
-  {
-    super(ex, message);
-  }
-}
-
+package org.apache.beehive.test.tools.tch.core.process;
+
+import org.apache.beehive.test.tools.tch.util.NestedException;
+
+public class ProcessTimeoutException
+  extends NestedException
+{
+  public ProcessTimeoutException(String message)
+  {
+    super(message);
+  }
+
+  public ProcessTimeoutException(Throwable ex)
+  {
+    super(ex);
+  }
+
+  public ProcessTimeoutException(Throwable ex, String message)
+  {
+    super(ex, message);
+  }
+}
+

Propchange: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessTimeoutException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessType.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessType.java?rev=232310&r1=232309&r2=232310&view=diff
==============================================================================
--- beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessType.java (original)
+++ beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessType.java Fri Aug 12 08:12:28 2005
@@ -1,183 +1,183 @@
-package org.apache.beehive.test.tools.tch.core.process;
-
-import java.io.Serializable;
-
-import org.w3c.dom.Node;
-
-import org.apache.beehive.test.tools.tch.core.configuration.NonfatalValidationException;
-import org.apache.beehive.test.tools.tch.core.configuration.ProcessConfigurationManager;
-import org.apache.beehive.test.tools.tch.core.configuration.XMLHandler;
-import org.apache.beehive.test.tools.tch.util.xml.DomUtils;
-
-public class ProcessType implements Serializable
-{
-  // attribute names from ProcessConfig
-  private static final String PROCESS_HANDLER_ATTR = "process-handler",
-    DEFAULT_PROCESS_MANAGER_ATTR = "default-process-manager",
-    XML_HANDLER_ATTR = "xml-handler",
-    ROOT_CONFIG_TAGNAME_ATTR = "root-config-tagname",
-    CONFIGURATION_MANAGER_ATTR = "configuration-manager";
-
-  private static final String ERROR_MESSAGE =
-    "One of the supplied classes could not be constructed";
-
-  private String logicalName = null;
-  private String configurationRootTag = null;
-  private ProcessManager pm = null;
-  private Class phc = null;
-  private transient ProcessConfigurationManager pcm = null;
-  private transient XMLHandler xmlh = null;
-
-  public ProcessType(Node processTypeNode) throws NonfatalValidationException
-  {
-    String name = DomUtils.getNameAttributeValue(processTypeNode);
-    String processManagerClass =
-      DomUtils.getAttributeValue(processTypeNode, DEFAULT_PROCESS_MANAGER_ATTR);
-    String processHandlerClass =
-      DomUtils.getAttributeValue(processTypeNode, PROCESS_HANDLER_ATTR);
-    String confManagerClass =
-      DomUtils.getAttributeValue(processTypeNode, CONFIGURATION_MANAGER_ATTR);
-    String XMLHandlerClass =
-      DomUtils.getAttributeValue(processTypeNode, XML_HANDLER_ATTR);
-    String rootTagName =
-      DomUtils.getAttributeValue(processTypeNode, ROOT_CONFIG_TAGNAME_ATTR);
-
-    init(
-      name,
-      processManagerClass,
-      processHandlerClass,
-      confManagerClass,
-      XMLHandlerClass,
-      rootTagName);
-  }
-
-  public ProcessType(
-    String inName,
-    String inPmClassname,
-    String inPhClassname,
-    String inPcmClassname,
-    String inxmlhClassname,
-    String inConfigurationRootTag)
-    throws NonfatalValidationException
-  {
-    init(
-      inName,
-      inPmClassname,
-      inPhClassname,
-      inPcmClassname,
-      inxmlhClassname,
-      inConfigurationRootTag);
-  }
-
-  private void init(
-    String inName,
-    String inPmClassname,
-    String inPhClassname,
-    String inPcmClassname,
-    String inxmlhClassname,
-    String inConfigurationRootTag)
-    throws NonfatalValidationException
-  {
-    logicalName = inName;
-    configurationRootTag = inConfigurationRootTag;
-    pm = (ProcessManager)instantiate(inPmClassname);
-    phc = getClass(inPhClassname);
-    pcm = (ProcessConfigurationManager)instantiate(inPcmClassname);
-    xmlh = (XMLHandler)instantiate(inxmlhClassname);
-  }
-
-  private Object instantiate(String className)
-    throws NonfatalValidationException
-  {
-    try
-    {
-      return Class.forName(className).newInstance();
-    }
-    catch (Exception ex)
-    {
-      throw new NonfatalValidationException(
-        ex,
-        ErrorMessageConstants.COULD_NOT_CONSTRUCT_CLASS_ERROR_CODE,
-        ErrorMessageConstants.CLASS_NAME,
-        className);
-    }
-  }
-
-  private Class getClass(String className) throws NonfatalValidationException
-  {
-    try
-    {
-      return Class.forName(className);
-    }
-    catch (Exception ex)
-    {
-      throw new NonfatalValidationException(
-        ex,
-        ErrorMessageConstants.COULD_NOT_CONSTRUCT_CLASS_ERROR_CODE,
-        ErrorMessageConstants.CLASS_NAME,
-        className);
-    }
-  }
-
-  public String getName()
-  {
-    return logicalName;
-  }
-
-  public String getConfigurationRootTag()
-  {
-    return configurationRootTag;
-  }
-
-  public ProcessManager getProcessManager()
-  {
-    return pm;
-  }
-
-  public Class getProcessHandlerClass()
-  {
-    return phc;
-  }
-
-  public ProcessConfigurationManager getProcessConfigurationManager()
-  {
-    return pcm;
-  }
-
-  public XMLHandler getXMLHandler()
-  {
-    return xmlh;
-  }
-
-  public String dump()
-  {
-    return "name="
-      + getName()
-      + "\n"
-      + "configurationRootTag="
-      + configurationRootTag
-      + "\n"
-      + "ProcessManager="
-      + pm
-      + "\n"
-      + "ProcessHandler classname="
-      + phc
-      + "\n"
-      + "ProcessConfigurationManager="
-      + pcm
-      + "\n"
-      + "XMLHandler="
-      + xmlh
-      + "\n";
-  }
-
-  public String dumpAll()
-  {
-    return dump();
-  }
-
-  public String toString()
-  {
-    return getName();
-  }
-}
+package org.apache.beehive.test.tools.tch.core.process;
+
+import java.io.Serializable;
+
+import org.w3c.dom.Node;
+
+import org.apache.beehive.test.tools.tch.core.configuration.NonfatalValidationException;
+import org.apache.beehive.test.tools.tch.core.configuration.ProcessConfigurationManager;
+import org.apache.beehive.test.tools.tch.core.configuration.XMLHandler;
+import org.apache.beehive.test.tools.tch.util.xml.DomUtils;
+
+public class ProcessType implements Serializable
+{
+  // attribute names from ProcessConfig
+  private static final String PROCESS_HANDLER_ATTR = "process-handler",
+    DEFAULT_PROCESS_MANAGER_ATTR = "default-process-manager",
+    XML_HANDLER_ATTR = "xml-handler",
+    ROOT_CONFIG_TAGNAME_ATTR = "root-config-tagname",
+    CONFIGURATION_MANAGER_ATTR = "configuration-manager";
+
+  private static final String ERROR_MESSAGE =
+    "One of the supplied classes could not be constructed";
+
+  private String logicalName = null;
+  private String configurationRootTag = null;
+  private ProcessManager pm = null;
+  private Class phc = null;
+  private transient ProcessConfigurationManager pcm = null;
+  private transient XMLHandler xmlh = null;
+
+  public ProcessType(Node processTypeNode) throws NonfatalValidationException
+  {
+    String name = DomUtils.getNameAttributeValue(processTypeNode);
+    String processManagerClass =
+      DomUtils.getAttributeValue(processTypeNode, DEFAULT_PROCESS_MANAGER_ATTR);
+    String processHandlerClass =
+      DomUtils.getAttributeValue(processTypeNode, PROCESS_HANDLER_ATTR);
+    String confManagerClass =
+      DomUtils.getAttributeValue(processTypeNode, CONFIGURATION_MANAGER_ATTR);
+    String XMLHandlerClass =
+      DomUtils.getAttributeValue(processTypeNode, XML_HANDLER_ATTR);
+    String rootTagName =
+      DomUtils.getAttributeValue(processTypeNode, ROOT_CONFIG_TAGNAME_ATTR);
+
+    init(
+      name,
+      processManagerClass,
+      processHandlerClass,
+      confManagerClass,
+      XMLHandlerClass,
+      rootTagName);
+  }
+
+  public ProcessType(
+    String inName,
+    String inPmClassname,
+    String inPhClassname,
+    String inPcmClassname,
+    String inxmlhClassname,
+    String inConfigurationRootTag)
+    throws NonfatalValidationException
+  {
+    init(
+      inName,
+      inPmClassname,
+      inPhClassname,
+      inPcmClassname,
+      inxmlhClassname,
+      inConfigurationRootTag);
+  }
+
+  private void init(
+    String inName,
+    String inPmClassname,
+    String inPhClassname,
+    String inPcmClassname,
+    String inxmlhClassname,
+    String inConfigurationRootTag)
+    throws NonfatalValidationException
+  {
+    logicalName = inName;
+    configurationRootTag = inConfigurationRootTag;
+    pm = (ProcessManager)instantiate(inPmClassname);
+    phc = getClass(inPhClassname);
+    pcm = (ProcessConfigurationManager)instantiate(inPcmClassname);
+    xmlh = (XMLHandler)instantiate(inxmlhClassname);
+  }
+
+  private Object instantiate(String className)
+    throws NonfatalValidationException
+  {
+    try
+    {
+      return Class.forName(className).newInstance();
+    }
+    catch (Exception ex)
+    {
+      throw new NonfatalValidationException(
+        ex,
+        ErrorMessageConstants.COULD_NOT_CONSTRUCT_CLASS_ERROR_CODE,
+        ErrorMessageConstants.CLASS_NAME,
+        className);
+    }
+  }
+
+  private Class getClass(String className) throws NonfatalValidationException
+  {
+    try
+    {
+      return Class.forName(className);
+    }
+    catch (Exception ex)
+    {
+      throw new NonfatalValidationException(
+        ex,
+        ErrorMessageConstants.COULD_NOT_CONSTRUCT_CLASS_ERROR_CODE,
+        ErrorMessageConstants.CLASS_NAME,
+        className);
+    }
+  }
+
+  public String getName()
+  {
+    return logicalName;
+  }
+
+  public String getConfigurationRootTag()
+  {
+    return configurationRootTag;
+  }
+
+  public ProcessManager getProcessManager()
+  {
+    return pm;
+  }
+
+  public Class getProcessHandlerClass()
+  {
+    return phc;
+  }
+
+  public ProcessConfigurationManager getProcessConfigurationManager()
+  {
+    return pcm;
+  }
+
+  public XMLHandler getXMLHandler()
+  {
+    return xmlh;
+  }
+
+  public String dump()
+  {
+    return "name="
+      + getName()
+      + "\n"
+      + "configurationRootTag="
+      + configurationRootTag
+      + "\n"
+      + "ProcessManager="
+      + pm
+      + "\n"
+      + "ProcessHandler classname="
+      + phc
+      + "\n"
+      + "ProcessConfigurationManager="
+      + pcm
+      + "\n"
+      + "XMLHandler="
+      + xmlh
+      + "\n";
+  }
+
+  public String dumpAll()
+  {
+    return dump();
+  }
+
+  public String toString()
+  {
+    return getName();
+  }
+}

Propchange: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ProcessType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ResolveProcessPropertiesHelper.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ResolveProcessPropertiesHelper.java?rev=232310&r1=232309&r2=232310&view=diff
==============================================================================
--- beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ResolveProcessPropertiesHelper.java (original)
+++ beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ResolveProcessPropertiesHelper.java Fri Aug 12 08:12:28 2005
@@ -1,41 +1,41 @@
-package org.apache.beehive.test.tools.tch.core.process;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.apache.tools.ant.Project;
-
-import org.apache.beehive.test.tools.tch.core.AntProperties;
-import org.apache.beehive.test.tools.tch.core.PropertyNames;
-import org.apache.beehive.test.tools.tch.util.ValueHandler;
-
-public class ResolveProcessPropertiesHelper
-{
-  public static void resolveAndSetProcessInfoProperties(
-    Project project,
-	Map inProps,
-    ValueHandler handler)
-  {
-  	Map props = inProps;
-  	if (props == null)
-  	  props = project.getProperties();
-    for (Iterator iter = props.entrySet().iterator();
-      iter.hasNext();
-      )
-    {
-      Map.Entry entry = (Map.Entry)iter.next();
-      String val = (String)entry.getValue();
-      if (val.indexOf(PropertyNames.TCH_PROCESS_CONFIGURED_PREFIX) > 1)
-      {
-        String resolvedVal = handler.handleValue(val.toLowerCase());
-        if (AntProperties.isVerboseOn())
-          System.out.println(
-            "Setting " + entry.getKey() + " to " + resolvedVal);
-        if (project == null)
-          props.put(entry.getKey(), resolvedVal);
-        else
-          project.setProperty((String)entry.getKey(), resolvedVal);
-      }
-    }
-  }
-}
+package org.apache.beehive.test.tools.tch.core.process;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.tools.ant.Project;
+
+import org.apache.beehive.test.tools.tch.core.AntProperties;
+import org.apache.beehive.test.tools.tch.core.PropertyNames;
+import org.apache.beehive.test.tools.tch.util.ValueHandler;
+
+public class ResolveProcessPropertiesHelper
+{
+  public static void resolveAndSetProcessInfoProperties(
+    Project project,
+	Map inProps,
+    ValueHandler handler)
+  {
+  	Map props = inProps;
+  	if (props == null)
+  	  props = project.getProperties();
+    for (Iterator iter = props.entrySet().iterator();
+      iter.hasNext();
+      )
+    {
+      Map.Entry entry = (Map.Entry)iter.next();
+      String val = (String)entry.getValue();
+      if (val.indexOf(PropertyNames.TCH_PROCESS_CONFIGURED_PREFIX) > 1)
+      {
+        String resolvedVal = handler.handleValue(val.toLowerCase());
+        if (AntProperties.isVerboseOn())
+          System.out.println(
+            "Setting " + entry.getKey() + " to " + resolvedVal);
+        if (project == null)
+          props.put(entry.getKey(), resolvedVal);
+        else
+          project.setProperty((String)entry.getKey(), resolvedVal);
+      }
+    }
+  }
+}

Propchange: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ResolveProcessPropertiesHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ResolveProcessPropertiesTask.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ResolveProcessPropertiesTask.java?rev=232310&r1=232309&r2=232310&view=diff
==============================================================================
--- beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ResolveProcessPropertiesTask.java (original)
+++ beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ResolveProcessPropertiesTask.java Fri Aug 12 08:12:28 2005
@@ -1,119 +1,119 @@
-package org.apache.beehive.test.tools.tch.core.process;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-
-import org.apache.beehive.test.tools.tch.core.AntProperties;
-import org.apache.beehive.test.tools.tch.core.configuration.InvalidationManager;
-import org.apache.beehive.test.tools.tch.core.configuration.NonfatalValidationException;
-import org.apache.beehive.test.tools.tch.core.configuration.PropValueSubstitutionRegistry;
-import org.apache.beehive.test.tools.tch.util.ValueHandler;
-
-public class ResolveProcessPropertiesTask extends Task
-{
-  private static final char ANCHOR = '%', OPEN = '{', CLOSE = '}';
-  private ValueHandler handler = null;
-  private Map processProperties = null;
-  private boolean valid = true;
-
-  public static final String PROCESS_ATTRIBUTES_PROPS_FILE_NAME =
-    ".process-data-read-only.props";
-
-  public void execute()
-  {
-    processProperties =
-      ProcessRegistry.getAttributesForActiveProcessesWithPrefix();
-    handler = new ValueHandler(processProperties, ANCHOR);
-    resolveAndSetProcessInfoProperties();
-    logValidationErrors();
-    addMappings();
-    writePropertiesFile();
-  }
-
-  private void writePropertiesFile()
-  {
-    if (!AntProperties.isWriteProcessDataPropsFileEnabled())
-      return;
-
-    // writing without prefix (tch.processinfo)
-    Map m = ProcessRegistry.getAttributesForActiveProcesses();
-    if (m.keySet().isEmpty())
-      return;
-
-    File f =
-      new File(
-        AntProperties.getBaseDir()
-          + File.separator
-          + PROCESS_ATTRIBUTES_PROPS_FILE_NAME);
-
-    if (AntProperties.isVerboseOn())
-      log("Writing process data into " + f.getAbsolutePath());
-
-    try
-    {
-      PrintWriter pw =
-        new PrintWriter(new BufferedOutputStream(new FileOutputStream(f)));
-      for (Iterator iter = m.entrySet().iterator(); iter.hasNext();)
-      {
-        Map.Entry entry = (Map.Entry)iter.next();
-        pw.println(entry.toString());
-      }
-      pw.close();
-    }
-    catch (Exception ex)
-    {
-      throw new BuildException(ex);
-    }
-  }
-
-  private void resolveAndSetProcessInfoProperties()
-  {
-    ResolveProcessPropertiesHelper.resolveAndSetProcessInfoProperties(
-      getProject(),
-      null,
-      handler);
-  }
-
-  private void logValidationErrors()
-  {
-    for (Iterator iter = handler.getUnresolvedPropsAndClear().iterator();
-      iter.hasNext();
-      )
-    {
-      valid = false;
-      InvalidationManager.addFatalInvalidation(
-        new NonfatalValidationException(
-          ErrorMessageConstants.COULD_NOT_RESOLVE_PROCESS_INFO_PROP_CODE,
-          ErrorMessageConstants.PROP_NAME,
-          (String)iter.next()));
-    }
-  }
-
-  private void addMappings()
-  {
-    if (!isValid())
-      return;
-
-    for (Iterator iter = handler.getUsedProps().iterator(); iter.hasNext();)
-    {
-      String name = (String)iter.next();
-      String value = (String)processProperties.get(name);
-      name = String.valueOf(ANCHOR) + String.valueOf(OPEN) + name + CLOSE;
-      if (AntProperties.isVerboseOn())
-        log("Adding " + value + " -> " + name);
-      PropValueSubstitutionRegistry.getInstance().addMapping(value, name);
-    }
-  }
-
-  private boolean isValid()
-  {
-    return valid;
-  }
-}
+package org.apache.beehive.test.tools.tch.core.process;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+
+import org.apache.beehive.test.tools.tch.core.AntProperties;
+import org.apache.beehive.test.tools.tch.core.configuration.InvalidationManager;
+import org.apache.beehive.test.tools.tch.core.configuration.NonfatalValidationException;
+import org.apache.beehive.test.tools.tch.core.configuration.PropValueSubstitutionRegistry;
+import org.apache.beehive.test.tools.tch.util.ValueHandler;
+
+public class ResolveProcessPropertiesTask extends Task
+{
+  private static final char ANCHOR = '%', OPEN = '{', CLOSE = '}';
+  private ValueHandler handler = null;
+  private Map processProperties = null;
+  private boolean valid = true;
+
+  public static final String PROCESS_ATTRIBUTES_PROPS_FILE_NAME =
+    ".process-data-read-only.props";
+
+  public void execute()
+  {
+    processProperties =
+      ProcessRegistry.getAttributesForActiveProcessesWithPrefix();
+    handler = new ValueHandler(processProperties, ANCHOR);
+    resolveAndSetProcessInfoProperties();
+    logValidationErrors();
+    addMappings();
+    writePropertiesFile();
+  }
+
+  private void writePropertiesFile()
+  {
+    if (!AntProperties.isWriteProcessDataPropsFileEnabled())
+      return;
+
+    // writing without prefix (tch.processinfo)
+    Map m = ProcessRegistry.getAttributesForActiveProcesses();
+    if (m.keySet().isEmpty())
+      return;
+
+    File f =
+      new File(
+        AntProperties.getBaseDir()
+          + File.separator
+          + PROCESS_ATTRIBUTES_PROPS_FILE_NAME);
+
+    if (AntProperties.isVerboseOn())
+      log("Writing process data into " + f.getAbsolutePath());
+
+    try
+    {
+      PrintWriter pw =
+        new PrintWriter(new BufferedOutputStream(new FileOutputStream(f)));
+      for (Iterator iter = m.entrySet().iterator(); iter.hasNext();)
+      {
+        Map.Entry entry = (Map.Entry)iter.next();
+        pw.println(entry.toString());
+      }
+      pw.close();
+    }
+    catch (Exception ex)
+    {
+      throw new BuildException(ex);
+    }
+  }
+
+  private void resolveAndSetProcessInfoProperties()
+  {
+    ResolveProcessPropertiesHelper.resolveAndSetProcessInfoProperties(
+      getProject(),
+      null,
+      handler);
+  }
+
+  private void logValidationErrors()
+  {
+    for (Iterator iter = handler.getUnresolvedPropsAndClear().iterator();
+      iter.hasNext();
+      )
+    {
+      valid = false;
+      InvalidationManager.addFatalInvalidation(
+        new NonfatalValidationException(
+          ErrorMessageConstants.COULD_NOT_RESOLVE_PROCESS_INFO_PROP_CODE,
+          ErrorMessageConstants.PROP_NAME,
+          (String)iter.next()));
+    }
+  }
+
+  private void addMappings()
+  {
+    if (!isValid())
+      return;
+
+    for (Iterator iter = handler.getUsedProps().iterator(); iter.hasNext();)
+    {
+      String name = (String)iter.next();
+      String value = (String)processProperties.get(name);
+      name = String.valueOf(ANCHOR) + String.valueOf(OPEN) + name + CLOSE;
+      if (AntProperties.isVerboseOn())
+        log("Adding " + value + " -> " + name);
+      PropValueSubstitutionRegistry.getInstance().addMapping(value, name);
+    }
+  }
+
+  private boolean isValid()
+  {
+    return valid;
+  }
+}

Propchange: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/ResolveProcessPropertiesTask.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/test/TestProcessHandler.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/test/TestProcessHandler.java?rev=232310&r1=232309&r2=232310&view=diff
==============================================================================
--- beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/test/TestProcessHandler.java (original)
+++ beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/test/TestProcessHandler.java Fri Aug 12 08:12:28 2005
@@ -1,11 +1,11 @@
-package org.apache.beehive.test.tools.tch.core.process.test;
-
-import org.apache.beehive.test.tools.tch.core.process.ProcessHandler;
-
-public interface TestProcessHandler 
-  extends ProcessHandler
-{
-  public void ensureAlive();
-  public boolean isAlive();
-}
-
+package org.apache.beehive.test.tools.tch.core.process.test;
+
+import org.apache.beehive.test.tools.tch.core.process.ProcessHandler;
+
+public interface TestProcessHandler 
+  extends ProcessHandler
+{
+  public void ensureAlive();
+  public boolean isAlive();
+}
+

Propchange: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/process/test/TestProcessHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/remote/CrashTask.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/remote/CrashTask.java?rev=232310&r1=232309&r2=232310&view=diff
==============================================================================
--- beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/remote/CrashTask.java (original)
+++ beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/remote/CrashTask.java Fri Aug 12 08:12:28 2005
@@ -1,19 +1,19 @@
-package org.apache.beehive.test.tools.tch.core.remote;
-
-import org.apache.beehive.test.tools.tch.task.AbstractTask;
-import org.apache.beehive.test.tools.tch.task.TaskContext;
-
-public class CrashTask extends AbstractTask
-{
-
-  public CrashTask(String inName)
-  {
-    super(inName);
-  }
-
-  public TaskContext runtask(TaskContext in)
-  {
-    System.exit(1);
-    return null; // ha ha 
-  }
-}
+package org.apache.beehive.test.tools.tch.core.remote;
+
+import org.apache.beehive.test.tools.tch.task.AbstractTask;
+import org.apache.beehive.test.tools.tch.task.TaskContext;
+
+public class CrashTask extends AbstractTask
+{
+
+  public CrashTask(String inName)
+  {
+    super(inName);
+  }
+
+  public TaskContext runtask(TaskContext in)
+  {
+    System.exit(1);
+    return null; // ha ha 
+  }
+}

Propchange: beehive/trunk/controls/test/tools/tch/src/java/org/apache/beehive/test/tools/tch/core/remote/CrashTask.java
------------------------------------------------------------------------------
    svn:eol-style = native