Package org.opencms.search
Class CmsSearchManager.CmsSearchOfflineIndexThread
- java.lang.Object
-
- java.lang.Thread
-
- org.opencms.search.CmsSearchManager.CmsSearchOfflineIndexThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- CmsSearchManager
protected class CmsSearchManager.CmsSearchOfflineIndexThread extends java.lang.Thread
The offline indexer thread runs periodically and indexes all resources added by the event handler.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CmsSearchOfflineIndexThread(CmsSearchManager.CmsSearchOfflineHandler handler)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<CmsPublishedResource>
getResourcesToIndex()
Obtains the list of resource to update in the offline index, then optimizes the list by removing duplicate entries.CmsWaitHandle
getWaitHandle()
Gets the wait handle used for signalling when the worker thread has finished.void
interrupt()
void
run()
protected void
shutDown()
Shuts down this offline index thread.void
start()
protected void
startOfflineUpdateThread(I_CmsReport report, java.util.List<CmsPublishedResource> resourcesToIndex)
Updates the offline search indexes for the given list of resources.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
CmsSearchOfflineIndexThread
protected CmsSearchOfflineIndexThread(CmsSearchManager.CmsSearchOfflineHandler handler)
Constructor.- Parameters:
handler
- the offline index event handler
-
-
Method Detail
-
getWaitHandle
public CmsWaitHandle getWaitHandle()
Gets the wait handle used for signalling when the worker thread has finished.- Returns:
- the wait handle
-
interrupt
public void interrupt()
- Overrides:
interrupt
in classjava.lang.Thread
- See Also:
Thread.interrupt()
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
- See Also:
Thread.run()
-
start
public void start()
- Overrides:
start
in classjava.lang.Thread
- See Also:
Thread.start()
-
getResourcesToIndex
protected java.util.List<CmsPublishedResource> getResourcesToIndex()
Obtains the list of resource to update in the offline index, then optimizes the list by removing duplicate entries.- Returns:
- the list of resource to update in the offline index
-
shutDown
protected void shutDown()
Shuts down this offline index thread.
-
startOfflineUpdateThread
protected void startOfflineUpdateThread(I_CmsReport report, java.util.List<CmsPublishedResource> resourcesToIndex)
Updates the offline search indexes for the given list of resources.- Parameters:
report
- the report to write the index information toresourcesToIndex
- the list ofCmsPublishedResource
objects to index
-
-