Open
Description
Spring Boot 3 native applications require compile time definitions of which reflection data needs to be available at runtime. Atmosphere could provide this info for its own classes by adding a RuntimeHintsRegistrar
.
An example registrar I have tested basic functionality with looks like this (certainly incomplete):
public class AtmosphereHintsRegistrar implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
ReflectionHints ref = hints.reflection();
try {
for (Class<?> c : getAtmosphereClasses()) {
ref.registerType(c, MemberCategory.values());
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private Collection<? extends Class<?>> getAtmosphereClasses() {
Set<Class<?>> classes = new HashSet<>();
classes.add(DefaultAtmosphereResourceFactory.class);
classes.add(SimpleHttpProtocol.class);
classes.addAll(AtmosphereFramework.DEFAULT_ATMOSPHERE_INTERCEPTORS);
classes.add(AtmosphereResourceLifecycleInterceptor.class);
classes.add(TrackMessageSizeInterceptor.class);
classes.add(SuspendTrackerInterceptor.class);
classes.add(DefaultBroadcasterFactory.class);
classes.add(SimpleBroadcaster.class);
classes.add(DefaultBroadcaster.class);
classes.add(UUIDBroadcasterCache.class);
classes.add(VoidAnnotationProcessor.class);
classes.add(DefaultAtmosphereResourceSessionFactory.class);
classes.add(JSR356AsyncSupport.class);
classes.add(DefaultMetaBroadcaster.class);
return classes;
}
}
Activity