private final ImmutableList<RegistrationBlock> registeredBlocks;
private final ClassLoader classLoader;
- private final boolean registrationRequired;
private final String friendlyName;
/**
private List<Entry<Class<?>[], Serializer<?>>> types = new ArrayList<>();
private List<RegistrationBlock> blocks = new ArrayList<>();
private ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- private boolean registrationRequired = true;
/**
* Builds a {@link Namespace} instance.
if (!types.isEmpty()) {
blocks.add(new RegistrationBlock(this.blockHeadId, types));
}
- return new Namespace(blocks, classLoader, registrationRequired, friendlyName).populate(1);
+ return new Namespace(blocks, classLoader, friendlyName).populate(1);
}
/**
this.classLoader = classLoader;
return this;
}
-
- /**
- * Sets the registrationRequired flag.
- *
- * @param registrationRequired Kryo's registrationRequired flag
- * @return this
- * @see Kryo#setRegistrationRequired(boolean)
- */
- public Builder setRegistrationRequired(boolean registrationRequired) {
- this.registrationRequired = registrationRequired;
- return this;
- }
}
/**
private Namespace(
final List<RegistrationBlock> registeredTypes,
ClassLoader classLoader,
- boolean registrationRequired,
String friendlyName) {
this.registeredBlocks = ImmutableList.copyOf(registeredTypes);
- this.registrationRequired = registrationRequired;
this.classLoader = classLoader;
this.friendlyName = requireNonNull(friendlyName);
}
LOGGER.trace("Creating Kryo instance for {}", this);
Kryo kryo = new Kryo();
kryo.setClassLoader(classLoader);
- kryo.setRegistrationRequired(registrationRequired);
+ kryo.setRegistrationRequired(true);
// TODO rethink whether we want to use StdInstantiatorStrategy
kryo.setInstantiatorStrategy(