Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hibernate.search.backend.impl
Class TransactionalWorker

    java.lang.Object
      org.hibernate.search.backend.impl.TransactionalWorker

All Implemented Interfaces:
  Worker

    public class TransactionalWorker

extends java.lang.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

Field Summary
`protected WeakIdentityHashMap<java.lang.Object,javax.transaction.Synchronization>` | `synchronizationPerTransaction`

Constructor Summary
`TransactionalWorker()`

Method Summary
`void` | `close()` clean resources This method can return exceptions
`void` | `flushWorks(TransactionContext transactionContext)` Flush any work queue.
`void` | `initialize(java.util.Properties props, SearchFactoryImplementor searchFactory)`
`void` | `performWork(Work work, TransactionContext transactionContext)` Declare a work to be done within a given transaction context

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### synchronizationPerTransaction

    protected final WeakIdentityHashMap<java.lang.Object,javax.transaction.Synchronization> synchronizationPerTransaction

Constructor Detail

### TransactionalWorker

    public TransactionalWorker()

Method Detail

### 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`

### initialize

    public void initialize(java.util.Properties props,
                           SearchFactoryImplementor searchFactory)

  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).

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2010 Hibernate. All Rights Reserved.