public class SerializationConfig extends Object
HazelcastInstance
.Constructor and Description |
---|
SerializationConfig() |
Modifier and Type | Method and Description |
---|---|
SerializationConfig |
addClassDefinition(ClassDefinition classDefinition) |
SerializationConfig |
addDataSerializableFactory(int factoryId,
DataSerializableFactory dataSerializableFactory) |
SerializationConfig |
addDataSerializableFactoryClass(int factoryId,
Class<? extends DataSerializableFactory> dataSerializableFactoryClass) |
SerializationConfig |
addDataSerializableFactoryClass(int factoryId,
String dataSerializableFactoryClass) |
SerializationConfig |
addPortableFactory(int factoryId,
PortableFactory portableFactory) |
SerializationConfig |
addPortableFactoryClass(int factoryId,
Class<? extends PortableFactory> portableFactoryClass) |
SerializationConfig |
addPortableFactoryClass(int factoryId,
String portableFactoryClass) |
SerializationConfig |
addSerializerConfig(SerializerConfig serializerConfig) |
ByteOrder |
getByteOrder()
Note that result of useNativeByteOrder is not reflected to return value of this method.
|
Set<ClassDefinition> |
getClassDefinitions() |
Map<Integer,DataSerializableFactory> |
getDataSerializableFactories() |
Map<Integer,String> |
getDataSerializableFactoryClasses() |
GlobalSerializerConfig |
getGlobalSerializerConfig() |
Map<Integer,PortableFactory> |
getPortableFactories() |
Map<Integer,String> |
getPortableFactoryClasses() |
int |
getPortableVersion()
Portable version will be used to differentiate two versions of the same class that have changes on the class,
like adding/removing a field or changing a type of a field.
|
Collection<SerializerConfig> |
getSerializerConfigs() |
boolean |
isAllowUnsafe()
Unsafe, it is not public api of java.
|
boolean |
isCheckClassDefErrors()
Default value is
true (enabled). |
boolean |
isEnableCompression()
Enables compression when default java serialization is used.
|
boolean |
isEnableSharedObject()
Enables shared object when default java serialization is used.
|
boolean |
isUseNativeByteOrder() |
SerializationConfig |
setAllowUnsafe(boolean allowUnsafe)
Unsafe, it is not public api of java.
|
SerializationConfig |
setByteOrder(ByteOrder byteOrder)
Not that configuring use native byte order as enabled will override the byte order set by this method.
|
SerializationConfig |
setCheckClassDefErrors(boolean checkClassDefErrors)
When enabled, serialization system will check for class definitions error at start and throw an Serialization
Exception with error definition.
|
SerializationConfig |
setClassDefinitions(Set<ClassDefinition> classDefinitions) |
SerializationConfig |
setDataSerializableFactories(Map<Integer,DataSerializableFactory> dataSerializableFactories) |
SerializationConfig |
setDataSerializableFactoryClasses(Map<Integer,String> dataSerializableFactoryClasses) |
SerializationConfig |
setEnableCompression(boolean enableCompression)
Enables compression when default java serialization is used.
|
SerializationConfig |
setEnableSharedObject(boolean enableSharedObject)
Enables shared object when default java serialization is used.
|
SerializationConfig |
setGlobalSerializerConfig(GlobalSerializerConfig globalSerializerConfig) |
SerializationConfig |
setPortableFactories(Map<Integer,PortableFactory> portableFactories) |
SerializationConfig |
setPortableFactoryClasses(Map<Integer,String> portableFactoryClasses) |
SerializationConfig |
setPortableVersion(int portableVersion) |
SerializationConfig |
setSerializerConfigs(Collection<SerializerConfig> serializerConfigs) |
SerializationConfig |
setUseNativeByteOrder(boolean useNativeByteOrder) |
String |
toString() |
public GlobalSerializerConfig getGlobalSerializerConfig()
GlobalSerializerConfig
public SerializationConfig setGlobalSerializerConfig(GlobalSerializerConfig globalSerializerConfig)
globalSerializerConfig
- configuration of serializer that will be used
if no other serializer is applicablepublic Collection<SerializerConfig> getSerializerConfigs()
SerializerConfig
spublic SerializationConfig addSerializerConfig(SerializerConfig serializerConfig)
serializerConfig
- serializer configuration of a class typeSerializerConfig
for chainingpublic SerializationConfig setSerializerConfigs(Collection<SerializerConfig> serializerConfigs)
serializerConfigs
- lists of serializer configs that will be registeredSerializerConfig
for chainingpublic int getPortableVersion()
public SerializationConfig setPortableVersion(int portableVersion)
portableVersion
- int value for the version of portable classesSerializerConfig
for chainingpublic Map<Integer,String> getDataSerializableFactoryClasses()
DataSerializableFactory
public SerializationConfig setDataSerializableFactoryClasses(Map<Integer,String> dataSerializableFactoryClasses)
dataSerializableFactoryClasses
- map of factory ID and corresponding factory class namesSerializerConfig
for chainingDataSerializableFactory
public SerializationConfig addDataSerializableFactoryClass(int factoryId, String dataSerializableFactoryClass)
factoryId
- factory ID of dataSerializableFactory to be registereddataSerializableFactoryClass
- name of dataSerializableFactory class to be registeredSerializerConfig
for chainingDataSerializableFactory
public SerializationConfig addDataSerializableFactoryClass(int factoryId, Class<? extends DataSerializableFactory> dataSerializableFactoryClass)
factoryId
- factory ID of dataSerializableFactory to be registereddataSerializableFactoryClass
- dataSerializableFactory class to be registeredSerializerConfig
for chainingDataSerializableFactory
public Map<Integer,DataSerializableFactory> getDataSerializableFactories()
DataSerializableFactory
public SerializationConfig setDataSerializableFactories(Map<Integer,DataSerializableFactory> dataSerializableFactories)
dataSerializableFactories
- map of factory ID and corresponding dataSerializable objectsSerializerConfig
for chainingDataSerializableFactory
public SerializationConfig addDataSerializableFactory(int factoryId, DataSerializableFactory dataSerializableFactory)
factoryId
- factory ID of DataSerializableFactory to be registereddataSerializableFactory
- DataSerializableFactory object to be registeredSerializerConfig
for chainingDataSerializableFactory
public Map<Integer,String> getPortableFactoryClasses()
PortableFactory
public SerializationConfig setPortableFactoryClasses(Map<Integer,String> portableFactoryClasses)
portableFactoryClasses
- map of factory ID and corresponding factory class namesSerializerConfig
for chainingPortableFactory
public SerializationConfig addPortableFactoryClass(int factoryId, Class<? extends PortableFactory> portableFactoryClass)
factoryId
- factory ID of portableFactory to be registeredportableFactoryClass
- portableFactory class to be registeredSerializerConfig
for chainingPortableFactory
public SerializationConfig addPortableFactoryClass(int factoryId, String portableFactoryClass)
factoryId
- factory ID of portableFactory to be registeredportableFactoryClass
- name of the portableFactory class to be registeredSerializerConfig
for chainingPortableFactory
public Map<Integer,PortableFactory> getPortableFactories()
PortableFactory
public SerializationConfig setPortableFactories(Map<Integer,PortableFactory> portableFactories)
portableFactories
- map of factory ID and corresponding factory objectsSerializerConfig
for chainingPortableFactory
public SerializationConfig addPortableFactory(int factoryId, PortableFactory portableFactory)
factoryId
- factory ID of portableFactory to be registeredportableFactory
- portableFactory object to be registeredSerializerConfig
for chainingPortableFactory
public Set<ClassDefinition> getClassDefinitions()
ClassDefinition
public SerializationConfig addClassDefinition(ClassDefinition classDefinition)
classDefinition
- the class definition to be registeredSerializerConfig
for chainingClassDefinition
public SerializationConfig setClassDefinitions(Set<ClassDefinition> classDefinitions)
classDefinitions
- set of class definitions to be registeredSerializerConfig
for chainingClassDefinition
public boolean isCheckClassDefErrors()
true
(enabled).
When enabled, serialization system will check for class definitions error at start and throw an Serialization
Exception with error definition.true
if enabled, false
otherwisepublic SerializationConfig setCheckClassDefErrors(boolean checkClassDefErrors)
checkClassDefErrors
- set to false
to disableSerializerConfig
for chainingpublic boolean isUseNativeByteOrder()
true
if serialization is configured to use native byte order of the underlying platformpublic SerializationConfig setUseNativeByteOrder(boolean useNativeByteOrder)
useNativeByteOrder
- set to true
to use native byte order of the underlying platformSerializerConfig
for chainingpublic ByteOrder getByteOrder()
public SerializationConfig setByteOrder(ByteOrder byteOrder)
byteOrder
- that serialization will useSerializerConfig
for chainingpublic boolean isEnableCompression()
true
if compression enabledpublic SerializationConfig setEnableCompression(boolean enableCompression)
enableCompression
- set to true
to enable compressionSerializerConfig
for chainingpublic boolean isEnableSharedObject()
Default value is true
.
true
if enabledpublic SerializationConfig setEnableSharedObject(boolean enableSharedObject)
enableSharedObject
- set to false
to disableSerializerConfig
for chainingpublic boolean isAllowUnsafe()
Default value is false
.
true
if using unsafe is allowed, false
otherwisepublic SerializationConfig setAllowUnsafe(boolean allowUnsafe)
allowUnsafe
- set to true
to allow usage of unsafeSerializerConfig
for chainingCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.