Package org.jboss.as.server.suspend
Interface ServerActivity
-
public interface ServerActivityA server activity that may have to finish before the server can shut down gracefully.- Author:
- Stuart Douglas
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_EXECUTION_GROUPThe default value returned fromgetExecutionGroup().static intHIGHEST_EXECUTION_GROUPThe highest valid value to return fromgetExecutionGroup().static intLOWEST_EXECUTION_GROUPThe lowest valid value to return fromgetExecutionGroup().
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intgetExecutionGroup()Returns a value that indicates to which set ofServerActivityinstancesregisteredwith theSuspendControllerthis activity should belong.voidpreSuspend(ServerActivityCallback listener)Invoked before the server is paused.voidresume()Invoked if the suspend or pre-suspend is cancelled or if a suspended server is resumed.voidsuspended(ServerActivityCallback listener)Invoked once the suspend process has started.
-
-
-
Field Detail
-
LOWEST_EXECUTION_GROUP
static final int LOWEST_EXECUTION_GROUP
The lowest valid value to return fromgetExecutionGroup().- See Also:
- Constant Field Values
-
DEFAULT_EXECUTION_GROUP
static final int DEFAULT_EXECUTION_GROUP
The default value returned fromgetExecutionGroup(). Implementations should use this unless there is a clear reason to use a different value.- See Also:
- Constant Field Values
-
HIGHEST_EXECUTION_GROUP
static final int HIGHEST_EXECUTION_GROUP
The highest valid value to return fromgetExecutionGroup().- See Also:
- Constant Field Values
-
-
Method Detail
-
getExecutionGroup
default int getExecutionGroup()
Returns a value that indicates to which set ofServerActivityinstancesregisteredwith theSuspendControllerthis activity should belong. AllServerActivityinstances with the same execution group value have theirpreSuspend,suspendedandresumemethods 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
preSuspendandsuspended, 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
preSuspendis invoked for all activity instances before the overall suspend process proceeds to calls tosuspended. 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_GROUPandHIGHEST_EXECUTION_GROUP, inclusive.
- For
-
preSuspend
void preSuspend(ServerActivityCallback listener)
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)
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()
Invoked if the suspend or pre-suspend is cancelled or if a suspended server is resumed.
-
-