public void backgroundTask() throws Exception {
      m_watchdog.enterState("Emptying index queue", 60);

      synchronized (m_provider.m_updates) {
        while (m_provider.m_updates.size() > 0) {
          Object[] pair = m_provider.m_updates.remove(0);
          WikiPage page = (WikiPage) pair[0];
          String text = (String) pair[1];
          m_provider.updateLuceneIndex(page, text);
        }
      }

      m_watchdog.exitState();
    }
    public void startupTask() throws Exception {
      m_watchdog = getEngine().getCurrentWatchDog();

      // Sleep initially...
      try {
        Thread.sleep(m_initialDelay * 1000L);
      } catch (InterruptedException e) {
        throw new InternalWikiException("Interrupted while waiting to start.");
      }

      m_watchdog.enterState("Full reindex");
      // Reindex everything
      m_provider.doFullLuceneReindex();
      m_watchdog.exitState();
    }