Spring Session for VMware GemFire
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:
-
PropertiesDataSerializableDataSerializerCacheCacheFactoryDeclarableGemFireCacheSessionGemFireOperationsSessionRepositoryGemFireHttpSessionConfigurationDataSerializableSessionSerializer
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor used to construct a new, un-initialized instance ofDataSerializableSessionSerializerInitializer.DataSerializableSessionSerializerInitializer(org.apache.geode.cache.GemFireCache gemfireCache) Constructs a new instance ofDataSerializableSessionSerializerInitializerinitialized with the given, non-requiredGemFireCache. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConfigures Spring Session (for Apache Geode/Pivotal GemFire) to "use" Apache Geode/Pivotal GemFire's DataSerialization framework and Delta capableDataSerializableSession objects.voidResolves theGemFireCacheinstance, configures Spring Session (for Apache Geode/Pivotal GemFire) to enable and use the DataSerialization framework and finally, registers theDataSerializersused by Spring Session and required by Apache Geode/Pivotal GemFire to de/serialize theSessionobjects asDataSerializabletypes.protected Optional<org.apache.geode.cache.GemFireCache>Returns anOptionalreference to theGemFireCache.protected org.slf4j.LoggerReturns a reference to the configuredLoggerused to capture log events and messages.voidinitialize(org.apache.geode.cache.Cache cache, Properties parameters) of(org.apache.geode.cache.GemFireCache gemfireCache) Factory method used to construct a new instance ofDataSerializableSessionSerializerInitializerinitialized with the given, non-requiredGemFireCache.protected voidRegisters theDataSerializableSessionSerializerwith Apache Geode/Pivotal GemFire in order to properly handle the Spring Session types.protected org.apache.geode.cache.GemFireCacheResolves a reference to theGemFireCache.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 ofDataSerializableSessionSerializerInitializerinitialized 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 initializedGemFireCacheinstance if available.- Parameters:
gemfireCache- reference to theGemFireCacheinstance.GemFireCachemay 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 ofDataSerializableSessionSerializerInitializerinitialized with the given, non-requiredGemFireCache.- Parameters:
gemfireCache- reference to theGemFireCacheinstance.- Returns:
- a new
DataSerializableSessionSerializerInitializerinitialized with the given, non-requiredGemFireCache. - See Also:
-
getGemFireCache
Returns anOptionalreference to theGemFireCache. TheGemFireCacheinstance 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 configuredLoggerused to capture log events and messages.- Returns:
- a reference to the configured
Loggerused for logging. - See Also:
-
Logger
-
initialize
- Specified by:
initializein interfaceorg.apache.geode.cache.Declarable- See Also:
-
doInitialization
public void doInitialization()Resolves theGemFireCacheinstance, configures Spring Session (for Apache Geode/Pivotal GemFire) to enable and use the DataSerialization framework and finally, registers theDataSerializersused by Spring Session and required by Apache Geode/Pivotal GemFire to de/serialize theSessionobjects asDataSerializabletypes. -
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 theGemFireCachecannot be resolved.- See Also:
-
GemFireCache
-
registerDataSerializableSessionSerializer
protected void registerDataSerializableSessionSerializer()Registers theDataSerializableSessionSerializerwith 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 capableDataSerializableSession objects.
-