Interface ServerActivity

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      default int getExecutionGroup()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a value that indicates to which set of ServerActivity instances registered with the ServerActivityRegistry this activity should belong.
      default CompletionStage<Void> prepare​(ServerSuspendContext context)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a prepare stage to complete prior to server suspension.
      void preSuspend​(ServerActivityCallback listener)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Invoked before the server is paused.
      void resume()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Invoked if the suspend or pre-suspend is cancelled or if a suspended server is resumed.
      default CompletionStage<Void> resume​(ServerResumeContext context)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a resume stage to complete upon resuming a suspended server.
      default CompletionStage<Void> suspend​(ServerSuspendContext context)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a suspend stage to complete upon server suspension.
      void suspended​(ServerActivityCallback listener)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Invoked once the suspend process has started.
    • Field Detail

      • LOWEST_EXECUTION_GROUP

        static final int LOWEST_EXECUTION_GROUP
        Deprecated, for removal: This API element is subject to removal in a future version.
        The lowest valid value to return from getExecutionGroup().
      • DEFAULT_EXECUTION_GROUP

        static final int DEFAULT_EXECUTION_GROUP
        Deprecated, for removal: This API element is subject to removal in a future version.
        The default value returned from getExecutionGroup(). Implementations should use this unless there is a clear reason to use a different value.
      • HIGHEST_EXECUTION_GROUP

        static final int HIGHEST_EXECUTION_GROUP
        Deprecated, for removal: This API element is subject to removal in a future version.
        The highest valid value to return from getExecutionGroup().
    • Method Detail

      • getExecutionGroup

        default int getExecutionGroup()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns a value that indicates to which set of ServerActivity instances registered with the ServerActivityRegistry this activity should belong. All ServerActivity instances with the same execution group value have their preSuspend, suspended and resume methods invoked separately from activities with different execution group values.

        The order in which execution groups will be processed depends on the method being invoked:

        • For preSuspend and suspended, groups with a lower value are processed before those with a higher value.
        • For resume, groups with a higher value are processed before those with a lower value.

        There is no guarantee of any ordering of method invocation between activities in the same execution group, and they may even be processed concurrently.

        Note that preSuspend is invoked for all activity instances before the overall suspend process proceeds to calls to suspended. The unit of grouping is the individual method invocations, not the overall preSuspend/suspended process.

        The default implementation of this method returns DEFAULT_EXECUTION_GROUP.

        Returns:
        a value between LOWEST_EXECUTION_GROUP and HIGHEST_EXECUTION_GROUP, inclusive.
      • preSuspend

        void preSuspend​(ServerActivityCallback listener)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Invoked before the server is paused. This is the place where pause notifications should be sent to external systems such as load balancers to tell them this node is about to go away.
        Parameters:
        listener - The listener to invoker when the pre-pause phase is done
      • suspended

        void suspended​(ServerActivityCallback listener)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Invoked once the suspend process has started. One this has been invoked no new requests should be allowed to proceeed
        Parameters:
        listener - The listener to invoke when suspend is done.
      • resume

        void resume()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Invoked if the suspend or pre-suspend is cancelled or if a suspended server is resumed.
      • prepare

        default CompletionStage<Void> prepare​(ServerSuspendContext context)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: SuspendableActivity
        Returns a prepare stage to complete prior to server suspension. Default implementation returns a completed stage.
        Specified by:
        prepare in interface SuspendableActivity
        Parameters:
        context - the server suspend context
        Returns:
        a prepare stage to complete prior to server suspension.
      • suspend

        default CompletionStage<Void> suspend​(ServerSuspendContext context)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: SuspendableActivity
        Returns a suspend stage to complete upon server suspension.
        Specified by:
        suspend in interface SuspendableActivity
        Parameters:
        context - the server suspend context
        Returns:
        a suspend stage to complete upon server suspension.
      • resume

        default CompletionStage<Void> resume​(ServerResumeContext context)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: SuspendableActivity
        Returns a resume stage to complete upon resuming a suspended server.
        Specified by:
        resume in interface SuspendableActivity
        Parameters:
        context - the server resume context
        Returns:
        a resume stage to complete upon resuming a suspended server.