Language
The Free and Open Productivity Suite
complexlib
Class MethodThread
java.lang.Object
|
+--java.lang.Thread
|
+--complexlib.MethodThread
- All Implemented Interfaces:
- Runnable
- public class MethodThread
- extends Thread
Invoke a method of a class in an own thread. Provide a method to end
the thread.
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, 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 |
MethodThread
public MethodThread(Method testMethod,
Object invokeClass,
PrintWriter log)
- Constructor.
- Parameters:
testMethod
- The method that will be invoked.invokeClass
- The class where the method is invoked.log
- The logging mechanism.
run
public void run()
- Invoke the method.
- Overrides:
run
in class Thread
getErrorMessage
public String getErrorMessage()
- Get the error message
- Returns:
- The error message.
hasErrorMessage
public boolean hasErrorMessage()
- Is there an error message?
- Returns:
- True, if an error did happen.
destroy
public void destroy()
- Stop the running method.
- Overrides:
destroy
in class Thread