use of org.infinispan.jcache.embedded.functions.ReadWithExpiry in project infinispan by infinispan.
the class LifecycleCallbacks method cacheManagerStarting.
@Override
public void cacheManagerStarting(GlobalComponentRegistry gcr, GlobalConfiguration globalConfiguration) {
SerializationContextRegistry ctxRegistry = gcr.getComponent(SerializationContextRegistry.class);
PersistenceContextInitializerImpl sci = new PersistenceContextInitializerImpl();
ctxRegistry.addContextInitializer(SerializationContextRegistry.MarshallerType.PERSISTENCE, sci);
ctxRegistry.addContextInitializer(SerializationContextRegistry.MarshallerType.GLOBAL, sci);
Map<Integer, AdvancedExternalizer<?>> map = globalConfiguration.serialization().advancedExternalizers();
add(map, new SuppliedExternalizer<>(ExternalizerIds.READ_WITH_EXPIRY, ReadWithExpiry.class, ReadWithExpiry::new));
add(map, new SuppliedExternalizer<>(ExternalizerIds.GET_AND_PUT, GetAndPut.class, GetAndPut::new));
add(map, new SuppliedExternalizer<>(ExternalizerIds.GET_AND_REPLACE, GetAndReplace.class, GetAndReplace::new));
add(map, new Invoke.Externalizer());
add(map, new SuppliedExternalizer<>(ExternalizerIds.PUT, Put.class, Put::new));
add(map, new SuppliedExternalizer<>(ExternalizerIds.PUT_IF_ABSENT, PutIfAbsent.class, PutIfAbsent::new));
add(map, new SingletonExternalizer<>(ExternalizerIds.REMOVE, Remove.getInstance()));
add(map, new SuppliedExternalizer<>(ExternalizerIds.REMOVE_CONDITIONALLY, RemoveConditionally.class, RemoveConditionally::new));
add(map, new SuppliedExternalizer<>(ExternalizerIds.REPLACE, Replace.class, Replace::new));
add(map, new SingletonExternalizer<>(ExternalizerIds.GET_AND_REMOVE, GetAndRemove.getInstance()));
add(map, new ReplaceConditionally.Externalizer());
// that cannot be classloaded.
if (canLoad("javax.cache.processor.MutableEntry", MutableEntrySnapshot.Externalizer.class.getClassLoader())) {
add(map, new MutableEntrySnapshot.Externalizer());
}
gcr.getCacheManager().getClassAllowList().addClasses(DefaultCacheKey.class);
}
Aggregations