Interface Guardable

    • Method Detail

      • setContext

        void setContext​(Guardian.GuardContext context)
        Set the guard context. Passing in null indicates that the Guardable is no longer being monitored by a Guardian.
        Parameters:
        context - the context guarding this Guardable
      • getContext

        Guardian.GuardContext getContext()
        Return the guard context monitoring this guardable, or null if this Guardable is no longer being monitored.
        Returns:
        the context guarding this Guardable
      • recover

        void recover()
        Attempt to recover this Guardable.

        In a common case where the Guardable has an associated thread, a suitable action would be to interrupt the thread.

        If this method does not return before the timeout expires, the Guardable will be considered unrecoverable and will be terminated.

      • terminate

        void terminate()
        Terminate this Guardable.

        This is the final action taken by the Guardian before the Guardable is removed from its responsibility list.