|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xwiki.job.AbstractJob<R>
R
- the request type associated to the job@InstantiationStrategy(value=PER_LOOKUP) public abstract class AbstractJob<R extends Request>
Base class for Job
implementations.
Field Summary | |
---|---|
protected ComponentManager |
componentManager
Component manager. |
protected JobContext |
jobContext
Used to set the current context. |
protected org.slf4j.Logger |
logger
The logger to log. |
protected LoggerManager |
loggerManager
Used to isolate job related log. |
protected org.xwiki.observation.ObservationManager |
observationManager
Used to send extensions installation and upgrade related events. |
protected R |
request
The job request. |
protected org.xwiki.job.internal.AbstractJobStatus<R> |
status
|
protected org.xwiki.job.internal.JobStatusStorage |
storage
Used to store the results of the jobs execution. |
Constructor Summary | |
---|---|
AbstractJob()
|
Method Summary | |
---|---|
protected R |
castRequest(Request request)
Should be overridden if R is not Request. |
protected org.xwiki.job.internal.AbstractJobStatus<R> |
createNewStatus(R request)
|
R |
getRequest()
|
JobStatus |
getStatus()
|
protected void |
jobFinished(Throwable exception)
Called when the job is done. |
protected void |
jobStarting()
Called when the job is starting. |
void |
join()
Causes the current thread to wait until this job has FINSHED state. |
boolean |
join(long time,
TimeUnit unit)
Causes the current thread to wait until this job has FINSHED state. |
protected void |
notifyPopLevelProgress()
Pop progression level. |
protected void |
notifyPushLevelProgress(int steps)
Push new progression level. |
protected void |
notifyStepPropress()
Next step. |
protected abstract void |
start()
Should be implemented by Job implementations. |
void |
start(Request request)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xwiki.job.Job |
---|
getType |
Field Detail |
---|
@Inject protected ComponentManager componentManager
@Inject protected org.xwiki.observation.ObservationManager observationManager
@Inject protected LoggerManager loggerManager
@Inject protected org.xwiki.job.internal.JobStatusStorage storage
@Inject protected org.slf4j.Logger logger
@Inject protected JobContext jobContext
protected R extends Request request
protected org.xwiki.job.internal.AbstractJobStatus<R extends Request> status
getStatus()
Constructor Detail |
---|
public AbstractJob()
Method Detail |
---|
public R getRequest()
getRequest
in interface Job
public JobStatus getStatus()
getStatus
in interface Job
public void start(Request request)
start
in interface Job
request
- start the job with provided requestprotected void jobStarting()
protected void jobFinished(Throwable exception)
exception
- the exception throw during execution of the jobprotected R castRequest(Request request)
request
- the request
protected org.xwiki.job.internal.AbstractJobStatus<R> createNewStatus(R request)
request
- contains information related to the job to execute
protected void notifyPushLevelProgress(int steps)
steps
- number of steps in this new levelprotected void notifyStepPropress()
protected void notifyPopLevelProgress()
protected abstract void start() throws Exception
Job
implementations.
Exception
- errors during job executionpublic void join() throws InterruptedException
Job
join
in interface Job
InterruptedException
- if any thread has interrupted the current thread. The interrupted status of
the current thread is cleared when this exception is thrown.public boolean join(long time, TimeUnit unit) throws InterruptedException
Job
join
in interface Job
time
- the maximum time to waitunit
- the time unit of the time
argument
false
if the waiting time detectably elapsed before return from the method, else true
InterruptedException
- if the current thread is interrupted (and interruption of thread suspension is
supported)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |