27
27
import java .util .stream .Stream ;
28
28
29
29
import org .springframework .aop .framework .AopProxyUtils ;
30
+ import org .springframework .aot .hint .ExecutableMode ;
30
31
import org .springframework .aot .hint .MemberCategory ;
31
32
import org .springframework .aot .hint .ProxyHints ;
32
33
import org .springframework .aot .hint .ReflectionHints ;
35
36
import org .springframework .aot .hint .SerializationHints ;
36
37
import org .springframework .aot .hint .TypeReference ;
37
38
import org .springframework .beans .factory .config .BeanExpressionContext ;
38
- import org .springframework .context .Lifecycle ;
39
39
import org .springframework .context .SmartLifecycle ;
40
40
import org .springframework .integration .aggregator .MessageGroupProcessor ;
41
41
import org .springframework .integration .context .IntegrationContextUtils ;
44
44
import org .springframework .integration .core .GenericSelector ;
45
45
import org .springframework .integration .core .GenericTransformer ;
46
46
import org .springframework .integration .core .MessageSource ;
47
+ import org .springframework .integration .core .Pausable ;
47
48
import org .springframework .integration .dsl .IntegrationFlow ;
49
+ import org .springframework .integration .endpoint .AbstractEndpoint ;
48
50
import org .springframework .integration .gateway .MethodArgsHolder ;
49
51
import org .springframework .integration .gateway .RequestReplyExchanger ;
50
52
import org .springframework .integration .handler .AbstractReplyProducingMessageHandler ;
63
65
import org .springframework .messaging .PollableChannel ;
64
66
import org .springframework .messaging .support .ErrorMessage ;
65
67
import org .springframework .messaging .support .GenericMessage ;
68
+ import org .springframework .util .ReflectionUtils ;
66
69
67
70
/**
68
71
* {@link RuntimeHintsRegistrar} for Spring Integration core module.
@@ -88,7 +91,7 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
88
91
MethodArgsHolder .class ,
89
92
AbstractReplyProducingMessageHandler .RequestHandler .class ,
90
93
ExpressionEvaluatingRoutingSlipRouteStrategy .RequestAndReply .class ,
91
- Lifecycle .class )
94
+ Pausable .class )
92
95
.forEach (type -> reflectionHints .registerType (type , MemberCategory .INVOKE_PUBLIC_METHODS ));
93
96
94
97
reflectionHints .registerType (JsonPathUtils .class ,
@@ -100,12 +103,14 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
100
103
reflectionHints .registerTypeIfPresent (classLoader , "org.springframework.integration.xml.xpath.XPathUtils" ,
101
104
MemberCategory .INVOKE_PUBLIC_METHODS );
102
105
103
- Stream .of (
104
- "kotlin.jvm.functions.Function0" ,
105
- "kotlin.jvm.functions.Function1" )
106
+ Stream .of ("kotlin.jvm.functions.Function0" , "kotlin.jvm.functions.Function1" )
106
107
.forEach (type ->
107
108
reflectionHints .registerTypeIfPresent (classLoader , type , MemberCategory .INVOKE_PUBLIC_METHODS ));
108
109
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
+
109
114
hints .resources ().registerPattern ("META-INF/spring.integration.properties" );
110
115
111
116
SerializationHints serializationHints = hints .serialization ();
0 commit comments