Class BinaryMetadataSyncListener
java.lang.Object
org.nuxeo.binary.metadata.internals.listeners.BinaryMetadataSyncListener
- All Implemented Interfaces:
javax.transaction.Synchronization
,EventListener
public class BinaryMetadataSyncListener
extends Object
implements EventListener, javax.transaction.Synchronization
Handle document and blob updates according to following rules in an event context:
- Define if rule should be executed in async or sync mode.
- If creation, write metadata from Blob to doc.
- If Blob dirty and document metadata dirty, write metadata from doc to Blob.
- If Blob dirty and document metadata not dirty, write metadata from Blob to doc.
- If Blob not dirty and document metadata dirty, write metadata from doc to Blob.
- Since:
- 7.1
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final ThreadLocal<Boolean>
protected static final ThreadLocal<List<BinaryMetadataSyncListener.DocumentMetadataMappingUpdates>>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterCompletion
(int status) void
void
handleEvent
(Event event) Handle the given event.protected boolean
registerSynchronization
(javax.transaction.Synchronization sync)
-
Field Details
-
IS_ENLISTED
-
TRANSACTION_UPDATES
protected static final ThreadLocal<List<BinaryMetadataSyncListener.DocumentMetadataMappingUpdates>> TRANSACTION_UPDATES
-
-
Constructor Details
-
BinaryMetadataSyncListener
public BinaryMetadataSyncListener()
-
-
Method Details
-
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)
-