org.codehaus.plexus.taskqueue
Interface TaskQueue

All Known Implementing Classes:
DefaultTaskQueue

public interface TaskQueue

Version:
$Id: TaskQueue.java 3681 2006-08-26 02:21:05Z kenney $
Author:
Jason van Zyl, Trygve Laugstøl

Field Summary
static java.lang.String ROLE
           
 
Method Summary
 java.util.List getQueueSnapshot()
           
 Task poll(int timeout, edu.emory.mathcs.backport.java.util.concurrent.TimeUnit timeUnit)
          Retrieves and removes the head of the queue, waiting at most timeout timeUnit when no element is available.
 boolean put(Task task)
           
 Task take()
           
 

Field Detail

ROLE

public static final java.lang.String ROLE
Method Detail

put

public boolean put(Task task)
            throws TaskQueueException
Parameters:
task - The task to add to the queue.
Returns:
Returns true if the task was accepted into the queue.
Throws:
TaskQueueException

take

public Task take()
          throws TaskQueueException
Throws:
TaskQueueException

getQueueSnapshot

public java.util.List getQueueSnapshot()
                                throws TaskQueueException
Throws:
TaskQueueException

poll

public Task poll(int timeout,
                 edu.emory.mathcs.backport.java.util.concurrent.TimeUnit timeUnit)
          throws java.lang.InterruptedException
Retrieves and removes the head of the queue, waiting at most timeout timeUnit when no element is available.

Parameters:
timeout - time to wait, in timeUnit units
timeUnit - how to interpret the timeout parameter.
Returns:
the head of the queue, or null if the timeout elapsed
Throws:
java.lang.InterruptedException - when this thread is interrupted while waiting


Copyright © 2001-2008 Codehaus. All Rights Reserved.