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
Nested Classes Modifier and Type Class Description protected static class
BinaryMetadataSyncListener.DocumentMetadataMappingUpdates
-
Field Summary
Fields Modifier and Type Field Description protected static ThreadLocal<Boolean>
IS_ENLISTED
protected static ThreadLocal<List<BinaryMetadataSyncListener.DocumentMetadataMappingUpdates>>
TRANSACTION_UPDATES
-
Constructor Summary
Constructors Constructor Description BinaryMetadataSyncListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterCompletion(int status)
void
beforeCompletion()
void
handleEvent(Event event)
Handle the given event.protected boolean
registerSynchronization(javax.transaction.Synchronization sync)
-
-
-
Field Detail
-
IS_ENLISTED
protected static final ThreadLocal<Boolean> IS_ENLISTED
-
TRANSACTION_UPDATES
protected static final ThreadLocal<List<BinaryMetadataSyncListener.DocumentMetadataMappingUpdates>> TRANSACTION_UPDATES
-
-
Method Detail
-
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)
-
-