15
15
import org .infinispan .configuration .cache .StoreConfiguration ;
16
16
import org .infinispan .configuration .cache .StoreConfigurationBuilder ;
17
17
import org .infinispan .configuration .parsing .ConfigurationParser ;
18
+ import org .infinispan .configuration .serializing .ConfigurationSerializer ;
19
+ import org .infinispan .configuration .serializing .SerializedWith ;
18
20
import org .infinispan .distribution .ch .ConsistentHashFactory ;
19
21
import org .infinispan .distribution .ch .impl .HashFunctionPartitioner ;
20
22
import org .infinispan .factories .impl .ModuleMetadataBuilder ;
30
32
import org .infinispan .notifications .cachelistener .annotation .CacheEntryRemoved ;
31
33
import org .infinispan .persistence .spi .CacheLoader ;
32
34
import org .infinispan .persistence .spi .CacheWriter ;
35
+ import org .infinispan .persistence .spi .NonBlockingStore ;
33
36
import org .infinispan .quarkus .embedded .runtime .InfinispanEmbeddedProducer ;
34
37
import org .infinispan .quarkus .embedded .runtime .InfinispanEmbeddedRuntimeConfig ;
35
38
import org .infinispan .quarkus .embedded .runtime .InfinispanRecorder ;
@@ -102,7 +105,12 @@ void setup(BuildProducer<FeatureBuildItem> feature, BuildProducer<ReflectiveClas
102
105
"default-configs/default-jgroups-kubernetes.xml" ,
103
106
"default-configs/default-jgroups-ec2.xml" ,
104
107
"default-configs/default-jgroups-google.xml" ,
105
- "default-configs/default-jgroups-azure.xml" ));
108
+ "default-configs/default-jgroups-azure.xml" ,
109
+ "stacks/udp.xml" ,
110
+ "stacks/tcp.xml" ,
111
+ "stacks/tcp_mping/tcp1.xml" ,
112
+ "stacks/tcp_mping/tcp2.xml"
113
+ ));
106
114
107
115
reflectiveClass .produce (new ReflectiveClassBuildItem (false , false , HashFunctionPartitioner .class ));
108
116
reflectiveClass .produce (new ReflectiveClassBuildItem (false , false , JGroupsTransport .class ));
@@ -148,6 +156,8 @@ void setup(BuildProducer<FeatureBuildItem> feature, BuildProducer<ReflectiveClas
148
156
addReflectionForClass (CacheLoader .class , true , combinedIndex , reflectiveClass , excludedClasses );
149
157
addReflectionForClass (CacheWriter .class , true , combinedIndex , reflectiveClass , excludedClasses );
150
158
159
+ addReflectionForClass (NonBlockingStore .class , true , combinedIndex , reflectiveClass , excludedClasses );
160
+
151
161
// We have to include all of our interceptors - technically a custom one is installed before or after ISPN ones
152
162
// If we don't want to support custom interceptors this should be removable
153
163
// We use reflection to set fields from the properties so those must be exposed as well
@@ -161,6 +171,9 @@ void setup(BuildProducer<FeatureBuildItem> feature, BuildProducer<ReflectiveClas
161
171
addReflectionForName (StoreConfiguration .class .getName (), true , combinedIndex , reflectiveClass , true , false ,
162
172
excludedClasses );
163
173
174
+ // We use reflection to find various configuration serializers
175
+ addReflectionForClass (ConfigurationSerializer .class , true , combinedIndex , reflectiveClass , excludedClasses );
176
+
164
177
reflectiveClass .produce (new ReflectiveClassBuildItem (false , false , Util .AddressScope .class ));
165
178
166
179
// Add Infinispan and user listeners to reflection list
@@ -186,14 +199,11 @@ void setup(BuildProducer<FeatureBuildItem> feature, BuildProducer<ReflectiveClas
186
199
// it would be nice to not have this required for Infinispan classes
187
200
Collection <AnnotationInstance > serializeWith = combinedIndex
188
201
.getAnnotations (DotName .createSimple (SerializeWith .class .getName ()));
189
- for (AnnotationInstance instance : serializeWith ) {
190
- AnnotationValue withValue = instance .value ();
191
- String withValueString = withValue .asString ();
192
- DotName targetSerializer = DotName .createSimple (withValueString );
193
- if (!excludedClasses .contains (targetSerializer )) {
194
- reflectiveClass .produce (new ReflectiveClassBuildItem (false , false , withValueString ));
195
- }
196
- }
202
+ registerSerializeWith (serializeWith , reflectiveClass , excludedClasses );
203
+
204
+ // Configuration serializes with classes loaded via serialization
205
+ serializeWith = combinedIndex .getAnnotations (DotName .createSimple (SerializedWith .class .getName ()));
206
+ registerSerializeWith (serializeWith , reflectiveClass , excludedClasses );
197
207
198
208
// This contains parts from the index from the app itself
199
209
Index appOnlyIndex = applicationIndexBuildItem .getIndex ();
@@ -205,6 +215,18 @@ void setup(BuildProducer<FeatureBuildItem> feature, BuildProducer<ReflectiveClas
205
215
addReflectionForClass (AbstractExternalizer .class , false , appOnlyIndex , reflectiveClass , Collections .emptySet ());
206
216
}
207
217
218
+ private void registerSerializeWith (Collection <AnnotationInstance > serializeWith ,
219
+ BuildProducer <ReflectiveClassBuildItem > reflectiveClass , Set <DotName > excludedClasses ) {
220
+ for (AnnotationInstance instance : serializeWith ) {
221
+ AnnotationValue withValue = instance .value ();
222
+ String withValueString = withValue .asString ();
223
+ DotName targetSerializer = DotName .createSimple (withValueString );
224
+ if (!excludedClasses .contains (targetSerializer )) {
225
+ reflectiveClass .produce (new ReflectiveClassBuildItem (false , false , withValueString ));
226
+ }
227
+ }
228
+ }
229
+
208
230
private void addReflectionForClass (Class <?> classToUse , boolean isInterface , IndexView indexView ,
209
231
BuildProducer <ReflectiveClassBuildItem > reflectiveClass , Set <DotName > excludedClasses ) {
210
232
addReflectionForName (classToUse .getName (), isInterface , indexView , reflectiveClass , false , false ,
0 commit comments