Class LocalSessionCacheWriter

java.lang.Object
org.apache.geode.cache.util.CacheWriterAdapter<String,jakarta.servlet.http.HttpSession>
org.apache.geode.modules.session.catalina.callback.LocalSessionCacheWriter
All Implemented Interfaces:
CacheCallback, CacheWriter<String,jakarta.servlet.http.HttpSession>, Declarable

public class LocalSessionCacheWriter extends CacheWriterAdapter<String,jakarta.servlet.http.HttpSession> implements Declarable
  • Constructor Details

    • LocalSessionCacheWriter

      public LocalSessionCacheWriter(Region<String,jakarta.servlet.http.HttpSession> backingRegion)
  • Method Details

    • beforeCreate

      public void beforeCreate(EntryEvent<String,jakarta.servlet.http.HttpSession> event) throws CacheWriterException
      Description copied from interface: CacheWriter
      Called before an entry is created. Entry creation is initiated by a create, a put, or a get. The CacheWriter can determine whether this value comes from a get or not by evaluating the Operation's Operation.isLoad() method. The entry being created may already exist in the local cache where this CacheWriter is installed, but it does not yet exist in the cache where the operation was initiated.
      Specified by:
      beforeCreate in interface CacheWriter<String,jakarta.servlet.http.HttpSession>
      Overrides:
      beforeCreate in class CacheWriterAdapter<String,jakarta.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:
    • beforeUpdate

      public void beforeUpdate(EntryEvent<String,jakarta.servlet.http.HttpSession> event) throws CacheWriterException
      Description copied from interface: CacheWriter
      Called before an entry is updated. The entry update is initiated by a put or a get 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 interface CacheWriter<String,jakarta.servlet.http.HttpSession>
      Overrides:
      beforeUpdate in class CacheWriterAdapter<String,jakarta.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:
    • beforeDestroy

      public void beforeDestroy(EntryEvent<String,jakarta.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 or Region.localDestroy(Object).
      Specified by:
      beforeDestroy in interface CacheWriter<String,jakarta.servlet.http.HttpSession>
      Overrides:
      beforeDestroy in class CacheWriterAdapter<String,jakarta.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:
    • 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 an AttributesMutator.

      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 interface CacheCallback
      Overrides:
      close in class CacheWriterAdapter<String,jakarta.servlet.http.HttpSession>
      See Also: