Class DataSerializableSessionSerializerInitializer
java.lang.Object
org.springframework.session.data.gemfire.serialization.data.support.DataSerializableSessionSerializerInitializer
- All Implemented Interfaces:
org.apache.geode.cache.Declarable
public class DataSerializableSessionSerializerInitializer
extends Object
implements org.apache.geode.cache.Declarable
Register the custom Spring Session
DataSerializableSessionSerializer
with Apache Geode/Pivotal GemFire's
DataSerialization framework as the DataSerializer
used to handle de/serialization of the Session
,
the Session
Attributes and any application domain model objects contained in the Session
(if necessary).- Since:
- 2.1.1
- See Also:
-
Properties
DataSerializable
DataSerializer
Cache
CacheFactory
Declarable
GemFireCache
Session
GemFireOperationsSessionRepository
GemFireHttpSessionConfiguration
DataSerializableSessionSerializer
-
Constructor Summary
ConstructorDescriptionDefault constructor used to construct a new, un-initialized instance ofDataSerializableSessionSerializerInitializer
.DataSerializableSessionSerializerInitializer
(org.apache.geode.cache.GemFireCache gemfireCache) Constructs a new instance ofDataSerializableSessionSerializerInitializer
initialized with the given, non-requiredGemFireCache
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Configures Spring Session (for Apache Geode/Pivotal GemFire) to "use" Apache Geode/Pivotal GemFire's DataSerialization framework and Delta capableDataSerializable
Session objects.void
Resolves theGemFireCache
instance, configures Spring Session (for Apache Geode/Pivotal GemFire) to enable and use the DataSerialization framework and finally, registers theDataSerializers
used by Spring Session and required by Apache Geode/Pivotal GemFire to de/serialize theSession
objects asDataSerializable
types
.protected Optional<org.apache.geode.cache.GemFireCache>
Returns anOptional
reference to theGemFireCache
.protected org.slf4j.Logger
Returns a reference to the configuredLogger
used to capture log events and messages.void
initialize
(org.apache.geode.cache.Cache cache, Properties parameters) of
(org.apache.geode.cache.GemFireCache gemfireCache) Factory method used to construct a new instance ofDataSerializableSessionSerializerInitializer
initialized with the given, non-requiredGemFireCache
.protected void
Registers theDataSerializableSessionSerializer
with Apache Geode/Pivotal GemFire in order to properly handle the Spring Session types.protected org.apache.geode.cache.GemFireCache
Resolves a reference to theGemFireCache
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.geode.cache.Declarable
init
-
Constructor Details
-
DataSerializableSessionSerializerInitializer
public DataSerializableSessionSerializerInitializer()Default constructor used to construct a new, un-initialized instance ofDataSerializableSessionSerializerInitializer
. For use in Apache Geode/Pivotal GemFire cache.xml. -
DataSerializableSessionSerializerInitializer
public DataSerializableSessionSerializerInitializer(@Nullable org.apache.geode.cache.GemFireCache gemfireCache) Constructs a new instance ofDataSerializableSessionSerializerInitializer
initialized with the given, non-requiredGemFireCache
. This constructor is meant to be used programmatically and users are encouraged to provide a reference to the configured and initializedGemFireCache
instance if available.- Parameters:
gemfireCache
- reference to theGemFireCache
instance.GemFireCache
may be null in to order to "lazy" initialize or resolve the cache.- See Also:
-
GemFireCache
-
-
Method Details
-
of
public static DataSerializableSessionSerializerInitializer of(@Nullable org.apache.geode.cache.GemFireCache gemfireCache) Factory method used to construct a new instance ofDataSerializableSessionSerializerInitializer
initialized with the given, non-requiredGemFireCache
.- Parameters:
gemfireCache
- reference to theGemFireCache
instance.- Returns:
- a new
DataSerializableSessionSerializerInitializer
initialized with the given, non-requiredGemFireCache
. - See Also:
-
getGemFireCache
Returns anOptional
reference to theGemFireCache
. TheGemFireCache
instance may be resolved lazily when theinitialize(Cache, Properties)
method is called, such as when processing cache.xml. -
getLogger
protected org.slf4j.Logger getLogger()Returns a reference to the configuredLogger
used to capture log events and messages.- Returns:
- a reference to the configured
Logger
used for logging. - See Also:
-
Logger
-
initialize
- Specified by:
initialize
in interfaceorg.apache.geode.cache.Declarable
- See Also:
-
doInitialization
public void doInitialization()Resolves theGemFireCache
instance, configures Spring Session (for Apache Geode/Pivotal GemFire) to enable and use the DataSerialization framework and finally, registers theDataSerializers
used by Spring Session and required by Apache Geode/Pivotal GemFire to de/serialize theSession
objects asDataSerializable
types
. -
resolveGemFireCache
protected org.apache.geode.cache.GemFireCache resolveGemFireCache()Resolves a reference to theGemFireCache
.- Returns:
- a resolved reference to the
GemFireCache
. - Throws:
org.apache.geode.cache.CacheClosedException
- if theGemFireCache
cannot be resolved.- See Also:
-
GemFireCache
-
registerDataSerializableSessionSerializer
protected void registerDataSerializableSessionSerializer()Registers theDataSerializableSessionSerializer
with Apache Geode/Pivotal GemFire in order to properly handle the Spring Session types. -
configureUseDataSerialization
protected void configureUseDataSerialization()Configures Spring Session (for Apache Geode/Pivotal GemFire) to "use" Apache Geode/Pivotal GemFire's DataSerialization framework and Delta capableDataSerializable
Session objects.
-