use of com.hazelcast.internal.serialization.InputOutputFactory in project hazelcast by hazelcast.
the class DefaultSerializationServiceBuilder method build.
@Override
public InternalSerializationService build() {
initVersions();
if (config != null) {
addConfigDataSerializableFactories(dataSerializableFactories, config, classLoader);
addConfigPortableFactories(portableFactories, config, classLoader);
classDefinitions.addAll(config.getClassDefinitions());
}
InputOutputFactory inputOutputFactory = createInputOutputFactory();
InternalSerializationService ss = createSerializationService(inputOutputFactory);
registerSerializerHooks(ss);
if (config != null) {
if (config.getGlobalSerializerConfig() != null) {
GlobalSerializerConfig globalSerializerConfig = config.getGlobalSerializerConfig();
Serializer serializer = globalSerializerConfig.getImplementation();
if (serializer == null) {
try {
serializer = ClassLoaderUtil.newInstance(classLoader, globalSerializerConfig.getClassName());
} catch (Exception e) {
throw new HazelcastSerializationException(e);
}
}
if (serializer instanceof HazelcastInstanceAware) {
((HazelcastInstanceAware) serializer).setHazelcastInstance(hazelcastInstance);
}
((AbstractSerializationService) ss).registerGlobal(serializer, globalSerializerConfig.isOverrideJavaSerialization());
}
}
return ss;
}
Aggregations