net.grinder.console.communication
Class ProcessControlImplementation

java.lang.Object
  extended by net.grinder.console.communication.ProcessControlImplementation
All Implemented Interfaces:
ProcessControl

public class ProcessControlImplementation
extends Object
implements ProcessControl

Implementation of ProcessControl.

Author:
Philip Aston

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.grinder.console.communication.ProcessControl
ProcessControl.Listener, ProcessControl.ProcessReports, ProcessControl.ProcessReportsComparator
 
Constructor Summary
ProcessControlImplementation(Timer timer, ConsoleCommunication consoleCommunication, Resources resources)
          Constructor.
 
Method Summary
 void addProcessStatusListener(ProcessControl.Listener listener)
          Add a listener for process status data.
 int getNumberOfLiveAgents()
          How many agents are live?
 void resetWorkerProcesses()
          Signal the worker processes to reset.
 void startWorkerProcesses(GrinderProperties properties)
          Signal the worker processes to start.
 void startWorkerProcessesWithDistributedFiles(Directory distributionDirectory, GrinderProperties properties)
          A variant of ProcessControl.startWorkerProcesses(net.grinder.common.GrinderProperties) that checks the properties are reasonable for the distribution directory, and adjusts the supplied properties to have the appropriate relative paths.
 void stopAgentAndWorkerProcesses()
          Signal the agent and worker processes to stop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessControlImplementation

public ProcessControlImplementation(Timer timer,
                                    ConsoleCommunication consoleCommunication,
                                    Resources resources)
Constructor.

Parameters:
timer - Timer that can be used to schedule housekeeping tasks.
consoleCommunication - The console communication handler.
resources - Resources.
Method Detail

startWorkerProcesses

public void startWorkerProcesses(GrinderProperties properties)
Signal the worker processes to start.

Specified by:
startWorkerProcesses in interface ProcessControl
Parameters:
properties - Properties that override the agent's local properties.

startWorkerProcessesWithDistributedFiles

public void startWorkerProcessesWithDistributedFiles(Directory distributionDirectory,
                                                     GrinderProperties properties)
                                              throws ConsoleException
A variant of ProcessControl.startWorkerProcesses(net.grinder.common.GrinderProperties) that checks the properties are reasonable for the distribution directory, and adjusts the supplied properties to have the appropriate relative paths.

Specified by:
startWorkerProcessesWithDistributedFiles in interface ProcessControl
Parameters:
distributionDirectory - The distribution directory.
properties - The properties. If the associated file is in the distribution, the agent doesn't reload the distributed copy. However,it uses its location to resolve any relative grinder.script path.
Throws:
ConsoleException - If the grinder.script property is set to a relative path outside of the distribution directory (e.g. ../foo.py.

resetWorkerProcesses

public void resetWorkerProcesses()
Signal the worker processes to reset.

Specified by:
resetWorkerProcesses in interface ProcessControl

stopAgentAndWorkerProcesses

public void stopAgentAndWorkerProcesses()
Signal the agent and worker processes to stop.

Specified by:
stopAgentAndWorkerProcesses in interface ProcessControl

addProcessStatusListener

public void addProcessStatusListener(ProcessControl.Listener listener)
Add a listener for process status data.

Specified by:
addProcessStatusListener in interface ProcessControl
Parameters:
listener - The listener.

getNumberOfLiveAgents

public int getNumberOfLiveAgents()
How many agents are live?

Specified by:
getNumberOfLiveAgents in interface ProcessControl
Returns:
The number of agents.


Copyright © 2000-2013. All Rights Reserved.