public class FlowLogger extends PhaseMonitor
PhaseMonitor
to save log for each jobflow.PhaseMonitor.JobStatus
NULL
Constructor and Description |
---|
FlowLogger(ExecutionContext context,
FlowLoggerProfile profile)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Ends the current task and notify this event to the corresponding receiver.
|
protected void |
onJobMonitorClosed(String jobId)
Notifies the job was closed.
|
protected void |
onJobMonitorOpened(String jobId)
Notifies the job was opened.
|
void |
open(double taskSize)
Begins a task and notify this event to the corresponding receiver.
|
void |
progressed(double deltaSize)
Progresses the current task and notify this event to the corresponding receiver.
|
void |
reportJobStatus(String jobId,
PhaseMonitor.JobStatus status,
Throwable cause)
Reports job status about target job ID.
|
void |
setProgress(double workedSize)
Sets the progress of current task and notify this event to the corresponding receiver.
|
checkCancelled, createJobMonitor, getJobOutput, getOutput, isCancelRequested
public FlowLogger(ExecutionContext context, FlowLoggerProfile profile)
context
- current contextprofile
- the profile for this loggerIllegalArgumentException
- if some parameters were null
public void open(double taskSize) throws IOException
ExecutionMonitor
taskSize
- the total task sizeIOException
- if failed to notify this eventpublic void progressed(double deltaSize)
ExecutionMonitor
deltaSize
- the difference of progressed task sizepublic void setProgress(double workedSize)
ExecutionMonitor
workedSize
- the absolute progressed task sizeprotected void onJobMonitorOpened(String jobId)
PhaseMonitor
onJobMonitorOpened
in class PhaseMonitor
jobId
- target job IDprotected void onJobMonitorClosed(String jobId)
PhaseMonitor
onJobMonitorClosed
in class PhaseMonitor
jobId
- target job IDpublic void reportJobStatus(String jobId, PhaseMonitor.JobStatus status, Throwable cause) throws IOException
PhaseMonitor
reportJobStatus
in class PhaseMonitor
jobId
- target job IDstatus
- the job statuscause
- occurred exception (nullable)IOException
- if failed to notify this eventpublic void close() throws IOException
ExecutionMonitor
IOException
- if failed to notify this eventCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.