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));
}
}
Aggregations