org.hibernate.search.backend.impl
Class TransactionalWorker
java.lang.Object
org.hibernate.search.backend.impl.TransactionalWorker
- All Implemented Interfaces:
- Worker
public class TransactionalWorker
- extends Object
- implements 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)
- Author:
- Emmanuel Bernard
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
synchronizationPerTransaction
protected final WeakIdentityHashMap<Object,Synchronization> synchronizationPerTransaction
TransactionalWorker
public TransactionalWorker()
performWork
public void performWork(Work<?> work,
TransactionContext transactionContext)
- Description copied from interface:
Worker
- Declare a work to be done within a given transaction context
- Specified by:
performWork
in interface Worker
- Parameters:
work
- the work to be executedtransactionContext
- transactional context information
initialize
public void initialize(Properties props,
WorkerBuildContext context,
QueueingProcessor queueingProcessor)
- Specified by:
initialize
in interface Worker
close
public void close()
- Description copied from interface:
Worker
- clean resources
This method can return exceptions
- Specified by:
close
in interface Worker
flushWorks
public void flushWorks(TransactionContext transactionContext)
- Description copied from interface:
Worker
- Flush any work queue.
- Specified by:
flushWorks
in interface Worker
- Parameters:
transactionContext
- the current transaction (context).
Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved