Package com.levigo.jadice.server.util
Class TraceListener
- java.lang.Object
-
- com.levigo.jadice.server.util.TraceListener
-
- All Implemented Interfaces:
JobListener
,EventListener
public final class TraceListener extends Object implements JobListener
Implementation of aJobListener
that will forward all incoming server messages to the client log (using levigo logging facade).- See Also:
Job.addJobListener(JobListener)
-
-
Constructor Summary
Constructors Constructor Description TraceListener()
Default Constr.TraceListener(String name)
Constructor that prefixes all log messages with the givenname
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
errorOccurred(Job job, Node node, String messageId, String message, Throwable cause)
Causes aLogger.error(String, Throwable)
.void
executionFailed(Job job, Node node, String messageId, String reason, Throwable cause)
Causes aLogger.fatal(String, Throwable)
.void
stateChanged(Job job, Job.State oldState, Job.State newState)
Causes aLogger.info(String)
.void
subPipelineCreated(Job job, Node parent, Set<? extends Node> createdNodes)
Causes aLogger.info(String)
void
warningOccurred(Job job, Node node, String messageId, String message, Throwable cause)
Causes aLogger.warn(String, Throwable)
.
-
-
-
Constructor Detail
-
TraceListener
public TraceListener()
Default Constr.
-
TraceListener
public TraceListener(String name)
Constructor that prefixes all log messages with the givenname
- Parameters:
name
- name that will be used as prefix.
-
-
Method Detail
-
warningOccurred
public void warningOccurred(Job job, Node node, String messageId, String message, Throwable cause)
Causes aLogger.warn(String, Throwable)
.- Specified by:
warningOccurred
in interfaceJobListener
- Parameters:
job
- the affected jobnode
- the node causing/issuing the warning ornull
if the failure wasn't related/caused by a particular nodemessageId
- qualified message idmessage
- the warning's detailscause
- aThrowable
-
stateChanged
public void stateChanged(Job job, Job.State oldState, Job.State newState)
Causes aLogger.info(String)
.- Specified by:
stateChanged
in interfaceJobListener
- Parameters:
job
- the affected joboldState
- the previous statenewState
- the new state
-
executionFailed
public void executionFailed(Job job, Node node, String messageId, String reason, Throwable cause)
Causes aLogger.fatal(String, Throwable)
.- Specified by:
executionFailed
in interfaceJobListener
- Parameters:
job
- the affected jobnode
- the node causing the failure ornull
if the failure wasn't related/caused by a particular nodemessageId
- qualified message idreason
- the reason of the failurecause
- aThrowable
-
errorOccurred
public void errorOccurred(Job job, Node node, String messageId, String message, Throwable cause)
Causes aLogger.error(String, Throwable)
.- Specified by:
errorOccurred
in interfaceJobListener
- Parameters:
job
- the affected jobnode
- the node causing/issuing the warning ornull
if the failure wasn't related/caused by a particular nodemessageId
- qualified message idmessage
- the warning's detailscause
- aThrowable
-
subPipelineCreated
public void subPipelineCreated(Job job, Node parent, Set<? extends Node> createdNodes)
Causes aLogger.info(String)
- Specified by:
subPipelineCreated
in interfaceJobListener
- Parameters:
job
- the affected jobparent
- The node that triggered the creation. Might benull
in cases where the parent node class is unknown on the client-side classpathcreatedNodes
- The nodes that were created
-
-