public class PerTransactionWorker extends Object implements Worker
When 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 ConcurrentMap<Object,WorkQueueSynchronization> |
synchronizationPerTransaction |
| Constructor and Description |
|---|
PerTransactionWorker() |
| 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 ConcurrentMap<Object,WorkQueueSynchronization> synchronizationPerTransaction
public void performWork(Work work, TransactionContext transactionContext)
WorkerperformWork in interface Workerwork - the work to be executedtransactionContext - transactional context informationpublic void initialize(Properties props, WorkerBuildContext context, QueueingProcessor queueingProcessor)
initialize in interface Workerpublic void close()
Workerpublic void flushWorks(TransactionContext transactionContext)
WorkerflushWorks in interface WorkertransactionContext - the current transaction (context).Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved