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
Modifier and TypeFieldDescriptionprotected static ThreadLocal<Boolean>
protected static ThreadLocal<Map<String,
IndexingCommands>> static final ThreadLocal<Boolean>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterCompletion
(int status) void
protected Map<String,
IndexingCommands> void
handleEvent
(Event event) Handle the given event.protected boolean
protected boolean
registerSynchronization
(javax.transaction.Synchronization sync) Methods inherited from class org.nuxeo.elasticsearch.commands.IndexingCommandsStacker
getCommands, getDocKey, getOrCreateCommands, isSynchronous, stackCommand, stackCommand, stackCommand
-
Field Details
-
transactionCommands
-
useSyncIndexing
-
isEnlisted
-
-
Constructor Details
-
ElasticSearchInlineListener
public ElasticSearchInlineListener()
-
-
Method Details
-
getAllCommands
- Specified by:
getAllCommands
in classIndexingCommandsStacker
-
isSyncIndexingByDefault
protected boolean isSyncIndexingByDefault()- Specified by:
isSyncIndexingByDefault
in classIndexingCommandsStacker
-
handleEvent
Description copied from interface:EventListener
Handle the given event. The listener can cancel the event by callingEvent.cancel()
- Specified by:
handleEvent
in interfaceEventListener
- Parameters:
event
- the event
-
beforeCompletion
public void beforeCompletion()- Specified by:
beforeCompletion
in interfacejavax.transaction.Synchronization
-
afterCompletion
public void afterCompletion(int status) - Specified by:
afterCompletion
in interfacejavax.transaction.Synchronization
-
registerSynchronization
protected boolean registerSynchronization(javax.transaction.Synchronization sync)
-