public class JobMonitor extends Object implements ExecutionMonitor
NULL
Constructor and Description |
---|
JobMonitor(PhaseMonitor parent,
String jobId,
double taskSizeInParent)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
checkCancelled()
Raise
InterruptedException if cancel has been requested. |
void |
close()
Ends the current task and notify this event to the corresponding receiver.
|
OutputStream |
getOutput()
Returns output stream for extra information.
|
void |
open(double taskSize)
Begins a task and notify this event to the corresponding receiver.
|
void |
progressed(double size)
Progresses the current task and notify this event to the corresponding receiver.
|
void |
setProgress(double workedSize)
Sets the progress of current task and notify this event to the corresponding receiver.
|
public JobMonitor(PhaseMonitor parent, String jobId, double taskSizeInParent)
parent
- the parent monitorjobId
- target job IDtaskSizeInParent
- total task size in the parent for this monitorIllegalArgumentException
- if parent
is null
public void checkCancelled() throws InterruptedException
ExecutionMonitor
InterruptedException
if cancel has been requested.checkCancelled
in interface ExecutionMonitor
InterruptedException
- if cencel requestedpublic void open(double taskSize) throws IOException
open
in interface ExecutionMonitor
taskSize
- the total task sizeIOException
- if failed to notify this eventIllegalArgumentException
- if some parameters were null
public void progressed(double size) throws IOException
ExecutionMonitor
progressed
in interface ExecutionMonitor
size
- the difference of progressed task sizeIOException
- if failed to notify this eventpublic void setProgress(double workedSize) throws IOException
ExecutionMonitor
setProgress
in interface ExecutionMonitor
workedSize
- the absolute progressed task sizeIOException
- if failed to notify this eventpublic OutputStream getOutput() throws IOException
ExecutionMonitor
getOutput
in interface ExecutionMonitor
IOException
- if failed to prepare the outputpublic void close() throws IOException
ExecutionMonitor
close
in interface ExecutionMonitor
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if failed to notify this eventCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.