Spring Session for VMware GemFire
Class AbstractDataSerializableSessionSerializer<T>
java.lang.Object
org.apache.geode.DataSerializer
org.springframework.session.data.gemfire.serialization.data.AbstractDataSerializableSessionSerializer<T>
- All Implemented Interfaces:
SessionSerializer<T,DataInput, DataOutput>
- Direct Known Subclasses:
DataSerializableSessionAttributesSerializer,DataSerializableSessionSerializer,DataSerializerSessionSerializerAdapter
public abstract class AbstractDataSerializableSessionSerializer<T>
extends org.apache.geode.DataSerializer
implements SessionSerializer<T,DataInput,DataOutput>
The
AbstractDataSerializableSessionSerializer class is an abstract base class encapsulating and implementing
operations common to all Apache Geode/Pivotal GemFire DataSerializer and Spring Session
SessionSerializer implementations.
This class is also an implementation of the Template Software Design Pattern, providing a default
implementations of the DataSerializer.toData(Object, DataOutput) and DataSerializer.fromData(DataInput)
methods.- Since:
- 2.0.0
- See Also:
-
DataInputDataOutputDataSerializerSessionSerializer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceprotected static interface -
Field Summary
FieldsFields inherited from class org.apache.geode.DataSerializer
DISALLOW_JAVA_SERIALIZATION, DOUBLE, INT, LONG, PRESENT, TRACE_SERIALIZABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanDetermines whether Java Serialization is allowed during de/serialization when using thisDataSerializer.booleancanSerialize(Class<?> type) Determines whether the giventypecan be de/serialized by thisSessionSerializer.<T> TintgetId()Returns the identifier for thisDataSerializer.Class<?>[]Returns thetypessupported and handled by thisDataSerializerduring de/serialization.protected <T> Tprotected voidvoidserializeObject(Object obj, DataOutput out) voidserializeObject(Object obj, DataOutput out, boolean allowJavaSerialization) booleantoData(Object session, DataOutput out) Methods inherited from class org.apache.geode.DataSerializer
equals, getContext, getEventId, hashCode, readArrayList, readArrayOfByteArrays, readBoolean, readBooleanArray, readByte, readByteArray, readCharacter, readCharArray, readClass, readConcurrentHashMap, readDate, readDouble, readDoubleArray, readEnum, readFile, readFloat, readFloatArray, readHashMap, readHashSet, readHashtable, readIdentityHashMap, readInetAddress, readIntArray, readInteger, readLinkedHashMap, readLinkedHashSet, readLinkedList, readLong, readLongArray, readNonPrimitiveClassName, readObject, readObjectArray, readOptional, readOptionalDouble, readOptionalInt, readOptionalLong, readOptionalPrimitive, readPrimitiveBoolean, readPrimitiveByte, readPrimitiveChar, readPrimitiveDouble, readPrimitiveFloat, readPrimitiveInt, readPrimitiveLong, readPrimitiveShort, readProperties, readRegion, readShort, readShortArray, readStack, readString, readStringArray, readTreeMap, readTreeSet, readUnsignedByte, readUnsignedShort, readVector, register, setContext, setEventId, writeArrayList, writeArrayOfByteArrays, writeBoolean, writeBooleanArray, writeByte, writeByteArray, writeByteArray, writeCharacter, writeCharArray, writeClass, writeConcurrentHashMap, writeDate, writeDouble, writeDoubleArray, writeEnum, writeFile, writeFloat, writeFloatArray, writeHashMap, writeHashSet, writeHashtable, writeIdentityHashMap, writeInetAddress, writeIntArray, writeInteger, writeLinkedHashMap, writeLinkedHashSet, writeLinkedList, writeLong, writeLongArray, writeNonPrimitiveClassName, writeObject, writeObject, writeObjectArray, writeObjectAsByteArray, writeOptional, writeOptionalDouble, writeOptionalInt, writeOptionalLong, writePrimitiveBoolean, writePrimitiveByte, writePrimitiveChar, writePrimitiveDouble, writePrimitiveFloat, writePrimitiveInt, writePrimitiveLong, writePrimitiveShort, writeProperties, writeRegion, writeShort, writeShortArray, writeStack, writeString, writeStringArray, writeTreeMap, writeTreeSet, writeUnsignedByte, writeUnsignedShort, writeVectorMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.session.data.gemfire.serialization.SessionSerializer
canSerialize, deserialize, serialize
-
Field Details
-
DEFAULT_ALLOW_JAVA_SERIALIZATION
protected static final boolean DEFAULT_ALLOW_JAVA_SERIALIZATION- See Also:
-
-
Constructor Details
-
AbstractDataSerializableSessionSerializer
public AbstractDataSerializableSessionSerializer()
-
-
Method Details
-
getId
public int getId()Returns the identifier for thisDataSerializer.- Specified by:
getIdin classorg.apache.geode.DataSerializer- Returns:
- the identifier for this
DataSerializer.
-
getSupportedClasses
Returns thetypessupported and handled by thisDataSerializerduring de/serialization. -
allowJavaSerialization
protected boolean allowJavaSerialization()Determines whether Java Serialization is allowed during de/serialization when using thisDataSerializer.- Returns:
- a boolean value indicating whether Java Serialization is allowed during de/serialization
when using this
DataSerializer.
-
toData
- Specified by:
toDatain classorg.apache.geode.DataSerializer- Throws:
IOException
-
serializeObject
- Throws:
IOException
-
serializeObject
public void serializeObject(Object obj, DataOutput out, boolean allowJavaSerialization) throws IOException - Throws:
IOException
-
fromData
- Specified by:
fromDatain classorg.apache.geode.DataSerializer- Throws:
IOExceptionClassNotFoundException
-
deserializeObject
- Throws:
ClassNotFoundExceptionIOException
-
canSerialize
Description copied from interface:SessionSerializerDetermines whether the giventypecan be de/serialized by thisSessionSerializer.- Specified by:
canSerializein interfaceSessionSerializer<T,DataInput, DataOutput> - Parameters:
type-Classto evaluate for whether de/serialization is supported.- Returns:
- a boolean value indicating whether the specified
typecan be de/serialized by thisSessionSerializer. - See Also:
-
safeRead
protected <T> T safeRead(DataInput in, AbstractDataSerializableSessionSerializer.DataInputReader<T> reader) -
safeWrite
protected void safeWrite(DataOutput out, AbstractDataSerializableSessionSerializer.DataOutputWriter writer)
-