org.infinispan.query.backend
Class TransactionalEventTransactionContext

java.lang.Object
  extended by org.infinispan.query.backend.TransactionalEventTransactionContext
All Implemented Interfaces:
org.hibernate.search.backend.TransactionContext

public class TransactionalEventTransactionContext
extends Object
implements org.hibernate.search.backend.TransactionContext

This class implements the TransactionContext interface. It retrieves transaction context information from the TransactionManager that gets passed in as a parameter upon instantiation.

It is used by the QueryInterceptor to pass transaction information to a Hibernate Search Work object.

Author:
Navin Surtani
See Also:
QueryInterceptor

Constructor Summary
TransactionalEventTransactionContext(TransactionManager transactionManager, TransactionSynchronizationRegistry transactionSynchronizationRegistry)
          Creates a new instance of NodeModifiedTransactionContext.
 
Method Summary
 Object getTransactionIdentifier()
          Returns a JTA transaction.
 boolean isTransactionInProgress()
          Returns a boolean value whether or not a transaction is in progress (JTA transaction and in this case *not* an org.hibernate transaction).
 void registerSynchronization(Synchronization synchronization)
          Registers the synchronization passed in as a parameter with the ongoing transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionalEventTransactionContext

public TransactionalEventTransactionContext(TransactionManager transactionManager,
                                            TransactionSynchronizationRegistry transactionSynchronizationRegistry)
Creates a new instance of NodeModifiedTransactionContext.

Parameters:
transactionManager - a NodeModifiedEvent to wrap. Should not be null.
transactionSynchronizationRegistry -
Throws:
NullPointerException - if event is null.
Method Detail

isTransactionInProgress

public boolean isTransactionInProgress()
Returns a boolean value whether or not a transaction is in progress (JTA transaction and in this case *not* an org.hibernate transaction).

Specified by:
isTransactionInProgress in interface org.hibernate.search.backend.TransactionContext
Returns:
true if a transaction is in progress, false otherwise.

getTransactionIdentifier

public Object getTransactionIdentifier()
Returns a JTA transaction.

Specified by:
getTransactionIdentifier in interface org.hibernate.search.backend.TransactionContext
Returns:
a JTA transaction if one is available, or a null otherwise.
See Also:
TransactionManager

registerSynchronization

public void registerSynchronization(Synchronization synchronization)
Registers the synchronization passed in as a parameter with the ongoing transaction.

If there is no ongoing transaction, then this method will do nothing and simply return.

Specified by:
registerSynchronization in interface org.hibernate.search.backend.TransactionContext
Parameters:
synchronization - synchronization to register. Must not be null.
Throws:
NullPointerException - if the synchronization is null.

-->

Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.