1414 * limitations under the License.
1515 */
1616
17- package de .codecentric .boot .admin ;
17+ package de .codecentric .boot .admin . server . ui . config ;
1818
1919import java .util .ArrayList ;
2020import java .util .HashMap ;
2121import java .util .Map ;
22- import java .util .Set ;
2322
2423import com .fasterxml .jackson .databind .ser .std .ClassSerializer ;
2524import com .fasterxml .jackson .databind .ser .std .FileSerializer ;
2827import lombok .SneakyThrows ;
2928import org .springframework .aot .hint .ExecutableMode ;
3029import org .springframework .aot .hint .MemberCategory ;
30+ import org .springframework .aot .hint .RuntimeHints ;
3131import org .springframework .aot .hint .RuntimeHintsRegistrar ;
3232import org .springframework .aot .hint .TypeHint ;
3333import org .springframework .aot .hint .TypeReference ;
3434import org .springframework .context .annotation .Configuration ;
3535
36- import de .codecentric .boot .admin .client .registration .Application ;
3736import de .codecentric .boot .admin .server .domain .entities .Instance ;
3837import de .codecentric .boot .admin .server .domain .events .InstanceDeregisteredEvent ;
3938import de .codecentric .boot .admin .server .domain .events .InstanceEndpointsDetectedEvent ;
5049import de .codecentric .boot .admin .server .domain .values .Registration ;
5150import de .codecentric .boot .admin .server .domain .values .StatusInfo ;
5251import de .codecentric .boot .admin .server .domain .values .Tags ;
53- import de .codecentric .boot .admin .server .ui .config .AdminServerUiProperties ;
54- import de .codecentric .boot .admin .server .ui .config .CssColorUtils ;
5552import de .codecentric .boot .admin .server .ui .web .UiController ;
5653import de .codecentric .boot .admin .server .utils .jackson .BuildVersionMixin ;
5754import de .codecentric .boot .admin .server .utils .jackson .EndpointMixin ;
6966import de .codecentric .boot .admin .server .utils .jackson .TagsMixin ;
7067import de .codecentric .boot .admin .server .web .InstanceWebProxy ;
7168
72- import static org .springframework .util .ReflectionUtils .findMethod ;
73-
7469@ Configuration
75- public class RuntimeHints implements RuntimeHintsRegistrar {
70+ public class ServerRuntimeHints implements RuntimeHintsRegistrar {
7671
7772 @ Override
78- public void registerHints (org . springframework . aot . hint . RuntimeHints hints , ClassLoader classLoader ) {
73+ public void registerHints (RuntimeHints hints , ClassLoader classLoader ) {
7974 registerReflectionHints (hints );
8075
8176 registerResourcesHints (hints );
8277
8378 registerSerializationHints (hints );
8479 }
8580
86- private static void registerSerializationHints (org . springframework . aot . hint . RuntimeHints hints ) {
81+ private static void registerSerializationHints (RuntimeHints hints ) {
8782 hints .serialization ()
8883 .registerType (HashMap .class )
8984 .registerType (ArrayList .class )
@@ -107,23 +102,6 @@ private static void registerResourcesHints(org.springframework.aot.hint.RuntimeH
107102
108103 @ SneakyThrows
109104 private static void registerReflectionHints (org .springframework .aot .hint .RuntimeHints hints ) {
110- Set .of (new java .lang .reflect .Method [] { findMethod (UiController .Settings .class , "getTitle" ),
111- findMethod (UiController .Settings .class , "getBrand" ),
112- findMethod (UiController .Settings .class , "getLoginIcon" ),
113- findMethod (UiController .Settings .class , "getFavicon" ),
114- findMethod (UiController .Settings .class , "getFaviconDanger" ),
115- findMethod (UiController .Settings .class , "getPollTimer" ),
116- findMethod (UiController .Settings .class , "getTheme" ),
117- findMethod (UiController .Settings .class , "isNotificationFilterEnabled" ),
118- findMethod (UiController .Settings .class , "isRememberMeEnabled" ),
119- findMethod (UiController .Settings .class , "getAvailableLanguages" ),
120- findMethod (UiController .Settings .class , "getRoutes" ),
121- findMethod (UiController .Settings .class , "getExternalViews" ),
122- findMethod (UiController .Settings .class , "getViewSettings" ), findMethod (UiController .class , "index" ),
123- findMethod (AdminServerUiProperties .UiTheme .class , "getPalette" ),
124- findMethod (AdminServerUiProperties .UiTheme .class , "getColor" ) })
125- .forEach ((method ) -> hints .reflection ().registerMethod (method , ExecutableMode .INVOKE ));
126-
127105 Class <?> queryEndpointStrategyResponse = Class
128106 .forName ("de.codecentric.boot.admin.server.services.endpoints.QueryIndexEndpointStrategy$Response" );
129107 Class <?> queryEndpointStrategyResponseEndpointRef = Class .forName (
@@ -134,7 +112,13 @@ private static void registerReflectionHints(org.springframework.aot.hint.Runtime
134112 MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
135113 .registerType (queryEndpointStrategyResponseEndpointRef , MemberCategory .INVOKE_PUBLIC_METHODS ,
136114 MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
137- .registerType (Application .Builder .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
115+ .registerType (UiController .Settings .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
116+ MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
117+ .registerType (AdminServerUiProperties .UiTheme .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
118+ MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
119+ .registerType (AdminServerUiProperties .Palette .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
120+ MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
121+ .registerType (CssColorUtils .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
138122 MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
139123 .registerType (InstanceDeregisteredEvent .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
140124 MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
@@ -152,8 +136,6 @@ private static void registerReflectionHints(org.springframework.aot.hint.Runtime
152136 MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
153137 .registerType (InstanceId .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
154138 MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
155- .registerType (Application .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
156- MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
157139 .registerType (Endpoint .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
158140 MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
159141 .registerType (Instance .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
@@ -164,10 +146,6 @@ private static void registerReflectionHints(org.springframework.aot.hint.Runtime
164146 MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
165147 .registerType (InstanceWebProxy .ForwardRequest .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
166148 MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
167- .registerType (AdminServerUiProperties .Palette .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
168- MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
169- .registerType (CssColorUtils .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
170- MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
171149
172150 .registerType (BuildVersionMixin .class , MemberCategory .INVOKE_PUBLIC_METHODS ,
173151 MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS )
@@ -202,9 +180,7 @@ private static void registerReflectionHints(org.springframework.aot.hint.Runtime
202180 .registerConstructor (
203181 queryEndpointStrategyResponseEndpointRef .getDeclaredConstructor (String .class , boolean .class ),
204182 ExecutableMode .INVOKE )
205- .registerConstructor (Application .Builder .class .getDeclaredConstructor (), ExecutableMode .INVOKE )
206- .registerMethod (Application .Builder .class .getMethod ("build" ), ExecutableMode .INVOKE )
207- .registerMethod (Application .class .getMethod ("builder" ), ExecutableMode .INVOKE )
183+
208184 .registerConstructor (Registration .class .getDeclaredConstructor (String .class , String .class , String .class ,
209185 String .class , String .class , Map .class ), ExecutableMode .INVOKE )
210186 .registerConstructor (Registration .Builder .class .getDeclaredConstructor (), ExecutableMode .INVOKE )
0 commit comments