35
35
import org .springframework .data .redis .cache .RedisCacheManager ;
36
36
import org .springframework .data .redis .connection .*;
37
37
import org .springframework .data .redis .core .*;
38
+ import org .springframework .data .redis .core .RedisConnectionUtils .RedisConnectionProxy ;
38
39
import org .springframework .data .redis .core .convert .KeyspaceConfiguration ;
39
40
import org .springframework .data .redis .core .convert .MappingConfiguration ;
40
41
import org .springframework .data .redis .core .convert .MappingRedisConverter ;
@@ -157,6 +158,20 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
157
158
boundOperationsProxy (BoundStreamOperations .class , classLoader , hints );
158
159
boundOperationsProxy (BoundValueOperations .class , classLoader , hints );
159
160
boundOperationsProxy (BoundZSetOperations .class , classLoader , hints );
161
+
162
+ // Connection Splitting
163
+ registerRedisConnectionProxy (TypeReference .of (RedisCommands .class ), hints );
164
+ registerRedisConnectionProxy (TypeReference .of (RedisGeoCommands .class ), hints );
165
+ registerRedisConnectionProxy (TypeReference .of (RedisHashCommands .class ), hints );
166
+ registerRedisConnectionProxy (TypeReference .of (RedisHyperLogLogCommands .class ), hints );
167
+ registerRedisConnectionProxy (TypeReference .of (RedisKeyCommands .class ), hints );
168
+ registerRedisConnectionProxy (TypeReference .of (RedisListCommands .class ), hints );
169
+ registerRedisConnectionProxy (TypeReference .of (RedisSetCommands .class ), hints );
170
+ registerRedisConnectionProxy (TypeReference .of (RedisScriptingCommands .class ), hints );
171
+ registerRedisConnectionProxy (TypeReference .of (RedisServerCommands .class ), hints );
172
+ registerRedisConnectionProxy (TypeReference .of (RedisStreamCommands .class ), hints );
173
+ registerRedisConnectionProxy (TypeReference .of (RedisStringCommands .class ), hints );
174
+ registerRedisConnectionProxy (TypeReference .of (RedisZSetCommands .class ), hints );
160
175
}
161
176
162
177
static void boundOperationsProxy (Class <?> type , ClassLoader classLoader , RuntimeHints hints ) {
@@ -179,4 +194,13 @@ static void boundOperationsProxy(TypeReference typeReference, ClassLoader classL
179
194
TypeReference .of ("org.springframework.aop.framework.Advised" ), //
180
195
TypeReference .of ("org.springframework.core.DecoratingProxy" ));
181
196
}
197
+
198
+ static void registerRedisConnectionProxy (TypeReference typeReference , RuntimeHints hints ) {
199
+
200
+ hints .proxies ().registerJdkProxy (TypeReference .of (RedisConnectionProxy .class ), //
201
+ typeReference , //
202
+ TypeReference .of ("org.springframework.aop.SpringProxy" ), //
203
+ TypeReference .of ("org.springframework.aop.framework.Advised" ), //
204
+ TypeReference .of ("org.springframework.core.DecoratingProxy" ));
205
+ }
182
206
}
0 commit comments