org.jcoderz.commons.tracing
Interface Tracer

All Known Implementing Classes:
JulTimingTracer, JulTracer, Slf4jTracer

public interface Tracer

Interface for classes that collect tracing information about a certain class. Instances must also hold a static factory method that returns a specific tracer, with a given name

   public static Tracer getTracer(String className);
 
the returned tracer must be multi-thread-save.

Author:
Andreas Mandel

Nested Class Summary
static interface Tracer.TracingToken
           
 
Method Summary
 Tracer.TracingToken entering(String className, String methodName)
          A null return value is a indication that tracing is currently not enabled.
 Tracer.TracingToken entering(String className, String methodName, Object argument)
           
 Tracer.TracingToken entering(String className, String methodName, Object[] arguments)
           
 void exiting(Tracer.TracingToken token)
           
 void exiting(Tracer.TracingToken token, Object result)
           
 boolean isTracing()
           
 boolean isTracingArguments()
          Indicates if the tracer is evaluating the contents of the arguments.
 void throwing(Tracer.TracingToken token, Throwable thrown)
           
 

Method Detail

isTracing

boolean isTracing()

isTracingArguments

boolean isTracingArguments()
Indicates if the tracer is evaluating the contents of the arguments. Otherwise the entering/exiting method without the arguments / result can be called by the traced code. This value can change during runtime, but it is only needed to check this once, before the entering call.

Returns:
true, if the tracer is evaluating the contents of the arguments.

entering

Tracer.TracingToken entering(String className,
                             String methodName)

A null return value is a indication that tracing is currently not enabled.

Parameters:
className - name of the class
methodName - name of the method entered.
Returns:
a token, holding the context for the followup exiting / throwing call.

entering

Tracer.TracingToken entering(String className,
                             String methodName,
                             Object argument)

entering

Tracer.TracingToken entering(String className,
                             String methodName,
                             Object[] arguments)

exiting

void exiting(Tracer.TracingToken token)

exiting

void exiting(Tracer.TracingToken token,
             Object result)

throwing

void throwing(Tracer.TracingToken token,
              Throwable thrown)


Copyright 2007 The jCoderZ Project.