2727import java .util .stream .Stream ;
2828
2929import org .springframework .aop .framework .AopProxyUtils ;
30+ import org .springframework .aot .hint .ExecutableMode ;
3031import org .springframework .aot .hint .MemberCategory ;
3132import org .springframework .aot .hint .ProxyHints ;
3233import org .springframework .aot .hint .ReflectionHints ;
3536import org .springframework .aot .hint .SerializationHints ;
3637import org .springframework .aot .hint .TypeReference ;
3738import org .springframework .beans .factory .config .BeanExpressionContext ;
38- import org .springframework .context .Lifecycle ;
3939import org .springframework .context .SmartLifecycle ;
4040import org .springframework .integration .aggregator .MessageGroupProcessor ;
4141import org .springframework .integration .context .IntegrationContextUtils ;
4444import org .springframework .integration .core .GenericSelector ;
4545import org .springframework .integration .core .GenericTransformer ;
4646import org .springframework .integration .core .MessageSource ;
47+ import org .springframework .integration .core .Pausable ;
4748import org .springframework .integration .dsl .IntegrationFlow ;
49+ import org .springframework .integration .endpoint .AbstractEndpoint ;
4850import org .springframework .integration .gateway .MethodArgsHolder ;
4951import org .springframework .integration .gateway .RequestReplyExchanger ;
5052import org .springframework .integration .handler .AbstractReplyProducingMessageHandler ;
6365import org .springframework .messaging .PollableChannel ;
6466import org .springframework .messaging .support .ErrorMessage ;
6567import org .springframework .messaging .support .GenericMessage ;
68+ import org .springframework .util .ReflectionUtils ;
6669
6770/**
6871 * {@link RuntimeHintsRegistrar} for Spring Integration core module.
@@ -88,7 +91,7 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
8891 MethodArgsHolder .class ,
8992 AbstractReplyProducingMessageHandler .RequestHandler .class ,
9093 ExpressionEvaluatingRoutingSlipRouteStrategy .RequestAndReply .class ,
91- Lifecycle .class )
94+ Pausable .class )
9295 .forEach (type -> reflectionHints .registerType (type , MemberCategory .INVOKE_PUBLIC_METHODS ));
9396
9497 reflectionHints .registerType (JsonPathUtils .class ,
@@ -100,12 +103,14 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
100103 reflectionHints .registerTypeIfPresent (classLoader , "org.springframework.integration.xml.xpath.XPathUtils" ,
101104 MemberCategory .INVOKE_PUBLIC_METHODS );
102105
103- Stream .of (
104- "kotlin.jvm.functions.Function0" ,
105- "kotlin.jvm.functions.Function1" )
106+ Stream .of ("kotlin.jvm.functions.Function0" , "kotlin.jvm.functions.Function1" )
106107 .forEach (type ->
107108 reflectionHints .registerTypeIfPresent (classLoader , type , MemberCategory .INVOKE_PUBLIC_METHODS ));
108109
110+ Stream .of ("start" , "stop" , "isRunning" )
111+ .flatMap ((name ) -> Stream .ofNullable (ReflectionUtils .findMethod (AbstractEndpoint .class , name )))
112+ .forEach (method -> reflectionHints .registerMethod (method , ExecutableMode .INVOKE ));
113+
109114 hints .resources ().registerPattern ("META-INF/spring.integration.properties" );
110115
111116 SerializationHints serializationHints = hints .serialization ();
0 commit comments