Package org.svvrl.goal.core.util
Class ThreadWrapper<T extends java.lang.Thread>
java.lang.Object
org.svvrl.goal.core.util.ThreadWrapper<T>
- Type Parameters:
T
- the type of the thread
public class ThreadWrapper<T extends java.lang.Thread>
extends java.lang.Object
Deprecated.
a thread won't be terminated externally
This is a wrapper of a thread. You can set a timeout for the wrapper. After
timeout, the inner thread will be terminated.
- Author:
- Ming-Hsien Tsai
-
Constructor Summary
Constructors Constructor Description ThreadWrapper()
Deprecated.Constructor.ThreadWrapper(int t)
Deprecated.Constructor with a timeout of the inner thread.ThreadWrapper(T th, int to)
Deprecated.Constructor with an inner thread to be run by this wrapper and the timeout of the thread. -
Method Summary
Modifier and Type Method Description T
getThread()
Deprecated.Returns the inner thread.int
getTimeout()
Deprecated.Returns the timeout of the inner thread.boolean
isKilled()
Deprecated.Returnstrue
if the inner thread is still alive after timeout.void
run()
Deprecated.Runs the inner threadvoid
setThread(T t)
Deprecated.Sets the inner thread.void
setTimeout(int t)
Deprecated.Sets the timeout of the inner thread.
-
Constructor Details
-
ThreadWrapper
public ThreadWrapper()Deprecated.Constructor. -
ThreadWrapper
public ThreadWrapper(int t)Deprecated.Constructor with a timeout of the inner thread.- Parameters:
t
- the timeout of the inner thread
-
ThreadWrapper
Deprecated.Constructor with an inner thread to be run by this wrapper and the timeout of the thread.- Parameters:
th
- a thread to be run by this wrapperto
- the timeout oft
-
-
Method Details
-
getTimeout
public int getTimeout()Deprecated.Returns the timeout of the inner thread.- Returns:
- the timeout of the inner thread
-
setTimeout
public void setTimeout(int t)Deprecated.Sets the timeout of the inner thread.- Parameters:
t
- the timeout of the inner thread
-
getThread
Deprecated.Returns the inner thread.- Returns:
- the inner thread
-
setThread
Deprecated.Sets the inner thread.- Parameters:
t
- the inner thread
-
isKilled
public boolean isKilled()Deprecated.Returnstrue
if the inner thread is still alive after timeout.- Returns:
true
if the inner thread is still alive after timeout
-
run
public void run()Deprecated.Runs the inner thread
-