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

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void close()
      Closes any resources associated with this bean.
      void discard()
      Removes this bean from the cache without triggering any events.
      default K getId()
      Returns the bean identifier.
      V getInstance()
      Returns the bean instance.
      boolean isClosed()
      Indicates whether or not this bean was closed, i.e.
      boolean isDiscarded()
      Indicates whether or not this bean was discarded, i.e.
      boolean isRemoved()
      Indicates whether or not this bean was removed, i.e.
      void remove()
      Removes this bean from the cache, triggering requisite PreDestroy events.
    • Method Detail

      • 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