net.sourceforge.jsrvany.debug
Class DebuggerThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--net.sourceforge.jsrvany.debug.DebuggerThread

public class DebuggerThread
extends java.lang.Thread

This class is a single thread started by Debugger

Copyright (c) 1999 Damian Fauth

 


Inner Class Summary
 class DebuggerThread.WorkerThread
          A separate Thread object is used to run the main class invoked by by the user
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DebuggerThread(java.net.Socket sock, Debugger debugger)
          Constructor assigning socket
 
Method Summary
protected  void enumerateListeners()
          enumerate through the listeners registered with this ServiceControlManager
 void handleServiceControlEvent(ServiceControlEvent e)
          handle a StartServiceControlEvent This method is called by the ServiceControlManager when the appropriate event occurs
protected  void performAction(int selection)
          perform the selected action
protected  int readSelection()
          accept a selection from the menu
 void run()
          run this thread
protected  void runMain()
          run the class selected
protected  void showArgs()
          run the class selected
protected  void showJVMOptions()
          show the JVM options this class will run with
protected  void showMenu()
          show the menu
protected  void stopRunning()
          signal thread to stop running
protected  void triggerEvent()
          trigger an event
protected  void write(java.lang.String message)
          write to the client
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DebuggerThread

public DebuggerThread(java.net.Socket sock,
                      Debugger debugger)
Constructor assigning socket
Parameters:
sock - is the Socket object
Method Detail

run

public void run()
run this thread
Overrides:
run in class java.lang.Thread

showMenu

protected void showMenu()
                 throws java.io.IOException
show the menu
Returns:
void
Throws:
java.io.IOException - may be thrown if there are network connectivity problems

readSelection

protected int readSelection()
                     throws java.io.IOException
accept a selection from the menu
Returns:
int being the selection as an int
Throws:
java.io.IOException - may be thrown if there are network connectivity problems

performAction

protected void performAction(int selection)
                      throws java.lang.Throwable
perform the selected action
Parameters:
int - being the selection as an int
Returns:
void
Throws:
java.lang.Throwable - may be thrown if the selected action failed

runMain

protected void runMain()
                throws java.lang.Throwable
run the class selected
Returns:
void
Throws:
java.lang.Throwable - may be thrown if the selected action failed

triggerEvent

protected void triggerEvent()
                     throws java.lang.Throwable
trigger an event
Returns:
void
Throws:
java.lang.Throwable - may be thrown if the selected action failed

showArgs

protected void showArgs()
                 throws java.io.IOException
run the class selected
Returns:
void } /** show the arguments this class will run with
Throws:
java.io.IOException - may be thrown if the client goes away?

showJVMOptions

protected void showJVMOptions()
                       throws java.lang.Exception
show the JVM options this class will run with
Returns:
void
Throws:
java.lang.Exception - may be thrown if the selected action failed

enumerateListeners

protected void enumerateListeners()
                           throws java.lang.Exception
enumerate through the listeners registered with this ServiceControlManager
Returns:
void
Throws:
java.lang.Exception - may be thrown if the selected action failed

write

protected void write(java.lang.String message)
              throws java.io.IOException
write to the client
Parameters:
message - is the message to send as a String
Returns:
void
Throws:
java.io.IOException - may be thrown if there are network connectivity problems

stopRunning

protected void stopRunning()
                    throws java.io.IOException
signal thread to stop running
Returns:
void
Throws:
java.io.IOException - may be thrown if there are network connectivity problems

handleServiceControlEvent

public void handleServiceControlEvent(ServiceControlEvent e)
                               throws ServiceControlException
handle a StartServiceControlEvent This method is called by the ServiceControlManager when the appropriate event occurs
Parameters:
e - is the event as an instance of an object extending ServiceControlEvent
Returns:
void
Throws:
ServiceControlException - may be thrown if the service cannot respond correctly to the event