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.
    Returns true if the inner thread is still alive after timeout.
    void run()
    Deprecated.
    Runs the inner thread
    void setThread​(T t)
    Deprecated.
    Sets the inner thread.
    void setTimeout​(int t)
    Deprecated.
    Sets the timeout of the inner thread.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public ThreadWrapper​(T th, int to)
      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 wrapper
      to - the timeout of t
  • 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

      public T getThread()
      Deprecated.
      Returns the inner thread.
      Returns:
      the inner thread
    • setThread

      public void setThread​(T t)
      Deprecated.
      Sets the inner thread.
      Parameters:
      t - the inner thread
    • isKilled

      public boolean isKilled()
      Deprecated.
      Returns true 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