SpringSource/spring-integration — pull request #564 by garyrussell (2012-07-27 16:37:40+00:00)
Title: INT-2685 Transaction Synchronization

Remove M3 disposition-* attributes on File/(S)FTP inbound adapters.

Add and elements
to .

These elements provide the following attributes:

* on-success-expression
* on-success-result-channel
* on-failure-expression
* on-failure-result-channel
* send-timeout

synchronizes these expression evaluations
with the transaction, such that they are executed immediately after
the commit/rollback.

is used for a non-transactional poller.

When an is provided to the poller,
and are synonyms; and the behavior is
dictated by whether or not the contains a transaction
advice. It is recommended that is used when the
does not have a txAdvice, and
when it does, but the framework does not enforce this.

The expressions have the original (polled) message as the #root variable.
In addition, a BeanResolver is provided, allowing expressions such as
'@someBean.handleSuccess(payload)'.

MessageSources may also implement PseudoTransactionalMessageSource. This
has a number of methods allowing more flexibility in transactional and
non-transactional environents. For example, for backwards compatibility.
the mail-inbound-channel-adapter deletes its polled message after the
receive() rather than after the polled message is sent (when running in
a non-transactional poller). However, when running in a transactional
poller, the delete is done after the transaction commits (but not when
it rolls back).

In addition, MessageSources that implement this interface can optionally
provide an arbitrary object to the success/failure expressions in a
variable named '#resource'.