org.eclipse.cdt.managedbuilder.internal.buildmodel
Class BuildProcessManager

java.lang.Object
  extended by org.eclipse.cdt.managedbuilder.internal.buildmodel.BuildProcessManager

public class BuildProcessManager
extends java.lang.Object

This class implements process pool management for internal builder NOTE: This class is subject to change and discuss, and is currently available in experimental mode only


Constructor Summary
BuildProcessManager(java.io.OutputStream _out, java.io.OutputStream _err, boolean _show, int _procNumber)
          Initializes process manager
 
Method Summary
static int checkCPUNumber()
           
 int getMaxProcesses()
          Returns maximum number of processes
 boolean hasEmpty()
          Checks states of all currently running processes.
 ProcessLauncher launchProcess(IBuildCommand cmd, org.eclipse.core.runtime.IPath cwd, org.eclipse.core.runtime.IProgressMonitor monitor)
          Performs an attempt to launch new process.
 ProcessLauncher queryStates()
          Checks states of all currently running processes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildProcessManager

public BuildProcessManager(java.io.OutputStream _out,
                           java.io.OutputStream _err,
                           boolean _show,
                           int _procNumber)
Initializes process manager

Parameters:
_out - Output stream
_err - Error output stream
_show - If true, print command line before launching
Method Detail

getMaxProcesses

public int getMaxProcesses()
Returns maximum number of processes


launchProcess

public ProcessLauncher launchProcess(IBuildCommand cmd,
                                     org.eclipse.core.runtime.IPath cwd,
                                     org.eclipse.core.runtime.IProgressMonitor monitor)
Performs an attempt to launch new process. Returns BuildProcessLauncher if it was successfully launched, null if there is no room for it yet in the process pool.

Parameters:
cmd - Command to launch
cwd - Command working directory
monitor - Progress monitor for this task

queryStates

public ProcessLauncher queryStates()
Checks states of all currently running processes. If it finds one with state other than STATE_DONE or STATE_RUNNING, it is returned as a result. Otherwise this method returns null.


hasEmpty

public boolean hasEmpty()
Checks states of all currently running processes.


checkCPUNumber

public static int checkCPUNumber()
Returns: