Interface StatefulSessionBean<K,V extends StatefulSessionBeanInstance<K>>

Type Parameters:
K - the bean identifier type
V - the bean instance type
All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
DistributableStatefulSessionBean, SimpleStatefulSessionBean

public interface StatefulSessionBean<K,V extends StatefulSessionBeanInstance<K>> extends AutoCloseable
A cached stateful session bean.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes any resources associated with this bean.
    void
    Removes this bean from the cache without triggering any events.
    default K
    Returns the bean identifier.
    Returns the bean instance.
    boolean
    Indicates whether or not this bean was closed, i.e.
    boolean
    Indicates whether or not this bean was discarded, i.e.
    boolean
    Indicates whether or not this bean was removed, i.e.
    void
    Removes this bean from the cache, triggering requisite PreDestroy events.
  • Method Details

    • getId

      default K getId()
      Returns the bean identifier.
      Returns:
      the bean identifier.
    • getInstance

      V getInstance()
      Returns the bean instance.
      Returns:
      a bean instance.
    • isClosed

      boolean isClosed()
      Indicates whether or not this bean was closed, i.e. close() was invoked.
      Returns:
      true, if this bean is valid, false otherwise.
    • isDiscarded

      boolean isDiscarded()
      Indicates whether or not this bean was discarded, i.e. discard() was invoked.
      Returns:
      true, if this bean was discarded, false otherwise.
    • isRemoved

      boolean isRemoved()
      Indicates whether or not this bean was removed, i.e. remove() was invoked.
      Returns:
      true, if this bean was removed, false otherwise.
    • discard

      void discard()
      Removes this bean from the cache without triggering any events. A discarded bean does not need to be closed.
    • remove

      void remove()
      Removes this bean from the cache, triggering requisite PreDestroy events. A removed bean does not need to be closed.
    • close

      void close()
      Closes any resources associated with this bean. If bean has an associated timeout, it will schedule its expiration.
      Specified by:
      close in interface AutoCloseable