ome.services.fulltext
Class FullTextThread

java.lang.Object
  extended by ome.services.util.ExecutionThread
      extended by ome.services.fulltext.FullTextThread
All Implemented Interfaces:
Runnable

public class FullTextThread
extends ExecutionThread

Library entry-point for indexing. Once the FullTextThread is properly initialized calling ExecutionThread.run() repeatedly and from multiple threads should be safe. For more control, use the EventLogLoader#more() method to test how often calls to ExecutionThread.run() should be made. See Main for examples. By default, the indexing will take place as "root".

Since:
3.0-Beta3
Author:
Josh Moore, josh at glencoesoftware.com

Field Summary
protected  FullTextBridge bridge
           
protected  FullTextIndexer indexer
           
protected  boolean waitForLock
           
 
Fields inherited from class ome.services.util.ExecutionThread
executor, manager, principal, work
 
Constructor Summary
FullTextThread(SessionManager manager, Executor executor, FullTextIndexer indexer, FullTextBridge bridge)
          Uses default Principal for indexing
FullTextThread(SessionManager manager, Executor executor, FullTextIndexer indexer, FullTextBridge bridge, boolean waitForLock)
          Uses default Principal for indexing
FullTextThread(SessionManager manager, Executor executor, FullTextIndexer indexer, FullTextBridge bridge, Principal principal)
          Main constructor.
FullTextThread(SessionManager manager, Executor executor, FullTextIndexer indexer, FullTextBridge bridge, Principal principal, boolean waitForLock)
          Main constructor.
 
Method Summary
 void doRun()
          Passes the FullTextIndexer instance to Executor.Work#doWork(org.springframework.transaction.TransactionStatus, org.hibernate.Session, ome.system.ServiceFactory) between calls to DetailsFieldBridge.lock() and DetailsFieldBridge.unlock() in order to guarantee that no other FieldBridge can edit the property.
 void start()
          Called by Spring on creation.
 void stop()
          Called by Spring on destruction.
 
Methods inherited from class ome.services.util.ExecutionThread
getPrincipal, run, sessionInit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

waitForLock

protected final boolean waitForLock

indexer

protected final FullTextIndexer indexer

bridge

protected final FullTextBridge bridge
Constructor Detail

FullTextThread

public FullTextThread(SessionManager manager,
                      Executor executor,
                      FullTextIndexer indexer,
                      FullTextBridge bridge)
Uses default Principal for indexing


FullTextThread

public FullTextThread(SessionManager manager,
                      Executor executor,
                      FullTextIndexer indexer,
                      FullTextBridge bridge,
                      boolean waitForLock)
Uses default Principal for indexing


FullTextThread

public FullTextThread(SessionManager manager,
                      Executor executor,
                      FullTextIndexer indexer,
                      FullTextBridge bridge,
                      Principal principal)
Main constructor. No arguments can be null.


FullTextThread

public FullTextThread(SessionManager manager,
                      Executor executor,
                      FullTextIndexer indexer,
                      FullTextBridge bridge,
                      Principal principal,
                      boolean waitForLock)
Main constructor. No arguments can be null.

Method Detail

start

public void start()
Called by Spring on creation. Currently a no-op.


doRun

public void doRun()
Passes the FullTextIndexer instance to Executor.Work#doWork(org.springframework.transaction.TransactionStatus, org.hibernate.Session, ome.system.ServiceFactory) between calls to DetailsFieldBridge.lock() and DetailsFieldBridge.unlock() in order to guarantee that no other FieldBridge can edit the property. Therefore, only one indexer using this idiom can run at a time.

Specified by:
doRun in class ExecutionThread

stop

public void stop()
Called by Spring on destruction. Waits for the global lock on DetailsFieldBridge then marks this thread as inactive.



OmeroJava Api

Version: 4.3.3-00d1137e-b2894

Copyright © 2009 The University of Dundee. All Rights Reserved.