Interface Session

  • All Superinterfaces:
    AutoCloseable
    All Known Implementing Classes:
    CoherenceSession

    public interface Session
    extends AutoCloseable
    A thread-safe mechanism to request Coherence-based resources, like NamedCaches, from a deployed module.

    Resources provided by a Session are scoped to the Session. When a Session is closed, all resources are closed. Once closed, references to resources are no longer valid. Any attempt to use a closed Session or closed resource may throw an IllegalStateException.

    The effect of closing a resource is specific to the type of resource. For example, resources provided by a Session may represent shared (ie: clustered) data-structures and services. In such circumstances, closing these resources only closes the Session-based representation, not the underlying shared infrastructure, which may remain active for other Sessions. Future requests of a Session for previously closed resources of this kind will likely yield a new reference to logically the same underlying resource. To destroy such resources, instead of close, resource-specific methods should be used.

    Applications making use of Sessions are expected to maintain their own references to Sessions. Coherence provides no mechanism to identify and obtain previously created Sessions. Furthermore, applications are expected to correctly close Sessions when they are no longer required.

    Author:
    bo 2015.07.27
    See Also:
    SessionProvider