SessionCustomExpiry (Apache Geode 1.3.0)
Date: 2017-10-26

org.apache.geode.modules.util

## Class SessionCustomExpiry

- java.lang.Object
- - org.apache.geode.modules.util.SessionCustomExpiry

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

      public class SessionCustomExpiry
      extends java.lang.Object
      implements CustomExpiry<java.lang.String,javax.servlet.http.HttpSession>, java.io.Serializable, Declarable

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SessionCustomExpiry()`

  - ### 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`.
    `boolean` | `equals(java.lang.Object obj)`
    `ExpirationAttributes` | `getExpiry(Region.Entry<java.lang.String,javax.servlet.http.HttpSession> entry)` Calculate the expiration for a given entry.
    `void` | `init(java.util.Properties props)` Initializes a user-defined object using the given properties.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SessionCustomExpiry

          public SessionCustomExpiry()

  - ### Method Detail

    - #### getExpiry

          public ExpirationAttributes getExpiry(Region.Entry<java.lang.String,javax.servlet.http.HttpSession> entry)

      Description copied from interface: `CustomExpiry`
      Calculate the expiration for a given entry. Returning null indicates that the default for the region should be used.

      The entry parameter should not be used after this method invocation completes.

      Specified by:
        `getExpiry` in interface `CustomExpiry<java.lang.String,javax.servlet.http.HttpSession>`
      Parameters:
        `entry` - the entry to calculate the expiration for
      Returns:
        the expiration to be used, null if the region's defaults should be used.

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

      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:
        `props` - Contains the parameters declared in the declarative xml file.

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`