org.silverpeas.search.indexEngine.model
Class IndexerThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.silverpeas.search.indexEngine.model.IndexerThread
All Implemented Interfaces:
Runnable

public class IndexerThread
extends Thread

A thread IndexerThread index in the background a batch of index requests. All the public methods are static, so only one thread runs and processes the requests.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
static void addIndexEntry(FullIndexEntry indexEntry)
          Add a request 'add entry index'
static void removeIndexEntry(IndexEntryPK indexEntry)
          Add a request 'remove entry index'
 void run()
          Process all the requests.
static void start(IndexManager indexManager)
          Builds and starts the thread which will process all the requests.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

start

public static void start(IndexManager indexManager)
Builds and starts the thread which will process all the requests. This method is synchonized on the requests queue in order to guarantee that only one IndexerThread is running.

Parameters:
indexManager -

addIndexEntry

public static void addIndexEntry(FullIndexEntry indexEntry)
Add a request 'add entry index'

Parameters:
indexEntry -

removeIndexEntry

public static void removeIndexEntry(IndexEntryPK indexEntry)
Add a request 'remove entry index'


run

public void run()
Process all the requests. When the queue is empty : sends an optimize query to the indexManager. This method should be private but is already declared public in the base class Thread.

Specified by:
run in interface Runnable
Overrides:
run in class Thread


Copyright © 2016 Silverpeas. All Rights Reserved.