org.axonframework.eventhandling
Interface TransactionManager

All Known Implementing Classes:
AnnotationEventListenerAdapter, AnnotationTransactionManager, SpringTransactionManager

public interface TransactionManager

org.axonframework.eventhandling.EventListener} interface that provides implementations the ability to do work at the start and end of a transaction.

Typically, this will involve opening database transactions or connecting to external systems.

Since:
0.3
Author:
Allard Buijze

Method Summary
 void afterTransaction(TransactionStatus transactionStatus)
          Invoked by the EventProcessingScheduler after a series of events is processed.
 void beforeTransaction(TransactionStatus transactionStatus)
          Invoked by the EventProcessingScheduler before processing a series of events.
 

Method Detail

beforeTransaction

void beforeTransaction(TransactionStatus transactionStatus)
Invoked by the EventProcessingScheduler before processing a series of events. The given TransactionStatus may be used to set the maximum batch size for the current transaction.

Parameters:
transactionStatus - The current status of the transaction
See Also:
afterTransaction(TransactionStatus), TransactionStatus

afterTransaction

void afterTransaction(TransactionStatus transactionStatus)
Invoked by the EventProcessingScheduler after a series of events is processed. The given TransactionStatus may be used to indicate whether the scheduler should yield to other event processing schedulers or not.

This method is always called once for each invocation to beforeTransaction(TransactionStatus), even if no events were processed at all.

Note that this method is called when a transactional batch was handled successfully, as well as when an error occurred. Use the TransactionStatus object to find information about transaction status and (when failed) the cause of the failure.

Parameters:
transactionStatus - The current status of the transaction
See Also:
beforeTransaction(TransactionStatus), TransactionStatus


Copyright © 2011. All Rights Reserved.