FileDocCategorySizeDatePackage
LiveTracer.javaAPI DocphoneME MR2 API (J2ME)2274Wed May 02 18:00:00 BST 2007com.sun.midp.util

LiveTracer

public class LiveTracer extends Object
A simple tracing mechanism that's useful for i3 tests to get calls when a particular tracepoint is hit.

Fields Summary
Hashtable
listeners
Constructors Summary
Methods Summary
public voidadd(java.lang.String tag, LiveTraceListener l)
Registers a listener for tracepoints identified by this tag. When a tracepoint is hit whose tag matches this one, the listener is called. Replaces any listener that might already exist for this tag.


                                           
          
        listeners.put(tag, l);
    
public voidclear()
Clears all listeners from the tracer.

        listeners.clear();
    
public voidremove(java.lang.String tag)
Unregisters the indicated listener from the tracer.

        listeners.remove(tag);
    
public voidtrace(java.lang.String tag)
Indicates a tracepoint identified by this tag. If there is a listener registered for this tag, the listener is called.

        LiveTraceListener l = 
            (LiveTraceListener)listeners.get(tag);

        if (l != null) {
            l.call(tag);
        }