diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/CachingConfigurer.java b/spring-context/src/main/java/org/springframework/cache/annotation/CachingConfigurer.java index d3f3145367e..26b3afb46a2 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/CachingConfigurer.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/CachingConfigurer.java @@ -32,6 +32,10 @@ import org.springframework.lang.Nullable; * {@link #cacheManager()}, {@link #cacheResolver()}, {@link #keyGenerator()}, and * {@link #errorHandler()} for detailed instructions. * + *

NOTE: A {@code CachingConfigurer} will get initialized early. + * Do not inject common dependencies into autowired fields directly; instead, consider + * declaring a lazy {@link org.springframework.beans.factory.ObjectProvider} for those. + * * @author Chris Beams * @author Stephane Nicoll * @since 3.1 diff --git a/spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java b/spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java index 701f94a2caf..e2d2363373f 100644 --- a/spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java +++ b/spring-core/src/main/java/org/springframework/core/task/SimpleAsyncTaskExecutor.java @@ -195,6 +195,11 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator * The default of -1 indicates no concurrency limit at all. *

This is the equivalent of a maximum pool size in a thread pool, * preventing temporary overload of the thread management system. + * However, in contrast to a thread pool with a managed task queue, + * this executor will block the submitter until the task can be + * accepted when the configured concurrency limit has been reached. + * If you prefer queue-based task hand-offs without such blocking, + * consider using a {@code ThreadPoolTaskExecutor} instead. * @see #UNBOUNDED_CONCURRENCY * @see org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor#setMaxPoolSize */ diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/TransactionManagementConfigurer.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/TransactionManagementConfigurer.java index c6c4e37ff41..55775347ace 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/annotation/TransactionManagementConfigurer.java +++ b/spring-tx/src/main/java/org/springframework/transaction/annotation/TransactionManagementConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,10 @@ import org.springframework.transaction.TransactionManager; *

See @{@link EnableTransactionManagement} for general examples and context; * see {@link #annotationDrivenTransactionManager()} for detailed instructions. * + *

NOTE: A {@code TransactionManagementConfigurer} will get initialized early. + * Do not inject common dependencies into autowired fields directly; instead, consider + * declaring a lazy {@link org.springframework.beans.factory.ObjectProvider} for those. + * *

Note that in by-type lookup disambiguation cases, an alternative approach to * implementing this interface is to simply mark one of the offending * {@code PlatformTransactionManager} {@code @Bean} methods (or diff --git a/spring-web/src/main/java/org/springframework/http/client/reactive/JettyClientHttpConnector.java b/spring-web/src/main/java/org/springframework/http/client/reactive/JettyClientHttpConnector.java index 071a161e909..ca255fe9737 100644 --- a/spring-web/src/main/java/org/springframework/http/client/reactive/JettyClientHttpConnector.java +++ b/spring-web/src/main/java/org/springframework/http/client/reactive/JettyClientHttpConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/JettyWebSocketHandlerAdapter.java b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/JettyWebSocketHandlerAdapter.java index 8e3a21fdfc1..36686839443 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/JettyWebSocketHandlerAdapter.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/JettyWebSocketHandlerAdapter.java @@ -287,48 +287,18 @@ public class JettyWebSocketHandlerAdapter implements Session.Listener { @Override public ByteBufferIterator readableByteBuffers() { - ByteBufferIterator delegateIterator = this.delegate.readableByteBuffers(); - return new JettyByteBufferIterator(delegateIterator); + return this.delegate.readableByteBuffers(); } @Override public ByteBufferIterator writableByteBuffers() { - ByteBufferIterator delegateIterator = this.delegate.writableByteBuffers(); - return new JettyByteBufferIterator(delegateIterator); + return this.delegate.writableByteBuffers(); } @Override public String toString(int index, int length, Charset charset) { return this.delegate.toString(index, length, charset); } - - - private static class JettyByteBufferIterator implements ByteBufferIterator { - - private final ByteBufferIterator delegate; - - - JettyByteBufferIterator(ByteBufferIterator delegate) { - Assert.notNull(delegate, "Delegate must not be null"); - - this.delegate = delegate; - } - - @Override - public void close() { - this.delegate.close(); - } - - @Override - public boolean hasNext() { - return this.delegate.hasNext(); - } - - @Override - public ByteBuffer next() { - return this.delegate.next(); - } - } } }