Class WikiBackgroundThread

java.lang.Object
java.lang.Thread
org.apache.wiki.WikiBackgroundThread
All Implemented Interfaces:
Runnable, EventListener, WikiEventListener
Direct Known Subclasses:
RSSThread

public abstract class WikiBackgroundThread extends Thread implements WikiEventListener
Abstract Thread subclass that operates in the background; when it detects the WikiEngineEvent.SHUTDOWN event, it terminates itself. Subclasses of this method need only implement the method backgroundTask(), instead of the normal Thread.run(), and provide a constructor that passes the Engine and sleep interval. This class is thread-safe.
  • Constructor Details

    • WikiBackgroundThread

      public WikiBackgroundThread(Engine engine, int sleepInterval)
      Constructs a new instance of this background thread with a specified sleep interval, and adds the new instance to the wiki engine's event listeners.
      Parameters:
      engine - the wiki engine
      sleepInterval - the interval between invocations of the thread's Thread.run() method, in seconds
  • Method Details