jess.server
Class DebugListener

java.lang.Object
  extended byjava.util.Observable
      extended byjess.server.DebugListener
All Implemented Interfaces:
java.util.EventListener, JessListener

public class DebugListener
extends java.util.Observable
implements JessListener

This class is part of the implementation of the JessDE debugger. It's responsible for handling breakpoints and other debugger commands.

(C) 2005 Sandia National Laboratories


Field Summary
static java.lang.String ERROR
           
static java.lang.String FACT
           
static java.lang.String OK
           
static java.lang.String PRINT
           
static java.lang.String QUIT
           
static java.lang.String RESUME
           
static java.lang.String RESUME_STEP
           
static java.lang.String STACK
           
static java.lang.String STARTED
           
static java.lang.String STOPPED
           
static java.lang.String SUSPEND
           
static java.lang.String SUSPEND_STEP
           
static java.lang.String SUSPENDED_BREAK
           
 
Constructor Summary
DebugListener()
           
DebugListener(java.io.Reader input, java.io.Writer output, java.io.Writer events)
           
 
Method Summary
 boolean commandReady()
           
 void eventHappened(JessEvent je)
          Called by a JessEvent source when something interesting happens.
 void handlePrintCommand(JessEvent je, java.lang.String command)
           
 java.lang.String readCommand()
           
 void removeBreakpoint(java.lang.String filename, int lineNumber)
           
 void reportError(java.lang.Throwable e)
           
 void sendEvent(java.lang.String event)
           
 void sendResponse(java.lang.String response)
           
 boolean shouldBreakAt(java.lang.String filename, int lineNumber)
           
 boolean waitForConnections(int debugPort, int eventPort)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STARTED

public static final java.lang.String STARTED
See Also:
Constant Field Values

STOPPED

public static final java.lang.String STOPPED
See Also:
Constant Field Values

QUIT

public static final java.lang.String QUIT
See Also:
Constant Field Values

SUSPEND

public static final java.lang.String SUSPEND
See Also:
Constant Field Values

RESUME

public static final java.lang.String RESUME
See Also:
Constant Field Values

RESUME_STEP

public static final java.lang.String RESUME_STEP
See Also:
Constant Field Values

SUSPEND_STEP

public static final java.lang.String SUSPEND_STEP
See Also:
Constant Field Values

SUSPENDED_BREAK

public static final java.lang.String SUSPENDED_BREAK
See Also:
Constant Field Values

STACK

public static final java.lang.String STACK
See Also:
Constant Field Values

ERROR

public static final java.lang.String ERROR
See Also:
Constant Field Values

OK

public static final java.lang.String OK
See Also:
Constant Field Values

PRINT

public static final java.lang.String PRINT
See Also:
Constant Field Values

FACT

public static final java.lang.String FACT
See Also:
Constant Field Values
Constructor Detail

DebugListener

public DebugListener(java.io.Reader input,
                     java.io.Writer output,
                     java.io.Writer events)

DebugListener

public DebugListener()
Method Detail

eventHappened

public void eventHappened(JessEvent je)
                   throws JessException
Description copied from interface: JessListener
Called by a JessEvent source when something interesting happens. The typical implementation of eventHappened will switch on the return value of je.getType().

Specified by:
eventHappened in interface JessListener
Parameters:
je - an event object describing the event.
Throws:
JessException - if any problem occurs during event handling.

handlePrintCommand

public void handlePrintCommand(JessEvent je,
                               java.lang.String command)
                        throws JessException
Throws:
JessException

reportError

public void reportError(java.lang.Throwable e)

sendEvent

public void sendEvent(java.lang.String event)

sendResponse

public void sendResponse(java.lang.String response)

commandReady

public boolean commandReady()
                     throws java.io.IOException
Throws:
java.io.IOException

readCommand

public java.lang.String readCommand()
                             throws java.io.IOException
Throws:
java.io.IOException

waitForConnections

public boolean waitForConnections(int debugPort,
                                  int eventPort)

removeBreakpoint

public void removeBreakpoint(java.lang.String filename,
                             int lineNumber)

shouldBreakAt

public boolean shouldBreakAt(java.lang.String filename,
                             int lineNumber)

© 2006 Sandia Corporation