public abstract class AbstractSerializationService extends Object implements InternalSerializationService
Modifier and Type | Field and Description |
---|---|
protected BufferPoolThreadLocal |
bufferPoolThreadLocal |
protected com.hazelcast.internal.serialization.impl.SerializerAdapter |
dataSerializerAdapter |
protected PartitioningStrategy |
globalPartitioningStrategy |
protected InputOutputFactory |
inputOutputFactory |
protected com.hazelcast.internal.serialization.impl.SerializerAdapter |
javaExternalizableAdapter |
protected com.hazelcast.internal.serialization.impl.SerializerAdapter |
javaSerializerAdapter |
protected ManagedContext |
managedContext |
protected com.hazelcast.internal.serialization.impl.SerializerAdapter |
nullSerializerAdapter |
protected com.hazelcast.internal.serialization.impl.SerializerAdapter |
portableSerializerAdapter |
VERSION_1
Modifier and Type | Method and Description |
---|---|
protected int |
calculatePartitionHash(Object obj,
PartitioningStrategy strategy) |
BufferObjectDataInput |
createObjectDataInput(byte[] data) |
BufferObjectDataInput |
createObjectDataInput(Data data) |
BufferObjectDataOutput |
createObjectDataOutput() |
BufferObjectDataOutput |
createObjectDataOutput(int size) |
void |
dispose()
Disposes this object and releases any data and/or resources associated
with it.
|
void |
disposeData(Data data) |
ByteOrder |
getByteOrder() |
ClassLoader |
getClassLoader() |
ManagedContext |
getManagedContext()
|
byte |
getVersion() |
<T> T |
readObject(ObjectDataInput in) |
<T> T |
readObject(ObjectDataInput in,
Class aClass) |
void |
register(Class type,
Serializer serializer) |
protected void |
registerConstant(Class type,
Serializer serializer) |
protected void |
registerConstant(Class type,
com.hazelcast.internal.serialization.impl.SerializerAdapter serializer) |
void |
registerGlobal(Serializer serializer) |
void |
registerGlobal(Serializer serializer,
boolean overrideJavaSerialization) |
protected boolean |
safeRegister(Class type,
Serializer serializer) |
protected boolean |
safeRegister(Class type,
com.hazelcast.internal.serialization.impl.SerializerAdapter serializer) |
protected com.hazelcast.internal.serialization.impl.SerializerAdapter |
serializerFor(int typeId) |
protected com.hazelcast.internal.serialization.impl.SerializerAdapter |
serializerFor(Object object) |
byte[] |
toBytes(int padding,
Object obj) |
byte[] |
toBytes(int padding,
Object obj,
PartitioningStrategy strategy) |
byte[] |
toBytes(Object obj) |
byte[] |
toBytes(Object obj,
PartitioningStrategy strategy) |
<B extends Data> |
toData(Object obj)
Serializes an object to a
Data . |
<B extends Data> |
toData(Object obj,
PartitioningStrategy strategy)
Serializes an object to a
Data . |
<T> T |
toObject(Object object)
Deserializes an object.
|
<T> T |
toObject(Object object,
Class aClass)
Deserializes an object.
|
void |
writeObject(ObjectDataOutput out,
Object obj) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createPortableReader, getPortableContext
protected final ManagedContext managedContext
protected final InputOutputFactory inputOutputFactory
protected final PartitioningStrategy globalPartitioningStrategy
protected final BufferPoolThreadLocal bufferPoolThreadLocal
protected com.hazelcast.internal.serialization.impl.SerializerAdapter dataSerializerAdapter
protected com.hazelcast.internal.serialization.impl.SerializerAdapter portableSerializerAdapter
protected final com.hazelcast.internal.serialization.impl.SerializerAdapter nullSerializerAdapter
protected com.hazelcast.internal.serialization.impl.SerializerAdapter javaSerializerAdapter
protected com.hazelcast.internal.serialization.impl.SerializerAdapter javaExternalizableAdapter
public final <B extends Data> B toData(Object obj)
SerializationService
Data
.
This method can safely be called with a Data
instance. In that case, that instance is returned.
If this method is called with null, null is returned.toData
in interface SerializationService
obj
- the object to serialize.public final <B extends Data> B toData(Object obj, PartitioningStrategy strategy)
SerializationService
Data
.
This method can safely be called with a Data
instance. In that case, that instance is returned.
If this method is called with null, null is returned.toData
in interface SerializationService
obj
- the object to serialize.strategy
- strategy is used to calculate partition id of the resulting data see PartitioningStrategy
public byte[] toBytes(Object obj)
toBytes
in interface InternalSerializationService
public byte[] toBytes(int padding, Object obj)
toBytes
in interface InternalSerializationService
public byte[] toBytes(Object obj, PartitioningStrategy strategy)
toBytes
in interface InternalSerializationService
public byte[] toBytes(int padding, Object obj, PartitioningStrategy strategy)
toBytes
in interface InternalSerializationService
public final <T> T toObject(Object object)
SerializationService
toObject
in interface SerializationService
object
- the data to deserialize.public final <T> T toObject(Object object, Class aClass)
SerializationService
toObject
in interface SerializationService
object
- the data to deserialize.aClass
- The class to instantiate when deserializing the object.public final void writeObject(ObjectDataOutput out, Object obj)
writeObject
in interface InternalSerializationService
public final <T> T readObject(ObjectDataInput in)
readObject
in interface InternalSerializationService
public final <T> T readObject(ObjectDataInput in, Class aClass)
readObject
in interface InternalSerializationService
public void disposeData(Data data)
disposeData
in interface InternalSerializationService
public final BufferObjectDataInput createObjectDataInput(byte[] data)
createObjectDataInput
in interface InternalSerializationService
public final BufferObjectDataInput createObjectDataInput(Data data)
createObjectDataInput
in interface InternalSerializationService
public final BufferObjectDataOutput createObjectDataOutput(int size)
createObjectDataOutput
in interface InternalSerializationService
public BufferObjectDataOutput createObjectDataOutput()
createObjectDataOutput
in interface InternalSerializationService
public final ClassLoader getClassLoader()
getClassLoader
in interface InternalSerializationService
public final ManagedContext getManagedContext()
SerializationService
getManagedContext
in interface SerializationService
public ByteOrder getByteOrder()
getByteOrder
in interface InternalSerializationService
public byte getVersion()
getVersion
in interface InternalSerializationService
public void dispose()
Disposable
dispose
in interface Disposable
public final void register(Class type, Serializer serializer)
public final void registerGlobal(Serializer serializer)
public final void registerGlobal(Serializer serializer, boolean overrideJavaSerialization)
protected final int calculatePartitionHash(Object obj, PartitioningStrategy strategy)
protected final boolean safeRegister(Class type, Serializer serializer)
protected final boolean safeRegister(Class type, com.hazelcast.internal.serialization.impl.SerializerAdapter serializer)
protected final void registerConstant(Class type, Serializer serializer)
protected final void registerConstant(Class type, com.hazelcast.internal.serialization.impl.SerializerAdapter serializer)
protected final com.hazelcast.internal.serialization.impl.SerializerAdapter serializerFor(int typeId)
protected final com.hazelcast.internal.serialization.impl.SerializerAdapter serializerFor(Object object)
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.