"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spring-tx/src/main/java/org/springframework/transaction/event/TransactionalEventListener.java" between
spring-framework-5.3.7.tar.gz and spring-framework-5.3.8.tar.gz

About: Spring Framework is an application framework for the Java platform and .NET Framework. Community edition.

TransactionalEventListener.java  (spring-framework-5.3.7):TransactionalEventListener.java  (spring-framework-5.3.8)
skipping to change at line 30 skipping to change at line 30
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.AliasFor; import org.springframework.core.annotation.AliasFor;
/** /**
* An {@link EventListener} that is invoked according to a {@link TransactionPha se}. * An {@link EventListener} that is invoked according to a {@link TransactionPha se}.
* This is an an annotation-based equivalent of {@link TransactionalApplicationL istener}. * This is an annotation-based equivalent of {@link TransactionalApplicationList ener}.
* *
* <p>If the event is not published within an active transaction, the event is d iscarded * <p>If the event is not published within an active transaction, the event is d iscarded
* unless the {@link #fallbackExecution} flag is explicitly set. If a transactio n is * unless the {@link #fallbackExecution} flag is explicitly set. If a transactio n is
* running, the event is processed according to its {@code TransactionPhase}. * running, the event is handled according to its {@code TransactionPhase}.
* *
* <p>Adding {@link org.springframework.core.annotation.Order @Order} to your an notated * <p>Adding {@link org.springframework.core.annotation.Order @Order} to your an notated
* method allows you to prioritize that listener amongst other listeners running before * method allows you to prioritize that listener amongst other listeners running before
* or after transaction completion. * or after transaction completion.
* *
* <p><b>NOTE: Transactional event listeners only work with thread-bound transac tions * <p><b>NOTE: Transactional event listeners only work with thread-bound transac tions
* managed by {@link org.springframework.transaction.PlatformTransactionManager} * managed by a {@link org.springframework.transaction.PlatformTransactionManage
.</b> r
* A reactive transaction managed by {@link org.springframework.transaction.Reac * PlatformTransactionManager}.</b> A reactive transaction managed by a
tiveTransactionManager} * {@link org.springframework.transaction.ReactiveTransactionManager ReactiveTra
* uses the Reactor context instead of thread-local attributes, so from the pers nsactionManager}
pective of * uses the Reactor context instead of thread-local variables, so from the persp
ective of
* an event listener, there is no compatible active transaction that it can part icipate in. * an event listener, there is no compatible active transaction that it can part icipate in.
* *
* <p><strong>WARNING:</strong> if the {@code TransactionPhase} is set to
* {@link TransactionPhase#AFTER_COMMIT AFTER_COMMIT} (the default),
* {@link TransactionPhase#AFTER_ROLLBACK AFTER_ROLLBACK}, or
* {@link TransactionPhase#AFTER_COMPLETION AFTER_COMPLETION}, the transaction w
ill
* have been committed or rolled back already, but the transactional resources m
ight
* still be active and accessible. As a consequence, any data access code trigge
red
* at this point will still "participate" in the original transaction, but chang
es
* will not be committed to the transactional resource. See
* {@link org.springframework.transaction.support.TransactionSynchronization#aft
erCompletion(int)
* TransactionSynchronization.afterCompletion(int)} for details.
*
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Sam Brannen * @author Sam Brannen
* @author Oliver Drotbohm * @author Oliver Drotbohm
* @since 4.2 * @since 4.2
* @see TransactionalApplicationListener * @see TransactionalApplicationListener
* @see TransactionalApplicationListenerMethodAdapter * @see TransactionalApplicationListenerMethodAdapter
*/ */
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE}) @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
skipping to change at line 68 skipping to change at line 80
/** /**
* Phase to bind the handling of an event to. * Phase to bind the handling of an event to.
* <p>The default phase is {@link TransactionPhase#AFTER_COMMIT}. * <p>The default phase is {@link TransactionPhase#AFTER_COMMIT}.
* <p>If no transaction is in progress, the event is not processed at * <p>If no transaction is in progress, the event is not processed at
* all unless {@link #fallbackExecution} has been enabled explicitly. * all unless {@link #fallbackExecution} has been enabled explicitly.
*/ */
TransactionPhase phase() default TransactionPhase.AFTER_COMMIT; TransactionPhase phase() default TransactionPhase.AFTER_COMMIT;
/** /**
* Whether the event should be processed if no transaction is running. * Whether the event should be handled if no transaction is running.
*/ */
boolean fallbackExecution() default false; boolean fallbackExecution() default false;
/** /**
* Alias for {@link #classes}. * Alias for {@link #classes}.
*/ */
@AliasFor(annotation = EventListener.class, attribute = "classes") @AliasFor(annotation = EventListener.class, attribute = "classes")
Class<?>[] value() default {}; Class<?>[] value() default {};
/** /**
 End of changes. 5 change blocks. 
9 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)