org.jgap.distr
Class Worker
- java.lang.Object
-
- org.jgap.distr.Worker
-
- All Implemented Interfaces:
- IWorker
public class Worker extends java.lang.Object implements IWorker
Worker implementation. A worker receives commands from an IMaster instance and returns results to the master. A worker can receive commands even when it is working but it can only work on one task at a time.- Since:
- 2.4
-
-
Constructor Summary
Constructors Constructor and Description Worker(java.lang.String a_displayName, MasterInfo a_master, MasterListener a_masterListener)Construct the worker and tell him who his master is.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetDisplayName()java.lang.ObjectgetStatus()java.lang.Objectpause()Forces the worker to pause its work (can be resumed)java.lang.Objectresume()Forces the worker to resume a paused workjava.lang.ObjectsendCommand(WorkerCommand a_command)Lets a server send a command to process to the workerjava.lang.Objectstop()Forces the worker to stop its work (cannot be resumed)
-
-
-
Constructor Detail
-
Worker
public Worker(java.lang.String a_displayName, MasterInfo a_master, MasterListener a_masterListener)Construct the worker and tell him who his master is.- Parameters:
a_displayName- name for imformative purposea_master- the master of this workera_masterListener- listener for requests from master- Since:
- 2.4
-
-
Method Detail
-
getDisplayName
public java.lang.String getDisplayName()
- Specified by:
getDisplayNamein interfaceIWorker- Returns:
- display name of the worker
- Since:
- 2.4
-
sendCommand
public java.lang.Object sendCommand(WorkerCommand a_command)
Lets a server send a command to process to the worker- Specified by:
sendCommandin interfaceIWorker- Parameters:
a_command- the command to process- Returns:
- status message
- Since:
- 2.4
-
getStatus
public java.lang.Object getStatus()
-
pause
public java.lang.Object pause()
Forces the worker to pause its work (can be resumed)
-
stop
public java.lang.Object stop()
Forces the worker to stop its work (cannot be resumed)
-
-
DMelt 3.0 © DataMelt by jWork.ORG