sdt.net
Class Pool

java.lang.Object
  |
  +--sdt.net.Pool

public class Pool
extends java.lang.Object


Constructor Summary
Pool(int pool_port)
          instantiates a pool with by listening on the specified port for incoming connections.
Pool(int pool_port, OutputObserver[] obs)
          instantiates a pool with by listening on the specified port for incoming connections.
 
Method Summary
 Job addJob(Task tobj, Result result, java.lang.String task_name, java.lang.String result_name)
          add a job to the pool.
protected  void finalize()
          For garbage collection
 Job getJob()
          removes a task from the head of the waiting queue for evaluation.
 int getRunningSize()
          returns the size of the running queue.
 int getWaitingSize()
          returns the size of the waiting queue.
 void returnToPool(Job job)
          returns a job to the pool if a connection fails.
 void setGranularity(int no)
          ??
 void start()
          starts the manager thread.
 void updateJobStatus(Job job)
          Once a job is selected for evaluation, the job is removed from the waiting queue and placed on the running queue.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pool

public Pool(int pool_port)
instantiates a pool with by listening on the specified port for incoming connections.

Pool

public Pool(int pool_port,
            OutputObserver[] obs)
instantiates a pool with by listening on the specified port for incoming connections.
Method Detail

start

public void start()
starts the manager thread.

setGranularity

public void setGranularity(int no)
??

getWaitingSize

public int getWaitingSize()
returns the size of the waiting queue.

getRunningSize

public int getRunningSize()
returns the size of the running queue.

addJob

public Job addJob(Task tobj,
                  Result result,
                  java.lang.String task_name,
                  java.lang.String result_name)
add a job to the pool.

returnToPool

public void returnToPool(Job job)
returns a job to the pool if a connection fails.

getJob

public Job getJob()
removes a task from the head of the waiting queue for evaluation.

updateJobStatus

public void updateJobStatus(Job job)
Once a job is selected for evaluation, the job is removed from the waiting queue and placed on the running queue.

finalize

protected void finalize()
                 throws java.lang.Throwable
For garbage collection
Overrides:
finalize in class java.lang.Object