/** * Returns true if this thread is already "doomed" to be deleted.<p> * * A OpenCms deamon Thread (the "Grim Reaper") will collect all * doomed Threads, i.e. threads that are not longer active for some * time.<p> * * @return true if this thread is already "doomed" to be deleted */ public synchronized boolean isDoomed() { if (isAlive()) { // as long as the Thread is still active it is never doomed return false; } if (m_doomed) { // not longer active, and already doomed, so rest in peace... return true; } // condemn the Thread to be collected by the grim reaper next time m_starttime = getRuntime(); m_doomed = true; return false; }
/** * Returns true if this thread is already "doomed" to be deleted.<p> * * A OpenCms deamon Thread (the "Grim Reaper") will collect all * doomed Threads, i.e. threads that are not longer active for some * time.<p> * * @return true if this thread is already "doomed" to be deleted */ public synchronized boolean isDoomed() { if (isAlive()) { // as long as the Thread is still active it is never doomed return false; } if (m_doomed) { // not longer active, and already doomed, so rest in peace... return true; } // condemn the Thread to be collected by the grim reaper next time m_starttime = getRuntime(); m_doomed = true; return false; }
/** * Returns true if the report Thread is still alive (i.e. running), false otherwise.<p> * * @return true if the report Thread is still alive */ public boolean isAlive() { A_CmsReportThread thread = OpenCms.getThreadStore().retrieveThread(m_paramThread); if (thread != null) { return thread.isAlive(); } else { return false; } }
/** * Returns true if the report Thread is still alive (i.e. running), false otherwise.<p> * * @return true if the report Thread is still alive */ public boolean isAlive() { A_CmsReportThread thread = OpenCms.getThreadStore().retrieveThread(m_paramThread); if (thread != null) { return thread.isAlive(); } else { return false; } }
/** * @see org.opencms.ui.shared.rpc.I_CmsReportServerRpc#requestReportUpdate() */ public void requestReportUpdate() { String reportUpdate = null; if (!m_threadFinished && (m_thread != null)) { // if thread is not alive at this point, there may still be report updates reportUpdate = m_thread.getReportUpdate(); if (!m_thread.isAlive()) { m_threadFinished = true; for (Runnable handler : m_reportFinishedHandlers) { handler.run(); } } } getRpcProxy(I_CmsReportClientRpc.class).handleReportUpdate(reportUpdate); }