Class ExpressionEvaluatingTransactionSynchronizationProcessor
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.transaction.ExpressionEvaluatingTransactionSynchronizationProcessor
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- InitializingBean,- ApplicationContextAware,- ComponentSourceAware,- ExpressionCapable,- NamedComponent,- TransactionSynchronizationProcessor
public class ExpressionEvaluatingTransactionSynchronizationProcessor
extends IntegrationObjectSupport
implements TransactionSynchronizationProcessor
This implementation of 
TransactionSynchronizationFactory
 allows you to configure SpEL expressions, with their execution being coordinated
 (synchronized) with a transaction - see
 TransactionSynchronization.
 Expressions for before-commit, after-commit, and after-rollback
 are supported, together with a channel for each where the evaluation result
 (if any) will be sent.
 For each sub-element you can specify 'expression' and/or 'channel' attributes. If only the 'channel' attribute is present the received Message will be sent there as part of a particular synchronization scenario.
If only the 'expression' attribute is present and the result of an expression is a non-Null value, a Message with the result as the payload will be generated and sent to a default channel (NullChannel) and will appear in the logs. If you want the evaluation result to go to a specific channel add a 'channel' attribute. If the result of an expression is null or void, no Message will be generated.
- Since:
- 2.2
- Author:
- Gary Russell, Oleg Zhurakousky, Artem Bilan, Glenn Renfro
- 
Field SummaryFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, logger
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected StandardEvaluationContextprotected voidonInit()Subclasses may implement this for initialization logic.voidvoidvoidvoidsetAfterCommitChannel(MessageChannel afterCommitChannel) voidsetAfterCommitExpression(Expression afterCommitExpression) voidsetAfterRollbackChannel(MessageChannel afterRollbackChannel) voidsetAfterRollbackExpression(Expression afterRollbackExpression) voidsetBeforeCommitChannel(MessageChannel beforeCommitChannel) voidsetBeforeCommitExpression(Expression beforeCommitExpression) voidsetIntegrationEvaluationContext(EvaluationContext evaluationContext) Methods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
- 
Constructor Details- 
ExpressionEvaluatingTransactionSynchronizationProcessorpublic ExpressionEvaluatingTransactionSynchronizationProcessor()
 
- 
- 
Method Details- 
setIntegrationEvaluationContext
- 
setBeforeCommitChannel
- 
setAfterCommitChannel
- 
setAfterRollbackChannel
- 
setBeforeCommitExpression
- 
setAfterCommitExpression
- 
setAfterRollbackExpression
- 
onInitprotected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- IntegrationObjectSupport
 
- 
processBeforeCommit- Specified by:
- processBeforeCommitin interface- TransactionSynchronizationProcessor
 
- 
processAfterCommit- Specified by:
- processAfterCommitin interface- TransactionSynchronizationProcessor
 
- 
processAfterRollback- Specified by:
- processAfterRollbackin interface- TransactionSynchronizationProcessor
 
- 
getComponentType- Specified by:
- getComponentTypein interface- NamedComponent
 
- 
createEvaluationContext
 
-