public final class TraceListener extends Object implements JobListener
Implementation of a JobListener
that will forward all incoming server messages to the
client log (using levigo logging facade).
Job.addJobListener(JobListener)
Constructor and Description |
---|
TraceListener()
Default Constr.
|
TraceListener(String name)
Constructor that prefixes all log messages with the given
name |
Modifier and Type | Method and Description |
---|---|
void |
errorOccurred(Job job,
Node node,
String messageId,
String message,
Throwable cause)
Causes a
Log#error(Object, Throwable) . |
void |
executionFailed(Job job,
Node node,
String messageId,
String reason,
Throwable cause)
Causes a
Log#fatal(Object, Throwable) . |
void |
stateChanged(Job job,
Job.State oldState,
Job.State newState)
Causes a
Log#info(Object) . |
void |
subPipelineCreated(Job job,
Node parent,
Set<? extends Node> createdNodes)
Causes a
Log#info(Object) |
void |
warningOccurred(Job job,
Node node,
String messageId,
String message,
Throwable cause)
Causes a
Log#warn(Object, Throwable) . |
public TraceListener()
public TraceListener(String name)
name
name
- name that will be used as prefix.public void warningOccurred(Job job, Node node, String messageId, String message, Throwable cause)
Log#warn(Object, Throwable)
.warningOccurred
in interface JobListener
job
- the affected jobnode
- the node causing/issuing the warning or null
if
the failure wasn't related/caused by a particular nodemessage
- the warning's detailspublic void stateChanged(Job job, Job.State oldState, Job.State newState)
Log#info(Object)
.stateChanged
in interface JobListener
job
- the affected joboldState
- the previous statenewState
- the new statepublic void executionFailed(Job job, Node node, String messageId, String reason, Throwable cause)
Log#fatal(Object, Throwable)
.executionFailed
in interface JobListener
job
- the affected jobnode
- the node causing the failure or null
if the
failure wasn't related/caused by a particular nodereason
- the reason of the failurepublic void errorOccurred(Job job, Node node, String messageId, String message, Throwable cause)
Log#error(Object, Throwable)
.errorOccurred
in interface JobListener
job
- the affected jobnode
- the node causing/issuing the warning or null
if
the failure wasn't related/caused by a particular nodemessage
- the warning's detailspublic void subPipelineCreated(Job job, Node parent, Set<? extends Node> createdNodes)
Log#info(Object)
subPipelineCreated
in interface JobListener
job
- the affected jobparent
- The node that triggered the creation.
Might be null
in cases where the parent node class is unknown
on the client-side classpathcreatedNodes
- The nodes that were createdCopyright © 2017 levigo holding gmbh. All rights reserved.