use of org.infinispan.commons.dataconversion.GlobalMarshallerEncoder in project infinispan by infinispan.
the class EncoderRegistryFactory method construct.
@Override
public Object construct(String componentName) {
ClassLoader classLoader = globalConfiguration.classLoader();
EncoderRegistryImpl encoderRegistry = new EncoderRegistryImpl();
ClassAllowList classAllowList = embeddedCacheManager.getClassAllowList();
encoderRegistry.registerEncoder(IdentityEncoder.INSTANCE);
encoderRegistry.registerEncoder(UTF8Encoder.INSTANCE);
encoderRegistry.registerEncoder(new JavaSerializationEncoder(classAllowList));
encoderRegistry.registerEncoder(new GlobalMarshallerEncoder(globalMarshaller.wired()));
// Default and binary transcoder use the user marshaller to convert data to/from a byte array
encoderRegistry.registerTranscoder(new DefaultTranscoder(userMarshaller));
encoderRegistry.registerTranscoder(new BinaryTranscoder(userMarshaller));
// Core transcoders are always available
encoderRegistry.registerTranscoder(new ProtostreamTranscoder(ctxRegistry, classLoader));
encoderRegistry.registerTranscoder(new JavaSerializationTranscoder(classAllowList));
// Wraps the GlobalMarshaller so that it can be used as a transcoder
// Keeps application/x-infinispan-marshalling available for backwards compatibility
encoderRegistry.registerTranscoder(new TranscoderMarshallerAdapter(globalMarshaller.wired()));
// Make the user marshaller's media type available as well
// As custom marshaller modules like Kryo and Protostuff do not define their own transcoder
encoderRegistry.registerTranscoder(new TranscoderMarshallerAdapter(userMarshaller));
encoderRegistry.registerWrapper(ByteArrayWrapper.INSTANCE);
encoderRegistry.registerWrapper(IdentityWrapper.INSTANCE);
return encoderRegistry;
}
Aggregations