R
- the request type associated to the jobpublic abstract class AbstractJobStatus<R extends Request> extends Object implements JobStatus
JobStatus
.JobStatus.State
Constructor and Description |
---|
AbstractJobStatus(R request,
JobStatus parentJobStatus,
org.xwiki.observation.ObservationManager observationManager,
LoggerManager loggerManager) |
Modifier and Type | Method and Description |
---|---|
void |
answered()
Indicate that the question has been answered.
|
void |
ask(Object question) |
boolean |
ask(Object question,
long time,
TimeUnit unit) |
Date |
getEndDate() |
Throwable |
getError() |
LogQueue |
getLog() |
List<LogEvent> |
getLog(LogLevel level)
Deprecated.
|
JobStatus |
getParentJobStatus() |
JobProgress |
getProgress() |
Object |
getQuestion() |
R |
getRequest() |
Date |
getStartDate() |
JobStatus.State |
getState() |
boolean |
isIsolated() |
boolean |
isSubJob() |
void |
setEndDate(Date endDate) |
void |
setError(Throwable error) |
void |
setIsolated(boolean isolated) |
void |
setStartDate(Date startDate) |
void |
setState(JobStatus.State state) |
void |
startListening()
Start listening to events.
|
void |
stopListening()
Stop listening to events.
|
public AbstractJobStatus(R request, JobStatus parentJobStatus, org.xwiki.observation.ObservationManager observationManager, LoggerManager loggerManager)
request
- the request provided when started the jobparentJobStatus
- the status of the parent job (i.e. the status of the job that started this one); pass
null
if this job hasn't been started by another job (i.e. if this is not a sub-job)observationManager
- the observation manager componentloggerManager
- the logger manager componentpublic void startListening()
public void stopListening()
public JobStatus.State getState()
public void setState(JobStatus.State state)
state
- the general state of the jobpublic Throwable getError()
public void setError(Throwable error)
error
- the Throwable
on which the job stoppedpublic R getRequest()
getRequest
in interface JobStatus
public LogQueue getLog()
public JobProgress getProgress()
getProgress
in interface JobStatus
public void ask(Object question) throws InterruptedException
ask
in interface JobStatus
question
- the question to ask as a Java beanInterruptedException
- if the current thread is interrupted (and interruption of thread suspension is
supported)public boolean ask(Object question, long time, TimeUnit unit) throws InterruptedException
ask
in interface JobStatus
question
- the question to ask as a Java beantime
- the maximum time to waitunit
- the time unit of the time
argumentfalse
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)public Object getQuestion()
getQuestion
in interface JobStatus
public void answered()
JobStatus
public Date getStartDate()
getStartDate
in interface JobStatus
public void setStartDate(Date startDate)
startDate
- the date and time when the job has been startedpublic Date getEndDate()
getEndDate
in interface JobStatus
public void setEndDate(Date endDate)
endDate
- the date and time when the job finishedpublic boolean isSubJob()
public boolean isIsolated()
public void setIsolated(boolean isolated)
isolated
- true if the job log should be grabbedpublic JobStatus getParentJobStatus()
null
if
the job has no parent, i.e. if the job hasn't been started by another jobCopyright © 2004–2017 XWiki. All rights reserved.