Gemfire JavaDocs
Class LocalSessionCacheWriter
- java.lang.Object
-
- org.apache.geode.cache.util.CacheWriterAdapter<java.lang.String,javax.servlet.http.HttpSession>
-
- org.apache.geode.modules.session.catalina.callback.LocalSessionCacheWriter
-
- All Implemented Interfaces:
CacheCallback
,CacheWriter<java.lang.String,javax.servlet.http.HttpSession>
,Declarable
public class LocalSessionCacheWriter extends CacheWriterAdapter<java.lang.String,javax.servlet.http.HttpSession> implements Declarable
-
-
Constructor Summary
Constructors Constructor Description LocalSessionCacheWriter(Region<java.lang.String,javax.servlet.http.HttpSession> backingRegion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeCreate(EntryEvent<java.lang.String,javax.servlet.http.HttpSession> event)
Called before an entry is created.void
beforeDestroy(EntryEvent<java.lang.String,javax.servlet.http.HttpSession> event)
Called before an entry is destroyed.void
beforeUpdate(EntryEvent<java.lang.String,javax.servlet.http.HttpSession> event)
Called before an entry is updated.void
close()
Called when the region containing this callback is closed or destroyed, when the cache is closed, or when a callback is removed from a region using anAttributesMutator
.-
Methods inherited from class org.apache.geode.cache.util.CacheWriterAdapter
beforeRegionClear, beforeRegionDestroy
-
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, initialize
-
-
-
-
Constructor Detail
-
LocalSessionCacheWriter
public LocalSessionCacheWriter(Region<java.lang.String,javax.servlet.http.HttpSession> backingRegion)
-
-
Method Detail
-
beforeCreate
public void beforeCreate(EntryEvent<java.lang.String,javax.servlet.http.HttpSession> event) throws CacheWriterException
Description copied from interface:CacheWriter
Called before an entry is created. Entry creation is initiated by acreate
, aput
, or aget
. TheCacheWriter
can determine whether this value comes from aget
or not by evaluating theOperation
'sOperation.isLoad()
method. The entry being created may already exist in the local cache where thisCacheWriter
is installed, but it does not yet exist in the cache where the operation was initiated.- Specified by:
beforeCreate
in interfaceCacheWriter<java.lang.String,javax.servlet.http.HttpSession>
- Overrides:
beforeCreate
in classCacheWriterAdapter<java.lang.String,javax.servlet.http.HttpSession>
- Parameters:
event
- an EntryEvent that provides information about the operation in progress- Throws:
CacheWriterException
- if thrown will abort the operation in progress, and the exception will be propagated back to caller that initiated the operation- See Also:
Region.create(Object, Object)
,Region.put(Object, Object)
,Region.get(Object)
-
beforeUpdate
public void beforeUpdate(EntryEvent<java.lang.String,javax.servlet.http.HttpSession> event) throws CacheWriterException
Description copied from interface:CacheWriter
Called before an entry is updated. The entry update is initiated by aput
or aget
that causes the loader to update an existing entry. The entry previously existed in the cache where the operation was initiated, although the old value may have been null. The entry being updated may or may not exist in the local cache where the CacheWriter is installed.- Specified by:
beforeUpdate
in interfaceCacheWriter<java.lang.String,javax.servlet.http.HttpSession>
- Overrides:
beforeUpdate
in classCacheWriterAdapter<java.lang.String,javax.servlet.http.HttpSession>
- Parameters:
event
- an EntryEvent that provides information about the operation in progress- Throws:
CacheWriterException
- if thrown will abort the operation in progress, and the exception will be propagated back to caller that initiated the operation- See Also:
Region.put(Object, Object)
,Region.get(Object)
-
beforeDestroy
public void beforeDestroy(EntryEvent<java.lang.String,javax.servlet.http.HttpSession> event) throws CacheWriterException
Description copied from interface:CacheWriter
Called before an entry is destroyed. The entry being destroyed may or may not exist in the local cache where the CacheWriter is installed. This method is not called as a result of expiration orRegion.localDestroy(Object)
.- Specified by:
beforeDestroy
in interfaceCacheWriter<java.lang.String,javax.servlet.http.HttpSession>
- Overrides:
beforeDestroy
in classCacheWriterAdapter<java.lang.String,javax.servlet.http.HttpSession>
- Parameters:
event
- an EntryEvent that provides information about the operation in progress- Throws:
CacheWriterException
- if thrown will abort the operation in progress, and the exception will be propagated back to caller that initiated the operation- See Also:
Region.destroy(Object)
-
close
public void close()
Description copied from interface:CacheCallback
Called when the region containing this callback is closed or destroyed, when the cache is closed, or when a callback is removed from a region using anAttributesMutator
.Implementations should cleanup any external resources such as database connections. Any runtime exceptions this method throws will be logged.
It is possible for this method to be called multiple times on a single callback instance, so implementations must be tolerant of this.
- Specified by:
close
in interfaceCacheCallback
- Overrides:
close
in classCacheWriterAdapter<java.lang.String,javax.servlet.http.HttpSession>
- See Also:
RegionService.close()
,Region.close()
,Region.localDestroyRegion()
,Region.destroyRegion()
,AttributesMutator
-
-