Commit Graph

2298 Commits

Author SHA1 Message Date
Juergen Hoeller
66235fa8c8 Consistent TaskDecorator and ErrorHandler support in schedulers
Closes gh-23755
Closes gh-32460
2024-03-15 21:07:59 +01:00
Sam Brannen
e1b1435a00 Stop referring to JDK 1.5 plus polishing 2024-03-14 16:00:51 +01:00
Stéphane Nicoll
13679bb906 Reject use of component scan with REGISTER_BEAN condition
This commit introduce a change of behaviour when component scan is used
with conditions. Previously, any condition in the REGISTER_BEAN phase
were ignored and the scan was applied regardless of the outcome of
those conditions. This is because REGISTER_BEAN condition evaluation
happens later in the bean factory preparation.

Rather than ignoring those conditions, this commit fails fast when it
detects such use case. Code will have to be adapted accordingly.

Closes gh-23206
2024-03-12 08:39:53 +01:00
Juergen Hoeller
19fec0633f Local root directory and jar caching in PathMatchingResourcePatternResolver
Closes gh-21190
2024-03-08 19:12:14 +01:00
Sam Brannen
ac1176af53 Use Map#computeIfAbsent in SpEL support classes
Closes gh-32385
2024-03-07 13:55:35 +01:00
Sam Brannen
dcbc2ef134 Polishing 2024-03-07 13:55:35 +01:00
Simon Baslé
7f0ab22c47 Merge branch '6.1.x' 2024-03-07 12:10:07 +01:00
Simon Baslé
6d9a2eb9b8 Improve fix of duplicate upstream subscription during reactive cache put
This commit fixes an issue where a Cacheable method which returns a
Flux (or multi-value publisher) will be invoked once, but the returned
publisher is actually subscribed twice.

The previous fix 988f3630c would cause the cached elements to depend on
the first usage pattern / request pattern, which is likely to be too
confusing to users. This fix reintroduces the notion of exhausting the
original Flux by having a second subscriber dedicated to that, but uses
`refCount(2)` to ensure that the original `Flux` returned by the cached
method is still only subscribed once.

Closes gh-32370
2024-03-07 12:08:28 +01:00
Juergen Hoeller
13221ac0ef Merge branch '6.1.x'
# Conflicts:
#	spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java
#	spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionInterceptorTests.java
2024-03-06 18:09:32 +01:00
Juergen Hoeller
e5e61dfa3f Ignore scheduled task exceptions after shutdown
Includes suppression after logging, not propagating exceptions to the thread itself.

Closes gh-32381
See gh-32298
2024-03-06 18:03:31 +01:00
Simon Baslé
19b5f11734 Merge branch '6.1.x' 2024-03-05 18:33:48 +01:00
Simon Baslé
988f3630c4 Avoid duplicate upstream subscription during reactive cache put
This commit fixes an issue where a Cacheable method which returns a
Flux (or multi-value publisher) will be invoked once, but the returned
publisher is actually subscribed twice.

By using the Reactor `tap` operator, we ensure that we can emit values
downstream AND accumulate emitted values into the List with a single
subscription.

The SignalListener additionally handles scenarios involving cancel,
for instance in case of a `take(1)` in the chain. In that case values
emitted up until that point will have been stored into the List buffer,
so we can still put it in the cache. In case of error, no caching occurs
and the internal buffer is cleared. This implementation also protects
against competing onComplete/onError signals and cancel signals.

Closes gh-32370
2024-03-05 18:32:32 +01:00
Juergen Hoeller
6f7f032ced Merge branch '6.1.x' 2024-03-05 18:24:01 +01:00
Juergen Hoeller
a0ae849856 Polishing 2024-03-05 18:23:13 +01:00
Juergen Hoeller
7d4c8a403e Introduce configurable default rollback rules
Includes rollbackOn annotation attribute on @EnableTransactionManagement and addDefaultRollbackRule method on AnnotationTransactionAttributeSource, as well as publicMethodsOnly as instance-level flag (also on AnnotationCacheOperationSource).

Closes gh-23473
2024-03-05 18:08:08 +01:00
Juergen Hoeller
30e75e4a09 Enable efficient pointcut checks for composite sources as well
Closes gh-20072
2024-03-05 13:34:48 +01:00
ali dandach
1cb2dfa459 enh: use isEmpty() instead of length() 2024-03-04 23:55:33 +01:00
Juergen Hoeller
dc6c96de0a Merge branch '6.1.x'
# Conflicts:
#	spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractFallbackJCacheOperationSource.java
#	spring-context/src/main/java/org/springframework/cache/interceptor/AbstractFallbackCacheOperationSource.java
#	spring-tx/src/main/java/org/springframework/transaction/interceptor/AbstractFallbackTransactionAttributeSource.java
2024-03-04 22:50:22 +01:00
Juergen Hoeller
e9110c0729 Polishing 2024-03-04 22:48:52 +01:00
Juergen Hoeller
3d7ef3ebfc Avoid storage of null marker per method for proxy decision purposes
Includes missing isCandidateClass support on JCacheOperationSource.

Closes gh-20072
2024-03-04 12:55:33 +01:00
Juergen Hoeller
f22a1eece4 Polishing 2024-02-28 19:14:37 +01:00
Juergen Hoeller
3477738bed Consistently pick lowest superclass level to replace
See gh-28676
2024-02-28 15:49:05 +01:00
Juergen Hoeller
fa5d246a1b Replace all exposed superclasses in final step after traversal
See gh-28676
2024-02-28 15:39:53 +01:00
Juergen Hoeller
17b2087198 Introduce background bootstrapping for individual singleton beans
Closes gh-13410
Closes gh-19487
See gh-23501
2024-02-27 22:33:18 +01:00
Sam Brannen
122372c580 Spring cleaning: update copyright headers 2024-02-23 12:21:22 +01:00
Sam Brannen
c98bebd6d3 Spring cleaning: add missing @⁠Override annotations 2024-02-23 12:20:11 +01:00
Sam Brannen
d0ffc16efc Spring cleaning: avoid unnecessary static imports 2024-02-23 12:20:11 +01:00
Sam Brannen
4bd1485ce4 Spring cleaning: use method references 2024-02-23 12:20:11 +01:00
Sam Brannen
3c00637c88 Fix @⁠inheritDoc usage 2024-02-23 12:08:29 +01:00
Juergen Hoeller
524588ef93 Avoid transaction listener execution without transaction management setup
Closes gh-32319
2024-02-23 11:53:05 +01:00
Juergen Hoeller
7ffeb59b40 Polishing 2024-02-21 22:45:39 +01:00
Juergen Hoeller
f811f0dc18 Clarify primary/fallback autowiring for arrays/collections/maps
Closes gh-32301
2024-02-21 20:24:57 +01:00
Juergen Hoeller
f5397d6426 Consistent processing of overridden bean methods
Closes gh-28286
2024-02-21 18:36:03 +01:00
Sam Brannen
644887e094 Polish (Linked)HashSet usage
See gh-32291
2024-02-21 16:22:31 +01:00
Sam Brannen
b9c304b890 Polish contribution
See gh-32291
2024-02-21 16:19:53 +01:00
Patrick Strawderman
e1a32d4ba9 Avoid resizing of fixed-size HashSet/LinkedHashSet variants
Add helpers to CollectionUtils for building HashSets and LinkedHashSets
that can hold an expected number of elements without needing to
resize/rehash.

Closes gh-32291
2024-02-21 16:19:53 +01:00
Sam Brannen
3fb170058f Polish contribution
See gh-32294
2024-02-21 14:09:09 +01:00
Patrick Strawderman
f9fe8efb2e Use ConcurrentHashMap.newKeySet
In places where a ConcurrentHashMap was used as a set by wrapping it
with Collections.newSetFromMap, switch to just using the set returned
by ConcurrentHashMap.newKeySet directly.

Closes gh-32294
2024-02-21 14:08:38 +01:00
Juergen Hoeller
ff9c7141c5 Replace superclass exposure in case of late configuration class skipping
Closes gh-28676
2024-02-21 11:10:27 +01:00
Stéphane Nicoll
871f705bca Remove ComponentScan duplicate condition
Closes gh-27077
2024-02-21 10:09:31 +01:00
Juergen Hoeller
22b41c33ba Preserve existing imported class over scanned configuration class
Closes gh-24643
2024-02-20 20:43:41 +01:00
Juergen Hoeller
266953195c Avoid enhancement of configuration class in case of existing instance
Closes gh-25738
2024-02-20 20:43:09 +01:00
Juergen Hoeller
ad2e95be4b Merge branch '6.1.x' 2024-02-20 15:43:24 +01:00
Juergen Hoeller
93f0ec2fa1 Polishing 2024-02-20 15:42:15 +01:00
Juergen Hoeller
85c9279431 Consistent default error handling/logging for all scheduled tasks
Closes gh-32298
2024-02-20 15:42:07 +01:00
Juergen Hoeller
480051a21c Introduce fallback flag and annotation (as companion to primary)
Closes gh-26241
2024-02-20 13:37:41 +01:00
Juergen Hoeller
a8fb16b47c Introduce defaultCandidate flag (for plain type vs. qualified match)
Closes gh-26528
2024-02-20 12:00:47 +01:00
Sam Brannen
c6e6a3e44d Link to section in reference manual 2024-02-18 18:19:59 +01:00
Sam Brannen
7c07c43201 Polishing 2024-02-16 15:00:06 +01:00
Juergen Hoeller
6791ea94a0 Change executor phase to MAX_VALUE/2 and reduce timeout to 10 seconds
Closes gh-32152
2024-02-16 14:16:32 +01:00