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>
isEnlisted
protected static ThreadLocal<Map<String,IndexingCommands>>
transactionCommands
static ThreadLocal<Boolean>
useSyncIndexing
-
Constructor Summary
Constructors Constructor Description ElasticSearchInlineListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterCompletion(int status)
void
beforeCompletion()
protected Map<String,IndexingCommands>
getAllCommands()
void
handleEvent(Event event)
Handle the given event.protected boolean
isSyncIndexingByDefault()
protected boolean
registerSynchronization(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:
getAllCommands
in classIndexingCommandsStacker
-
isSyncIndexingByDefault
protected boolean isSyncIndexingByDefault()
- Specified by:
isSyncIndexingByDefault
in classIndexingCommandsStacker
-
handleEvent
public void handleEvent(Event event)
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)
-
-