1
+ /*
2
+ * Copyright 2005-2023 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
1
17
package org .springframework .ldap .aot .hint ;
2
18
3
19
import org .springframework .aot .hint .MemberCategory ;
4
20
import org .springframework .aot .hint .RuntimeHints ;
5
21
import org .springframework .aot .hint .RuntimeHintsRegistrar ;
6
22
import org .springframework .aot .hint .TypeReference ;
23
+ import org .springframework .ldap .control .PagedResultsDirContextProcessor ;
24
+ import org .springframework .ldap .control .SortControlDirContextProcessor ;
7
25
import org .springframework .ldap .core .support .AbstractContextSource ;
8
26
import org .springframework .ldap .core .support .DefaultDirObjectFactory ;
9
27
@@ -23,6 +41,30 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
23
41
.withMembers (MemberCategory .INTROSPECT_DECLARED_METHODS , MemberCategory .DECLARED_FIELDS ));
24
42
hints .reflection ().registerType (DefaultDirObjectFactory .class ,
25
43
(builder ) -> builder .withMembers (MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS ));
44
+ hints .reflection ().registerTypeIfPresent (classLoader , "javax.naming.ldap.PagedResultsControl" ,
45
+ (builder ) -> builder .onReachableType (PagedResultsDirContextProcessor .class )
46
+ .withMembers (MemberCategory .INVOKE_PUBLIC_METHODS , MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS ));
47
+ hints .reflection ().registerTypeIfPresent (classLoader , "com.sun.jndi.ldap.ctl.PagedResultsControl" ,
48
+ (builder ) -> builder .onReachableType (PagedResultsDirContextProcessor .class )
49
+ .withMembers (MemberCategory .INVOKE_PUBLIC_METHODS , MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS ));
50
+ hints .reflection ().registerTypeIfPresent (classLoader , "javax.naming.ldap.PagedResultsResponseControl" ,
51
+ (builder ) -> builder .onReachableType (PagedResultsDirContextProcessor .class )
52
+ .withMembers (MemberCategory .INVOKE_PUBLIC_METHODS , MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS ));
53
+ hints .reflection ().registerTypeIfPresent (classLoader , "com.sun.jndi.ldap.ctl.PagedResultsResponseControl" ,
54
+ (builder ) -> builder .onReachableType (PagedResultsDirContextProcessor .class )
55
+ .withMembers (MemberCategory .INVOKE_PUBLIC_METHODS , MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS ));
56
+ hints .reflection ().registerTypeIfPresent (classLoader , "javax.naming.ldap.SortControl" ,
57
+ (builder ) -> builder .onReachableType (SortControlDirContextProcessor .class )
58
+ .withMembers (MemberCategory .INVOKE_PUBLIC_METHODS , MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS ));
59
+ hints .reflection ().registerTypeIfPresent (classLoader , "com.sun.jndi.ldap.ctl.SortControl" ,
60
+ (builder ) -> builder .onReachableType (SortControlDirContextProcessor .class )
61
+ .withMembers (MemberCategory .INVOKE_PUBLIC_METHODS , MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS ));
62
+ hints .reflection ().registerTypeIfPresent (classLoader , "javax.naming.ldap.SortResponseControl" ,
63
+ (builder ) -> builder .onReachableType (SortControlDirContextProcessor .class )
64
+ .withMembers (MemberCategory .INVOKE_PUBLIC_METHODS , MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS ));
65
+ hints .reflection ().registerTypeIfPresent (classLoader , "com.sun.jndi.ldap.ctl.SortResponseControl" ,
66
+ (builder ) -> builder .onReachableType (SortControlDirContextProcessor .class )
67
+ .withMembers (MemberCategory .INVOKE_PUBLIC_METHODS , MemberCategory .INVOKE_PUBLIC_CONSTRUCTORS ));
26
68
}
27
69
28
70
}
0 commit comments