org.apache.geode.modules.session.catalina.callback

## Class LocalSessionCacheLoader

- java.lang.Object
- - org.apache.geode.modules.session.catalina.callback.LocalSessionCacheLoader

- All Implemented Interfaces:
    CacheCallback, CacheLoader<java.lang.String,javax.servlet.http.HttpSession>, Declarable

      public class LocalSessionCacheLoader
      extends java.lang.Object
      implements CacheLoader<java.lang.String,javax.servlet.http.HttpSession>, Declarable

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalSessionCacheLoader(Region<java.lang.String,javax.servlet.http.HttpSession> backingRegion)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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 an `AttributesMutator`.
    `void` | `init(java.util.Properties p)` Initializes a user-defined object using the given properties.
    `javax.servlet.http.HttpSession` | `load(LoaderHelper<java.lang.String,javax.servlet.http.HttpSession> helper)` Loads a value.

    - ### 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

      `initialize`

- - ### Constructor Detail

    - #### LocalSessionCacheLoader

          public LocalSessionCacheLoader(Region<java.lang.String,javax.servlet.http.HttpSession> backingRegion)

  - ### Method Detail

    - #### load

          public javax.servlet.http.HttpSession load(LoaderHelper<java.lang.String,javax.servlet.http.HttpSession> helper)
                                              throws CacheLoaderException

      Description copied from interface: `CacheLoader`
      Loads a value. Application writers should implement this method to customize the loading of a value. This method is called by the caching service when the requested value is not in the cache. Any exception (including an unchecked exception) thrown by this method is propagated back to and thrown by the invocation of `Region.get(Object, Object)` that triggered this load.

      Specified by:
        `load` in interface `CacheLoader<java.lang.String,javax.servlet.http.HttpSession>`
      Parameters:
        `helper` - a LoaderHelper object that is passed in from cache service and provides access to the key, region, argument, and `netSearch`.
      Returns:
        the value supplied for this key, or null if no value can be supplied. A local loader will always be invoked if one exists. Otherwise one remote loader is invoked. Returning `null` causes `Region.get(Object, Object)` to return `null`.
      Throws:
        `CacheLoaderException`
      See Also:
        `Region.get`

    - #### 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`
      See Also:
        `RegionService.close()`, `Region.close()`, `Region.localDestroyRegion()`, `Region.destroyRegion()`, `AttributesMutator`

    - #### init

          public void init(java.util.Properties p)

      Description copied from interface: `Declarable`
      Initializes a user-defined object using the given properties. Note that any uncaught exception thrown by this method will cause the `Cache` initialization to fail.
      Specified by:
        `init` in interface `Declarable`
      Parameters:
        `p` - Contains the parameters declared in the declarative xml file.