Class WorkerThread

  • All Implemented Interfaces:
    java.lang.Runnable

    public class WorkerThread
    extends java.lang.Object
    implements java.lang.Runnable
    A worker thread class for the server.
    Author:
    Christopher Mindus
    • Constructor Summary

      Constructors 
      Constructor Description
      WorkerThread​(Worker worker, java.lang.Runnable disposeRunnable)
      Constructs the worker thread.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void awaitExit()
      Waits max 30 seconds for worker thread to exit.
      boolean isRunning()
      Verifies if the thread is running.
      void run()
      The worker thread runnable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WorkerThread

        public WorkerThread​(Worker worker,
                            java.lang.Runnable disposeRunnable)
        Constructs the worker thread.
        Parameters:
        worker - The worker.
        disposeRunnable - Runnable that is called when the thread exits dur to failure.
    • Method Detail

      • isRunning

        public boolean isRunning()
        Verifies if the thread is running.
      • awaitExit

        public void awaitExit()
        Waits max 30 seconds for worker thread to exit.
      • run

        public void run()
        The worker thread runnable.
        Specified by:
        run in interface java.lang.Runnable