public abstract class PhaseMonitor extends Object implements ExecutionMonitor
Modifier and Type | Class and Description |
---|---|
static class |
PhaseMonitor.JobStatus
Job statuses.
|
Modifier and Type | Field and Description |
---|---|
static PhaseMonitor |
NULL
An empty implementation.
|
Constructor and Description |
---|
PhaseMonitor() |
Modifier and Type | Method and Description |
---|---|
void |
checkCancelled()
Raise
InterruptedException if cancel has been requested. |
ExecutionMonitor |
createJobMonitor(String jobId,
double childTaskSize)
Creates a new child task monitor with the specified task size.
|
protected OutputStream |
getJobOutput(String jobId)
Returns an output stream for jobs.
|
OutputStream |
getOutput()
Returns output stream for extra information.
|
protected boolean |
isCancelRequested()
Returns whether this phase execution has been requested cancel.
|
protected void |
onJobMonitorClosed(String jobId)
Notifies the job was closed.
|
protected void |
onJobMonitorOpened(String jobId)
Notifies the job was opened.
|
abstract void |
reportJobStatus(String jobId,
PhaseMonitor.JobStatus status,
Throwable cause)
Reports job status about target job ID.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, open, progressed, setProgress
public static final PhaseMonitor NULL
public void checkCancelled() throws InterruptedException
ExecutionMonitor
InterruptedException
if cancel has been requested.checkCancelled
in interface ExecutionMonitor
InterruptedException
- if cencel requestedprotected boolean isCancelRequested()
false
.true
to cancel requested, false
otherwisepublic OutputStream getOutput() throws IOException
ExecutionMonitor
getOutput
in interface ExecutionMonitor
IOException
- if failed to prepare the outputpublic ExecutionMonitor createJobMonitor(String jobId, double childTaskSize)
jobId
- target job IDchildTaskSize
- task size in this monitor to assign to the child monitorIllegalArgumentException
- if some parameters were null
public abstract void reportJobStatus(String jobId, PhaseMonitor.JobStatus status, Throwable cause) throws IOException
jobId
- target job IDstatus
- the job statuscause
- occurred exception (nullable)IllegalArgumentException
- if some parameters were null
IOException
- if failed to notify this eventprotected void onJobMonitorOpened(String jobId) throws IOException
jobId
- target job IDIOException
- if failed to notify this eventprotected OutputStream getJobOutput(String jobId) throws IOException
this.getOutput()
.jobId
- target job IDIOException
- if failed to obtain outputprotected void onJobMonitorClosed(String jobId) throws IOException
jobId
- target job IDIOException
- if failed to notify this eventCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.