Search in sources :

Example 1 with JBossMarshallingTranscoder

use of org.infinispan.jboss.marshalling.dataconversion.JBossMarshallingTranscoder in project infinispan by infinispan.

the class JbossMarshallingModule method cacheManagerStarting.

@Override
public void cacheManagerStarting(GlobalComponentRegistry gcr, GlobalConfiguration globalConfiguration) {
    PERSISTENCE.jbossMarshallingDetected();
    Marshaller userMarshaller = globalConfiguration.serialization().marshaller();
    if (userMarshaller instanceof JBossUserMarshaller) {
        // Core automatically registers a transcoder for the user marshaller
        // Initialize the externalizers from the serialization configuration
        ((JBossUserMarshaller) userMarshaller).initialize(gcr);
    } else {
        // Register a JBoss Marshalling transcoder, ignoring any configured externalizers
        ClassAllowList classAllowList = gcr.getComponent(EmbeddedCacheManager.class).getClassAllowList();
        ClassLoader classLoader = globalConfiguration.classLoader();
        GenericJBossMarshaller jbossMarshaller = new GenericJBossMarshaller(classLoader, classAllowList);
        EncoderRegistry encoderRegistry = gcr.getComponent(EncoderRegistry.class);
        encoderRegistry.registerTranscoder(new JBossMarshallingTranscoder(jbossMarshaller));
    }
}
Also used : GenericJBossMarshaller(org.infinispan.jboss.marshalling.commons.GenericJBossMarshaller) JBossUserMarshaller(org.infinispan.jboss.marshalling.core.JBossUserMarshaller) GenericJBossMarshaller(org.infinispan.jboss.marshalling.commons.GenericJBossMarshaller) Marshaller(org.infinispan.commons.marshall.Marshaller) JBossMarshallingTranscoder(org.infinispan.jboss.marshalling.dataconversion.JBossMarshallingTranscoder) ClassAllowList(org.infinispan.commons.configuration.ClassAllowList) EncoderRegistry(org.infinispan.marshall.core.EncoderRegistry) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager) JBossUserMarshaller(org.infinispan.jboss.marshalling.core.JBossUserMarshaller)

Aggregations

ClassAllowList (org.infinispan.commons.configuration.ClassAllowList)1 Marshaller (org.infinispan.commons.marshall.Marshaller)1 GenericJBossMarshaller (org.infinispan.jboss.marshalling.commons.GenericJBossMarshaller)1 JBossUserMarshaller (org.infinispan.jboss.marshalling.core.JBossUserMarshaller)1 JBossMarshallingTranscoder (org.infinispan.jboss.marshalling.dataconversion.JBossMarshallingTranscoder)1 EmbeddedCacheManager (org.infinispan.manager.EmbeddedCacheManager)1 EncoderRegistry (org.infinispan.marshall.core.EncoderRegistry)1