ist.palcom.debugging
Class DebugDispatcher

java.lang.Object
  extended by ist.palcom.debugging.DebugDispatcher

public class DebugDispatcher
extends java.lang.Object

A class for dispatching debugging/tracing messages from anywhere to interested listeners, if any. The current motivation for this class is the desire to turn on/off debugging messages from within the Eclipse Browser. The singleton object to be used is instantiated lazily, and accessed through the static getInstance(); For convenience, there is a static method, debug(String msg), which calls putMessage() on the singleton instance. Future functionality would include categories and priority levels for messages.


Field Summary
static int CAT_ASSEMBLY
           
static int CAT_BROWSER
           
static int CAT_COMMUNICATION
           
static int CAT_EDITOR
           
static int CAT_RESOURCE
           
static int CAT_SERVICE
           
static int CAT_SWCOMP
           
static int CAT_SYSTEM
           
static int CAT_UPDATE
           
 
Constructor Summary
DebugDispatcher()
           
 
Method Summary
static void debug(java.lang.String msg)
           
static void debug(java.lang.String msg, int category)
           
static DebugDispatcher getDefault()
          Returns the singleton instance.
 void putMessage(java.lang.String msg)
           
 void registerDebugListener(DebugListener d)
           
 void removeDebugListener(DebugListener d)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAT_COMMUNICATION

public static final int CAT_COMMUNICATION
See Also:
Constant Field Values

CAT_SYSTEM

public static final int CAT_SYSTEM
See Also:
Constant Field Values

CAT_ASSEMBLY

public static final int CAT_ASSEMBLY
See Also:
Constant Field Values

CAT_SWCOMP

public static final int CAT_SWCOMP
See Also:
Constant Field Values

CAT_RESOURCE

public static final int CAT_RESOURCE
See Also:
Constant Field Values

CAT_SERVICE

public static final int CAT_SERVICE
See Also:
Constant Field Values

CAT_BROWSER

public static final int CAT_BROWSER
See Also:
Constant Field Values

CAT_EDITOR

public static final int CAT_EDITOR
See Also:
Constant Field Values

CAT_UPDATE

public static final int CAT_UPDATE
See Also:
Constant Field Values
Constructor Detail

DebugDispatcher

public DebugDispatcher()
Method Detail

registerDebugListener

public void registerDebugListener(DebugListener d)

removeDebugListener

public void removeDebugListener(DebugListener d)

putMessage

public void putMessage(java.lang.String msg)

getDefault

public static DebugDispatcher getDefault()
Returns the singleton instance.


debug

public static void debug(java.lang.String msg)

debug

public static void debug(java.lang.String msg,
                         int category)