org.codehaus.plexus.taskqueue
Class DefaultTaskQueue
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.codehaus.plexus.taskqueue.DefaultTaskQueue
- All Implemented Interfaces:
- org.codehaus.plexus.personality.plexus.lifecycle.phase.Configurable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, org.codehaus.plexus.logging.LogEnabled, TaskQueue
- public class DefaultTaskQueue
- extends org.codehaus.plexus.logging.AbstractLogEnabled
- implements TaskQueue, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Configurable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
- Version:
- $Id: DefaultTaskQueue.java 5371 2007-01-05 13:04:30Z evenisse $
- Author:
- Jason van Zyl, Trygve Laugstøl
Fields inherited from interface org.codehaus.plexus.taskqueue.TaskQueue |
ROLE |
Method Summary |
void |
configure(org.codehaus.plexus.configuration.PlexusConfiguration config)
|
protected void |
configureEntryEvaluator(org.codehaus.plexus.configuration.PlexusConfiguration config)
|
protected void |
configureExitEvaluator(org.codehaus.plexus.configuration.PlexusConfiguration config)
|
protected void |
configureViabilityEvaluator(org.codehaus.plexus.configuration.PlexusConfiguration config)
|
void |
contextualize(org.codehaus.plexus.context.Context context)
|
java.util.List |
getQueueSnapshot()
|
void |
initialize()
|
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()
|
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultTaskQueue
public DefaultTaskQueue()
contextualize
public void contextualize(org.codehaus.plexus.context.Context context)
throws org.codehaus.plexus.context.ContextException
- Specified by:
contextualize
in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
- Throws:
org.codehaus.plexus.context.ContextException
configure
public void configure(org.codehaus.plexus.configuration.PlexusConfiguration config)
throws org.codehaus.plexus.configuration.PlexusConfigurationException
- Specified by:
configure
in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Configurable
- Throws:
org.codehaus.plexus.configuration.PlexusConfigurationException
initialize
public void initialize()
throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
- Specified by:
initialize
in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
- Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
put
public boolean put(Task task)
throws TaskQueueException
- Specified by:
put
in interface TaskQueue
- 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
- Specified by:
take
in interface TaskQueue
- Throws:
TaskQueueException
poll
public Task poll(int timeout,
edu.emory.mathcs.backport.java.util.concurrent.TimeUnit timeUnit)
throws java.lang.InterruptedException
- Description copied from interface:
TaskQueue
- Retrieves and removes the head of the queue, waiting at most timeout timeUnit when no element is available.
- Specified by:
poll
in interface TaskQueue
- Parameters:
timeout
- time to wait, in timeUnit unitstimeUnit
- 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
getQueueSnapshot
public java.util.List getQueueSnapshot()
throws TaskQueueException
- Specified by:
getQueueSnapshot
in interface TaskQueue
- Throws:
TaskQueueException
configureEntryEvaluator
protected void configureEntryEvaluator(org.codehaus.plexus.configuration.PlexusConfiguration config)
throws org.codehaus.plexus.configuration.PlexusConfigurationException
- Throws:
org.codehaus.plexus.configuration.PlexusConfigurationException
configureExitEvaluator
protected void configureExitEvaluator(org.codehaus.plexus.configuration.PlexusConfiguration config)
throws org.codehaus.plexus.configuration.PlexusConfigurationException
- Throws:
org.codehaus.plexus.configuration.PlexusConfigurationException
configureViabilityEvaluator
protected void configureViabilityEvaluator(org.codehaus.plexus.configuration.PlexusConfiguration config)
throws org.codehaus.plexus.configuration.PlexusConfigurationException
- Throws:
org.codehaus.plexus.configuration.PlexusConfigurationException
Copyright © 2001-2007 Codehaus. All Rights Reserved.