GH-3502: More refactoring to avoid reflection (#3532)

* GH-3502: More refactoring to avoid reflection

Fixes https://github.com/spring-projects/spring-integration/issues/3502

* Move `ChannelInitializer` bean registration into an `AbstractIntegrationNamespaceHandler` -
it was never used for annotations and Java DSL...
* Rework `IntegrationFlows.fromSupplier()` to call a provided `Supplier` directly -
not via reflection in the `MethodInvokingMessageSource`
* Resolve new Sonar smells
* Rework `EndpointSpec` to accept an expected factory bean instance via ctor arg
instead of reflection
* Rework `Jackson2JsonObjectMapper` to use well-known module instances directly -
not via reflection from their class names

* * Revert `DefaultMethodInvokingMethodInterceptor.methodHandleCache` property definition wrap
This commit is contained in:
Artem Bilan
2021-04-06 10:06:07 -04:00
committed by GitHub
parent 27e1f3a636
commit 3f0c57894b
21 changed files with 372 additions and 308 deletions

View File

@@ -25,7 +25,6 @@ import org.springframework.core.ParameterizedTypeReference;
import org.springframework.expression.Expression;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.integration.dsl.ComponentsRegistration;
import org.springframework.integration.dsl.MessageHandlerSpec;
import org.springframework.integration.expression.FunctionExpression;
@@ -312,9 +311,10 @@ public abstract class BaseHttpMessageHandlerSpec<S extends BaseHttpMessageHandle
}
/**
* The flag to extract a body of the {@link ResponseEntity} for reply message payload.
* Defaults to true.
* @param extractResponseBody produce a reply message with a whole {@link ResponseEntity} or just its body.
* The flag to extract a body of the {@link org.springframework.http.ResponseEntity}
* for reply message payload. Defaults to true.
* @param extractResponseBody produce a reply message with a whole
* {@link org.springframework.http.ResponseEntity} or just its body.
* @return the current Spec.
* @since 5.5
*/