jxtaimpl
Class Manager

java.lang.Object
  |
  +--jxtaimpl.Manager
All Implemented Interfaces:
Clearable, Manager

public class Manager
extends Object
implements Manager

Implementations of Manager capable to manage multiple threads.

Version:
$Revision: 1.2 $
Author:
Alberto Montresor

Field Summary
 
Fields inherited from interface anthill.nest.Manager
NAME
 
Constructor Summary
Manager(Factory factory, String component)
           
Manager(int nthreads)
          Instantiates a thread manager by creating a number of threads which will take care of the ants.
 
Method Summary
 void add(AntView view)
          Adds an ant to the queue of ants to be executed.
 void clear()
          Restores the object to its initial state.
 void execute()
          Execute an ant stored in this Manager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Manager

public Manager(int nthreads)
Instantiates a thread manager by creating a number of threads which will take care of the ants.


Manager

public Manager(Factory factory,
               String component)
Method Detail

add

public void add(AntView view)
Adds an ant to the queue of ants to be executed. The ant is enclosed in the AntView object which representes the environment in which the ant will survive.

Specified by:
add in interface Manager
Parameters:
view - the ant to be added, together with its environment

execute

public void execute()
Execute an ant stored in this Manager

Specified by:
execute in interface Manager

clear

public void clear()
Restores the object to its initial state.

Specified by:
clear in interface Clearable