|
18 | 18 | import java.util.Arrays;
|
19 | 19 | import java.util.List;
|
20 | 20 |
|
| 21 | +import org.springframework.aop.SpringProxy; |
| 22 | +import org.springframework.aop.framework.Advised; |
21 | 23 | import org.springframework.aot.hint.MemberCategory;
|
22 | 24 | import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
23 | 25 | import org.springframework.aot.hint.TypeReference;
|
| 26 | +import org.springframework.core.DecoratingProxy; |
24 | 27 | import org.springframework.data.cassandra.core.mapping.event.BeforeConvertCallback;
|
25 | 28 | import org.springframework.data.cassandra.core.mapping.event.BeforeSaveCallback;
|
26 | 29 | import org.springframework.data.cassandra.core.mapping.event.ReactiveBeforeConvertCallback;
|
27 | 30 | import org.springframework.data.cassandra.core.mapping.event.ReactiveBeforeSaveCallback;
|
| 31 | +import org.springframework.data.cassandra.observability.CassandraObservationSupplier; |
28 | 32 | import org.springframework.data.cassandra.repository.support.SimpleCassandraRepository;
|
29 | 33 | import org.springframework.data.cassandra.repository.support.SimpleReactiveCassandraRepository;
|
30 | 34 | import org.springframework.data.repository.util.ReactiveWrappers;
|
|
37 | 41 | import com.datastax.oss.driver.api.core.cql.PreparedStatement;
|
38 | 42 | import com.datastax.oss.driver.api.core.cql.SimpleStatement;
|
39 | 43 | import com.datastax.oss.driver.api.core.cql.Statement;
|
40 |
| -import com.datastax.oss.driver.api.core.session.Request; |
41 | 44 |
|
42 | 45 | /**
|
43 | 46 | * {@link RuntimeHintsRegistrar} for repository types and entity callbacks.
|
@@ -79,18 +82,15 @@ public void registerHints(org.springframework.aot.hint.RuntimeHints hints, @Null
|
79 | 82 | hints.reflection().registerTypes(statementInterfaces.stream().map(TypeReference::of).toList(), builder -> builder
|
80 | 83 | .withMembers(MemberCategory.INTROSPECT_DECLARED_METHODS, MemberCategory.INVOKE_PUBLIC_METHODS));
|
81 | 84 |
|
82 |
| - TypeReference obsSupplier = TypeReference |
83 |
| - .of("org.springframework.data.cassandra.observability.CassandraObservationSupplier"); |
84 |
| - hints.reflection().registerTypes(List.of(obsSupplier), builder -> builder |
| 85 | + hints.reflection().registerTypes(List.of(TypeReference.of(CassandraObservationSupplier.class)), builder -> builder |
85 | 86 | .withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS));
|
86 | 87 |
|
87 | 88 | for (Class<?> statementInterface : statementInterfaces) {
|
88 |
| - hints.proxies().registerJdkProxy(TypeReference.of(statementInterface), TypeReference.of(Request.class), |
89 |
| - obsSupplier); |
| 89 | + hints.proxies().registerJdkProxy(statementInterface, CassandraObservationSupplier.class, SpringProxy.class, |
| 90 | + Advised.class, DecoratingProxy.class); |
90 | 91 | }
|
91 | 92 |
|
92 |
| - hints.proxies().registerJdkProxy(CqlSession.class); |
| 93 | + hints.proxies().registerJdkProxy(CqlSession.class, SpringProxy.class, Advised.class, DecoratingProxy.class); |
93 | 94 | }
|
94 |
| - |
95 | 95 | }
|
96 | 96 | }
|
0 commit comments