Package com.google.gerrit.server.git
Class WorkQueue.Task<V>
- java.lang.Object
-
- com.google.gerrit.server.git.WorkQueue.Task<V>
-
- All Implemented Interfaces:
Comparable<Delayed>
,Runnable
,Delayed
,Future<V>
,RunnableFuture<V>
,RunnableScheduledFuture<V>
,ScheduledFuture<V>
- Direct Known Subclasses:
WorkQueue.ProjectTask
- Enclosing class:
- WorkQueue
public static class WorkQueue.Task<V> extends Object implements RunnableScheduledFuture<V>
A wrapper around a scheduled Runnable, as maintained in the queue.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WorkQueue.Task.State
Summarized status of a single task.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel(boolean mayInterruptIfRunning)
int
compareTo(Delayed o)
V
get()
V
get(long timeout, TimeUnit unit)
long
getDelay(TimeUnit unit)
String
getQueueName()
Date
getStartTime()
WorkQueue.Task.State
getState()
int
getTaskId()
boolean
isCancelled()
boolean
isDone()
boolean
isPeriodic()
void
run()
String
toString()
-
-
-
Method Detail
-
getTaskId
public int getTaskId()
-
getState
public WorkQueue.Task.State getState()
-
getStartTime
public Date getStartTime()
-
getQueueName
public String getQueueName()
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
compareTo
public int compareTo(Delayed o)
- Specified by:
compareTo
in interfaceComparable<V>
-
get
public V get() throws InterruptedException, ExecutionException
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
-
get
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfaceFuture<V>
-
isPeriodic
public boolean isPeriodic()
- Specified by:
isPeriodic
in interfaceRunnableScheduledFuture<V>
-
run
public void run()
- Specified by:
run
in interfaceRunnable
- Specified by:
run
in interfaceRunnableFuture<V>
-
-