use of org.infinispan.commons.marshall.UserContextInitializerImpl in project infinispan by infinispan.
the class SerializationContextRegistryImpl method start.
@Start
public void start() {
user.addContextInitializer(new CommonTypesSchema());
user.addContextInitializer(new CommonContainerTypesSchema());
user.addContextInitializer(new UserContextInitializerImpl());
// Add user configured SCIs
Collection<SerializationContextInitializer> initializers = globalConfig.serialization().contextInitializers();
if (initializers == null || initializers.isEmpty()) {
// If no SCIs have been explicitly configured, then load all available SCI services
initializers = ServiceFinder.load(SerializationContextInitializer.class, globalConfig.classLoader());
}
initializers.forEach(user::addContextInitializer);
String messageName = PersistenceContextInitializer.getFqTypeName(MarshallableUserObject.class);
BaseMarshaller userObjectMarshaller = new MarshallableUserObject.Marshaller(messageName, userMarshaller.wired());
update(GLOBAL, ctx -> ctx.addContextInitializer(new PersistenceContextInitializerImpl()).addContextInitializer(new org.infinispan.commons.GlobalContextInitializerImpl()).addMarshaller(userObjectMarshaller));
update(PERSISTENCE, ctx -> ctx.addContextInitializer(new PersistenceContextInitializerImpl()).addMarshaller(userObjectMarshaller));
}
use of org.infinispan.commons.marshall.UserContextInitializerImpl in project infinispan by infinispan.
the class RemoteCacheManager method initializeProtoStreamMarshaller.
private void initializeProtoStreamMarshaller(ProtoStreamMarshaller protoMarshaller) {
SerializationContext ctx = protoMarshaller.getSerializationContext();
// Register some useful builtin schemas, which the user can override later.
registerDefaultSchemas(ctx, "org.infinispan.protostream.types.java.CommonContainerTypesSchema", "org.infinispan.protostream.types.java.CommonTypesSchema");
registerSerializationContextInitializer(ctx, new UserContextInitializerImpl());
// Register the configured schemas.
for (SerializationContextInitializer sci : configuration.getContextInitializers()) {
registerSerializationContextInitializer(ctx, sci);
}
}
Aggregations