org.jgap.distr
Class Master
- java.lang.Object
-
- org.jgap.distr.Master
-
public abstract class Master extends java.lang.ObjectRepresents an IMaster instance. Distributes work to IWorker instances. Allows to receive new tasks and send them to the workers when applicable.- Since:
- 2.3
-
-
Constructor Summary
Constructors Constructor and Description Master(RequestDispatcher a_dispatcher, WorkerListener a_workerListener)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description RequestDispatchergetDispatcher()MasterInfogetMasterInfo()WorkerListenergetWorkerListener()voidsendToWorker(IWorker a_worker, WorkerCommand a_command)Sends a command to a worker.abstract voidstart()Starts the master listener.voidstop()Stops the master from being working.
-
-
-
Constructor Detail
-
Master
public Master(RequestDispatcher a_dispatcher, WorkerListener a_workerListener) throws java.lang.Exception
Constructor.- Parameters:
a_dispatcher- the dispatcher to use for requests to workersa_workerListener- the listener to use for listening to worker messages- Throws:
java.lang.Exception- Since:
- 2.4
-
-
Method Detail
-
start
public abstract void start() throws java.lang.ExceptionStarts the master listener. Implement in specific implementations of Master.- Throws:
java.lang.Exception- Since:
- 2.4
-
stop
public void stop()
Stops the master from being working.
-
getMasterInfo
public MasterInfo getMasterInfo()
- Returns:
- information about this master
- Since:
- 2.4
-
sendToWorker
public void sendToWorker(IWorker a_worker, WorkerCommand a_command) throws java.io.IOException
Sends a command to a worker.- Parameters:
a_worker- the worker to send the command toa_command- the command to send- Throws:
java.io.IOException
-
getDispatcher
public RequestDispatcher getDispatcher()
- Returns:
- the RequestDispatcher used
- Since:
- 2.4
-
getWorkerListener
public WorkerListener getWorkerListener()
- Returns:
- the WorkerListener used
- Since:
- 2.4
-
-
DMelt 3.0 © DataMelt by jWork.ORG