Search in sources :

Example 1 with Replace

use of org.infinispan.jcache.embedded.functions.Replace 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);
}
Also used : ReplaceConditionally(org.infinispan.jcache.embedded.functions.ReplaceConditionally) Replace(org.infinispan.jcache.embedded.functions.Replace) GetAndReplace(org.infinispan.jcache.embedded.functions.GetAndReplace) GetAndPut(org.infinispan.jcache.embedded.functions.GetAndPut) RemoveConditionally(org.infinispan.jcache.embedded.functions.RemoveConditionally) MutableEntrySnapshot(org.infinispan.jcache.embedded.functions.MutableEntrySnapshot) PutIfAbsent(org.infinispan.jcache.embedded.functions.PutIfAbsent) ReadWithExpiry(org.infinispan.jcache.embedded.functions.ReadWithExpiry) Put(org.infinispan.jcache.embedded.functions.Put) GetAndPut(org.infinispan.jcache.embedded.functions.GetAndPut) Invoke(org.infinispan.jcache.embedded.functions.Invoke) SingletonExternalizer(org.infinispan.commons.marshall.SingletonExternalizer) AdvancedExternalizer(org.infinispan.commons.marshall.AdvancedExternalizer) SuppliedExternalizer(org.infinispan.commons.marshall.SuppliedExternalizer) SerializationContextRegistry(org.infinispan.marshall.protostream.impl.SerializationContextRegistry) GetAndReplace(org.infinispan.jcache.embedded.functions.GetAndReplace) AdvancedExternalizer(org.infinispan.commons.marshall.AdvancedExternalizer)

Aggregations

AdvancedExternalizer (org.infinispan.commons.marshall.AdvancedExternalizer)1 SingletonExternalizer (org.infinispan.commons.marshall.SingletonExternalizer)1 SuppliedExternalizer (org.infinispan.commons.marshall.SuppliedExternalizer)1 GetAndPut (org.infinispan.jcache.embedded.functions.GetAndPut)1 GetAndReplace (org.infinispan.jcache.embedded.functions.GetAndReplace)1 Invoke (org.infinispan.jcache.embedded.functions.Invoke)1 MutableEntrySnapshot (org.infinispan.jcache.embedded.functions.MutableEntrySnapshot)1 Put (org.infinispan.jcache.embedded.functions.Put)1 PutIfAbsent (org.infinispan.jcache.embedded.functions.PutIfAbsent)1 ReadWithExpiry (org.infinispan.jcache.embedded.functions.ReadWithExpiry)1 RemoveConditionally (org.infinispan.jcache.embedded.functions.RemoveConditionally)1 Replace (org.infinispan.jcache.embedded.functions.Replace)1 ReplaceConditionally (org.infinispan.jcache.embedded.functions.ReplaceConditionally)1 SerializationContextRegistry (org.infinispan.marshall.protostream.impl.SerializationContextRegistry)1