Package org.nuxeo.elasticsearch.listener
Class ElasticSearchInlineListener
- java.lang.Object
-
- org.nuxeo.elasticsearch.commands.IndexingCommandsStacker
-
- org.nuxeo.elasticsearch.listener.ElasticSearchInlineListener
-
- All Implemented Interfaces:
javax.transaction.Synchronization,EventListener
public class ElasticSearchInlineListener extends IndexingCommandsStacker implements EventListener, javax.transaction.Synchronization
Synchronous Event listener used to record indexing command, submitted after commit completion.
-
-
Field Summary
Fields Modifier and Type Field Description protected static ThreadLocal<Boolean>isEnlistedprotected static ThreadLocal<Map<String,IndexingCommands>>transactionCommandsstatic ThreadLocal<Boolean>useSyncIndexing
-
Constructor Summary
Constructors Constructor Description ElasticSearchInlineListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterCompletion(int status)voidbeforeCompletion()protected Map<String,IndexingCommands>getAllCommands()voidhandleEvent(Event event)Handle the given event.protected booleanisSyncIndexingByDefault()protected booleanregisterSynchronization(javax.transaction.Synchronization sync)-
Methods inherited from class org.nuxeo.elasticsearch.commands.IndexingCommandsStacker
getCommands, getDocKey, getOrCreateCommands, isSynchronous, stackCommand, stackCommand, stackCommand
-
-
-
-
Field Detail
-
transactionCommands
protected static ThreadLocal<Map<String,IndexingCommands>> transactionCommands
-
useSyncIndexing
public static final ThreadLocal<Boolean> useSyncIndexing
-
isEnlisted
protected static ThreadLocal<Boolean> isEnlisted
-
-
Method Detail
-
getAllCommands
protected Map<String,IndexingCommands> getAllCommands()
- Specified by:
getAllCommandsin classIndexingCommandsStacker
-
isSyncIndexingByDefault
protected boolean isSyncIndexingByDefault()
- Specified by:
isSyncIndexingByDefaultin classIndexingCommandsStacker
-
handleEvent
public void handleEvent(Event event)
Description copied from interface:EventListenerHandle the given event. The listener can cancel the event by callingEvent.cancel()- Specified by:
handleEventin interfaceEventListener- Parameters:
event- the event
-
beforeCompletion
public void beforeCompletion()
- Specified by:
beforeCompletionin interfacejavax.transaction.Synchronization
-
afterCompletion
public void afterCompletion(int status)
- Specified by:
afterCompletionin interfacejavax.transaction.Synchronization
-
registerSynchronization
protected boolean registerSynchronization(javax.transaction.Synchronization sync)
-
-