Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.listener
Interface OnSaveListener

All Superinterfaces:
TransactedListener
All Known Implementing Classes:
TestTransactedListener

public interface OnSaveListener
extends TransactedListener

This listener is notified at each save operation by passing all events collected between 2 save operations in the same thread. Note that this is also working when no transactions are started but in that case you may have weird results because if you forgot to send save events the events will remain collected in a thread local variable and when the thread is reused you will consume these pending events!

When in a transaction context the transaction commit or rollback will flush the event stack so when a new transaction is started the new events will always be collected in a clean stack.

Note that the save event that triggered the notification is not part of the events passed to that listener

Author:
Bogdan Stefanescu

Method Summary
 void onSave(CoreEvent[] events)
          Notify Last save in current transaction.
 void onSave(Operation<?>[] events)
          Notify Last save in current transaction.
 

Method Detail

onSave

void onSave(CoreEvent[] events)
Notify Last save in current transaction.

This method should be used by listeners using the CoreEvent model and ignored by the one using Operation events.

Parameters:
events - all core events collected in current transaction.

onSave

void onSave(Operation<?>[] events)
Notify Last save in current transaction.

This method should be used by listeners using the Operation events and ignored by the one using CoreEvent events.

Parameters:
events - all operation events collected in current transaction

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.