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)
Deprecated.
since 9.2RC1, use
AbstractJobStatus(String, Request, JobStatus, ObservationManager, LoggerManager) instead |
AbstractJobStatus(String jobType,
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() |
String |
getJobType() |
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.
|
@Deprecated public AbstractJobStatus(R request, JobStatus parentJobStatus, org.xwiki.observation.ObservationManager observationManager, LoggerManager loggerManager)
AbstractJobStatus(String, Request, JobStatus, ObservationManager, LoggerManager) insteadrequest - 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 AbstractJobStatus(String jobType, R request, JobStatus parentJobStatus, org.xwiki.observation.ObservationManager observationManager, LoggerManager loggerManager)
jobType - the type of the jobrequest - 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 String getJobType()
getJobType in interface JobStatuspublic 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 JobStatuspublic LogQueue getLog()
public JobProgress getProgress()
getProgress in interface JobStatuspublic void ask(Object question) throws InterruptedException
ask in interface JobStatusquestion - 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 JobStatusquestion - 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 trueInterruptedException - if the current thread is interrupted (and interruption of thread suspension is
supported)public Object getQuestion()
getQuestion in interface JobStatuspublic void answered()
JobStatuspublic Date getStartDate()
getStartDate in interface JobStatuspublic void setStartDate(Date startDate)
startDate - the date and time when the job has been startedpublic Date getEndDate()
getEndDate in interface JobStatuspublic 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.