org.objectweb.proactive.core.body.ft.servers.util
Class ActiveQueue

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.objectweb.proactive.core.body.ft.servers.util.ActiveQueue
All Implemented Interfaces:
java.lang.Runnable

public class ActiveQueue
extends java.lang.Thread

This class is a generic job queue.

Since:
3.0
Author:
cdelbe

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ActiveQueue(java.lang.String name)
           
 
Method Summary
 void addJob(ActiveQueueJob j)
          Add a job in the active queue.
 JobBarrier addJobWithBarrier(ActiveQueueJob j)
          Add a job in the active queue.
 java.util.ArrayList getQueue()
          return the current queue of jobs to perform
 void killMe()
          Stop the thread.
 ActiveQueueJob removeJob()
          Return the oldest job in queue and remove it from the queue
 void run()
          The run method of the thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActiveQueue

public ActiveQueue(java.lang.String name)
Method Detail

getQueue

public java.util.ArrayList getQueue()
return the current queue of jobs to perform

Returns:
the current queue of jobs to perform

addJob

public void addJob(ActiveQueueJob j)
Add a job in the active queue.

Parameters:
j - the job to add.

addJobWithBarrier

public JobBarrier addJobWithBarrier(ActiveQueueJob j)
Add a job in the active queue. A barrier is created for this job; waiting on this barrier is blocking until the job j ends.

Parameters:
j - the job to add.
Returns:
a barrier on the job j;

removeJob

public ActiveQueueJob removeJob()
Return the oldest job in queue and remove it from the queue

Returns:
the oldest job in queue and remove it from the queue

killMe

public void killMe()
Stop the thread.


run

public void run()
The run method of the thread. Serve jobs in a FIFO manner until killMe() is called.



Copyright 2001-2005 INRIA All Rights Reserved.