public class DataSerializableSessionSerializerInitializer
extends java.lang.Object
implements org.apache.geode.cache.Declarable
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).Properties
,
DataSerializable
,
DataSerializer
,
Cache
,
CacheFactory
,
Declarable
,
GemFireCache
,
Session
,
GemFireOperationsSessionRepository
,
GemFireHttpSessionConfiguration
,
DataSerializableSessionSerializer
Constructor and Description |
---|
DataSerializableSessionSerializerInitializer()
Default constructor used to construct a new, un-initialized instance of
DataSerializableSessionSerializerInitializer . |
DataSerializableSessionSerializerInitializer(org.apache.geode.cache.GemFireCache gemfireCache)
Constructs a new instance of
DataSerializableSessionSerializerInitializer initialized with the given,
non-required GemFireCache . |
Modifier and Type | Method and Description |
---|---|
protected void |
configureUseDataSerialization()
Configures Spring Session (for Apache Geode/Pivotal GemFire) to "use" Apache Geode/Pivotal GemFire's
DataSerialization framework and Delta capable
DataSerializable Session objects. |
void |
doInitialization()
Resolves the
GemFireCache instance, configures Spring Session (for Apache Geode/Pivotal GemFire) to
enable and use the DataSerialization framework and finally, registers the DataSerializers
used by Spring Session and required by Apache Geode/Pivotal GemFire to de/serialize the Session objects
as DataSerializable types . |
protected java.util.Optional<org.apache.geode.cache.GemFireCache> |
getGemFireCache()
Returns an
Optional reference to the GemFireCache . |
protected org.slf4j.Logger |
getLogger()
Returns a reference to the configured
Logger used to capture log events and messages. |
void |
initialize(org.apache.geode.cache.Cache cache,
java.util.Properties parameters) |
static DataSerializableSessionSerializerInitializer |
of(org.apache.geode.cache.GemFireCache gemfireCache)
Factory method used to construct a new instance of
DataSerializableSessionSerializerInitializer
initialized with the given, non-required GemFireCache . |
protected void |
registerDataSerializableSessionSerializer()
Registers the
DataSerializableSessionSerializer with Apache Geode/Pivotal GemFire
in order to properly handle the Spring Session types. |
protected org.apache.geode.cache.GemFireCache |
resolveGemFireCache()
Resolves a reference to the
GemFireCache . |
public DataSerializableSessionSerializerInitializer()
DataSerializableSessionSerializerInitializer
.
For use in Apache Geode/Pivotal GemFire cache.xml.public DataSerializableSessionSerializerInitializer(@Nullable org.apache.geode.cache.GemFireCache gemfireCache)
DataSerializableSessionSerializerInitializer
initialized with the given,
non-required GemFireCache
.
This constructor is meant to be used programmatically and users are encouraged to provide a reference to
the configured and initialized GemFireCache
instance if available.gemfireCache
- reference to the GemFireCache
instance. GemFireCache
may be null
in to order to "lazy" initialize or resolve the cache.GemFireCache
public static DataSerializableSessionSerializerInitializer of(@Nullable org.apache.geode.cache.GemFireCache gemfireCache)
DataSerializableSessionSerializerInitializer
initialized with the given, non-required GemFireCache
.gemfireCache
- reference to the GemFireCache
instance.DataSerializableSessionSerializerInitializer
initialized with the given, non-required
GemFireCache
.GemFireCache
,
DataSerializableSessionSerializerInitializer(GemFireCache)
protected java.util.Optional<org.apache.geode.cache.GemFireCache> getGemFireCache()
Optional
reference to the GemFireCache
.
The GemFireCache
instance may be resolved lazily when the initialize(Cache, Properties)
method
is called, such as when processing cache.xml.Optional
reference to the GemFireCache
.GemFireCache
,
Optional
protected org.slf4j.Logger getLogger()
Logger
used to capture log events and messages.Logger
used for logging.Logger
public void initialize(org.apache.geode.cache.Cache cache, java.util.Properties parameters)
initialize
in interface org.apache.geode.cache.Declarable
doInitialization()
public void doInitialization()
GemFireCache
instance, configures Spring Session (for Apache Geode/Pivotal GemFire) to
enable and use the DataSerialization framework and finally, registers the DataSerializers
used by Spring Session and required by Apache Geode/Pivotal GemFire to de/serialize the Session
objects
as DataSerializable
types
.protected org.apache.geode.cache.GemFireCache resolveGemFireCache()
GemFireCache
.GemFireCache
.org.apache.geode.cache.CacheClosedException
- if the GemFireCache
cannot be resolved.GemFireCache
protected void registerDataSerializableSessionSerializer()
DataSerializableSessionSerializer
with Apache Geode/Pivotal GemFire
in order to properly handle the Spring Session types.protected void configureUseDataSerialization()
DataSerializable
Session objects.