| Constructor and Description |
|---|
BasicFakeFutureJob(Job<Request> job) |
| Modifier and Type | Method and Description |
|---|---|
void |
addThread(Thread thread)
Adds the thread that is running this job.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
int |
compareTo(Job o) |
Request |
get() |
Request |
get(long timeout,
TimeUnit unit) |
Handleable |
getHandler()
Get the handler to handle the response of the job.
|
Priority |
getPriority()
Get the current priority set for this job.
|
Request |
getRequest()
Get the request of this job.
|
int |
getThreadCount()
Get count of threads that are still running this job.
|
int |
getTryCount()
Get attempt number of this job.
|
boolean |
isCancelled() |
boolean |
isDone() |
void |
removeThread(Thread thread)
Remove the thread that have finished processing this job.
|
void |
reQueue()
Remove any existing in queue, downgrades the priority and
adds the job back into queue.
|
void |
set(Request result)
Sets the result of this future to the given value unless
this future has already been set or has been cancelled.
|
public Request getRequest()
JobgetRequest in interface Job<Request>public Handleable getHandler()
JobIf handler is null, routed handler will be used to assign a handler to the response, based on its criteria.
getHandler in interface Job<Request>public Priority getPriority()
JobgetPriority in interface Job<Request>public void reQueue()
FutureJob
Does nothing if isDone() == true or isCancelled() == true
or getThreadCount > 0
public int getTryCount()
JobgetTryCount in interface Job<Request>public int compareTo(@Nonnull Job o)
compareTo in interface Comparable<Job>public void addThread(Thread thread)
FutureJobpublic void removeThread(Thread thread)
FutureJobremoveThread in interface FutureJob<Request>thread - The thread that has finished this job.public int getThreadCount()
FutureJobgetThreadCount in interface FutureJob<Request>public void set(Request result)
FutureJobpublic boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<Request>Copyright © 2018. All rights reserved.