lexx.plugins.ant
Class ProcessHandler

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--lexx.plugins.ant.ProcessHandler
All Implemented Interfaces:
java.lang.Runnable

public abstract class ProcessHandler
extends java.lang.Thread

This loads a process and controls the output from the screen

Copyright (c) 2002-2003

Since:
20/03/2003
Version:
1.0
Author:
Mohammed Imran

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ProcessHandler(java.lang.String commandRun, BuildProject buildProj)
          Creates a process
 
Method Summary
 int getExitValue()
          Tells you what the exit value of the process was
abstract  java.lang.String handleErrorMessage(java.lang.String message)
          Gives error message outputted by the running process
abstract  java.lang.String handleNormalMessage(java.lang.String message)
          Gives a line of text that was outputted by the running process
 void run()
          This actually runs the process
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, 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

ProcessHandler

public ProcessHandler(java.lang.String commandRun,
                      BuildProject buildProj)
Creates a process

Parameters:
commandRun - the line of code you wish to run for example 'java -cp lexx.jar lexx.RunApp'
buildProj - required for the GUI side of the process
Method Detail

handleNormalMessage

public abstract java.lang.String handleNormalMessage(java.lang.String message)
Gives a line of text that was outputted by the running process

Parameters:
message - the text output that was send
Returns:
the remaining text that you haven't analysed

getExitValue

public int getExitValue()
Tells you what the exit value of the process was

Returns:
if 0 then the process ended correctly

handleErrorMessage

public abstract java.lang.String handleErrorMessage(java.lang.String message)
Gives error message outputted by the running process

Parameters:
message - the text output that was send
Returns:
the remaining text that you haven't analysed

run

public final void run()
This actually runs the process

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread