public class TransactionalWorker extends Object implements Worker
hibernate.search.worker.type
is set to async
the work is done in a separate thread (threads are pooled)Modifier and Type | Field and Description |
---|---|
protected WeakIdentityHashMap<Object,Synchronization> |
synchronizationPerTransaction |
Constructor and Description |
---|
TransactionalWorker() |
Modifier and Type | Method and Description |
---|---|
void |
close()
clean resources
This method can return exceptions
|
void |
flushWorks(TransactionContext transactionContext)
Flush any work queue.
|
void |
initialize(Properties props,
WorkerBuildContext context,
QueueingProcessor queueingProcessor) |
void |
performWork(Work<?> work,
TransactionContext transactionContext)
Declare a work to be done within a given transaction context
|
protected final WeakIdentityHashMap<Object,Synchronization> synchronizationPerTransaction
public void performWork(Work<?> work, TransactionContext transactionContext)
Worker
performWork
in interface Worker
work
- the work to be executedtransactionContext
- transactional context informationpublic void initialize(Properties props, WorkerBuildContext context, QueueingProcessor queueingProcessor)
initialize
in interface Worker
public void close()
Worker
public void flushWorks(TransactionContext transactionContext)
Worker
flushWorks
in interface Worker
transactionContext
- the current transaction (context).Copyright © 2006–2013 Hibernate. All rights reserved.