use of io.atomix.utils.serializer.SerializerBuilder in project atomix by atomix.
the class DistributedCollectionBuilder method serializer.
/**
* Returns the protocol serializer.
*
* @return the protocol serializer
*/
protected Serializer serializer() {
if (serializer == null) {
NamespaceConfig namespaceConfig = this.config.getNamespaceConfig();
if (namespaceConfig == null) {
namespaceConfig = new NamespaceConfig();
}
SerializerBuilder serializerBuilder = managementService.getSerializationService().newBuilder(name);
serializerBuilder.withNamespace(new Namespace(namespaceConfig));
if (config.isRegistrationRequired()) {
serializerBuilder.withRegistrationRequired();
}
if (config.isCompatibleSerialization()) {
serializerBuilder.withCompatibleSerialization();
}
if (config.getElementType() != null) {
serializerBuilder.addType(config.getElementType());
}
if (!config.getExtraTypes().isEmpty()) {
serializerBuilder.withTypes(config.getExtraTypes().toArray(new Class<?>[config.getExtraTypes().size()]));
}
serializer = serializerBuilder.build();
}
return serializer;
}
use of io.atomix.utils.serializer.SerializerBuilder in project atomix by atomix.
the class MapBuilder method serializer.
/**
* Returns the protocol serializer.
*
* @return the protocol serializer
*/
protected Serializer serializer() {
if (serializer == null) {
NamespaceConfig namespaceConfig = this.config.getNamespaceConfig();
if (namespaceConfig == null) {
namespaceConfig = new NamespaceConfig();
}
SerializerBuilder serializerBuilder = managementService.getSerializationService().newBuilder(name);
serializerBuilder.withNamespace(new Namespace(namespaceConfig));
if (config.isRegistrationRequired()) {
serializerBuilder.withRegistrationRequired();
}
if (config.isCompatibleSerialization()) {
serializerBuilder.withCompatibleSerialization();
}
if (config.getKeyType() != null) {
serializerBuilder.addType(config.getKeyType());
}
if (config.getValueType() != null) {
serializerBuilder.addType(config.getValueType());
}
if (!config.getExtraTypes().isEmpty()) {
serializerBuilder.withTypes(config.getExtraTypes().toArray(new Class<?>[config.getExtraTypes().size()]));
}
serializer = serializerBuilder.build();
}
return serializer;
}
use of io.atomix.utils.serializer.SerializerBuilder in project atomix by atomix.
the class MultimapBuilder method serializer.
/**
* Returns the protocol serializer.
*
* @return the protocol serializer
*/
protected Serializer serializer() {
if (serializer == null) {
NamespaceConfig namespaceConfig = this.config.getNamespaceConfig();
if (namespaceConfig == null) {
namespaceConfig = new NamespaceConfig();
}
SerializerBuilder serializerBuilder = managementService.getSerializationService().newBuilder(name);
serializerBuilder.withNamespace(new Namespace(namespaceConfig));
if (config.isRegistrationRequired()) {
serializerBuilder.withRegistrationRequired();
}
if (config.isCompatibleSerialization()) {
serializerBuilder.withCompatibleSerialization();
}
if (config.getKeyType() != null) {
serializerBuilder.addType(config.getKeyType());
}
if (config.getValueType() != null) {
serializerBuilder.addType(config.getValueType());
}
if (!config.getExtraTypes().isEmpty()) {
serializerBuilder.withTypes(config.getExtraTypes().toArray(new Class<?>[config.getExtraTypes().size()]));
}
serializer = serializerBuilder.build();
}
return serializer;
}
use of io.atomix.utils.serializer.SerializerBuilder in project atomix by atomix.
the class AtomicCounterMapBuilder method serializer.
/**
* Returns the protocol serializer.
*
* @return the protocol serializer
*/
protected Serializer serializer() {
if (serializer == null) {
NamespaceConfig namespaceConfig = this.config.getNamespaceConfig();
if (namespaceConfig == null) {
namespaceConfig = new NamespaceConfig();
}
SerializerBuilder serializerBuilder = managementService.getSerializationService().newBuilder(name);
serializerBuilder.withNamespace(new Namespace(namespaceConfig));
if (config.isRegistrationRequired()) {
serializerBuilder.withRegistrationRequired();
}
if (config.isCompatibleSerialization()) {
serializerBuilder.withCompatibleSerialization();
}
if (config.getKeyType() != null) {
serializerBuilder.addType(config.getKeyType());
}
if (!config.getExtraTypes().isEmpty()) {
serializerBuilder.withTypes(config.getExtraTypes().toArray(new Class<?>[config.getExtraTypes().size()]));
}
serializer = serializerBuilder.build();
}
return serializer;
}
use of io.atomix.utils.serializer.SerializerBuilder in project atomix by atomix.
the class ValueBuilder method serializer.
/**
* Returns the protocol serializer.
*
* @return the protocol serializer
*/
protected Serializer serializer() {
if (serializer == null) {
NamespaceConfig namespaceConfig = this.config.getNamespaceConfig();
if (namespaceConfig == null) {
namespaceConfig = new NamespaceConfig();
}
SerializerBuilder serializerBuilder = managementService.getSerializationService().newBuilder(name);
serializerBuilder.withNamespace(new Namespace(namespaceConfig));
if (config.isRegistrationRequired()) {
serializerBuilder.withRegistrationRequired();
}
if (config.isCompatibleSerialization()) {
serializerBuilder.withCompatibleSerialization();
}
if (config.getValueType() != null) {
serializerBuilder.addType(config.getValueType());
}
if (!config.getExtraTypes().isEmpty()) {
serializerBuilder.withTypes(config.getExtraTypes().toArray(new Class<?>[config.getExtraTypes().size()]));
}
serializer = serializerBuilder.build();
}
return serializer;
}
Aggregations