public class BasicJob extends Object implements Job
Constructor and Description |
---|
BasicJob(Request request,
Handleable handler,
Priority priority,
Priority priorityFloor,
Queue<Job> queue)
Constructs a basic job.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Job job) |
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 |
getTryCount()
Get attempt number of this job.
|
void |
reQueue()
Remove any existing in queue, downgrades the priority and
adds the job back into queue.
|
public BasicJob(Request request, Handleable handler, Priority priority, Priority priorityFloor, Queue<Job> queue)
request
- The request of this job.handler
- The handler of this job.priority
- The priority of this job.priorityFloor
- The priority floor of this job.queue
- The queue for this job.public final Request getRequest()
Job
getRequest
in interface Job
public final Handleable getHandler()
Job
If handler is null, routed handler will be used to assign a handler to the response, based on its criteria.
getHandler
in interface Job
public final Priority getPriority()
Job
getPriority
in interface Job
public final void reQueue()
Job
public final int getTryCount()
Job
getTryCount
in interface Job
public final int compareTo(@Nonnull Job job)
compareTo
in interface Comparable<Job>
Copyright © 2018. All rights reserved.