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)
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-2017 Red Hat, Inc. All Rights Reserved