Class TransactionalWorker
java.lang.Object
org.hibernate.search.backend.impl.TransactionalWorker
- All Implemented Interfaces:
Worker
Queue works per transaction.
If out of transaction, the work is executed right away
When
hibernate.search.worker.type is set to async
the work is done in a separate thread (threads are pooled)-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()clean resources This method can return exceptionsvoidflushWorks(TransactionContext transactionContext) Flush any work queue.voidinitialize(Properties props, WorkerBuildContext context) voidperformWork(Work<?> work, TransactionContext transactionContext) Declare a work to be done within a given transaction context
-
Field Details
-
synchronizationPerTransaction
-
-
Constructor Details
-
TransactionalWorker
public TransactionalWorker()
-
-
Method Details
-
performWork
Description copied from interface:WorkerDeclare a work to be done within a given transaction context- Specified by:
performWorkin interfaceWorker- Parameters:
work- the work to be executedtransactionContext- transactional context information
-
initialize
- Specified by:
initializein interfaceWorker
-
close
public void close()Description copied from interface:Workerclean resources This method can return exceptions -
flushWorks
Description copied from interface:WorkerFlush any work queue.- Specified by:
flushWorksin interfaceWorker- Parameters:
transactionContext- the current transaction (context).
-