Search in sources :

Example 1 with BeforeCommitTransactionListener

use of com.haulmont.cuba.core.listener.BeforeCommitTransactionListener in project cuba by cuba-platform.

the class PersistenceImplSupport method setApplicationContext.

@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
    Map<String, BeforeCommitTransactionListener> beforeCommitMap = applicationContext.getBeansOfType(BeforeCommitTransactionListener.class);
    beforeCommitTxListeners = new ArrayList<>(beforeCommitMap.values());
    beforeCommitTxListeners.sort(new OrderComparator());
    Map<String, AfterCompleteTransactionListener> afterCompleteMap = applicationContext.getBeansOfType(AfterCompleteTransactionListener.class);
    afterCompleteTxListeners = new ArrayList<>(afterCompleteMap.values());
    afterCompleteTxListeners.sort(new OrderComparator());
}
Also used : BeforeCommitTransactionListener(com.haulmont.cuba.core.listener.BeforeCommitTransactionListener) AfterCompleteTransactionListener(com.haulmont.cuba.core.listener.AfterCompleteTransactionListener) OrderComparator(org.springframework.core.OrderComparator)

Aggregations

AfterCompleteTransactionListener (com.haulmont.cuba.core.listener.AfterCompleteTransactionListener)1 BeforeCommitTransactionListener (com.haulmont.cuba.core.listener.BeforeCommitTransactionListener)1 OrderComparator (org.springframework.core.OrderComparator)1