public class TaskFuture extends Object
| Modifier and Type | Field and Description |
|---|---|
private CountDownLatch |
cdl
阻塞调用线程.
|
private AtomicLong |
count
已经处理的记录数
|
private ITask<?> |
task
被执行的任务
|
private ThreadPool |
threadPool
执行处理的线程池
|
private long |
total
需要处理的总记录数
|
| Constructor and Description |
|---|
TaskFuture(long total,
ThreadPool threadPool,
ITask<?> task) |
| Modifier and Type | Method and Description |
|---|---|
void |
await() |
void |
down(int count) |
long |
getCount() |
String |
getProgress() |
long |
getTotal() |
void |
incrCount(int count) |
boolean |
isDone()
当然任务是否已经完成
|
String |
toString() |
private long total
private CountDownLatch cdl
private AtomicLong count
private ThreadPool threadPool
private ITask<?> task
public TaskFuture(long total,
ThreadPool threadPool,
ITask<?> task)
public String getProgress()
public boolean isDone()
public void await()
throws InterruptedException
InterruptedExceptionpublic void down(int count)
public void incrCount(int count)
public long getTotal()
public long getCount()
Copyright © 2015. All rights reserved.