Interface CommandDispatcher<C>
- Type Parameters:
C- the command context type
- All Superinterfaces:
AutoCloseable
Deprecated, for removal: This API element is subject to removal in a future version.
Dispatches commands for execution on a group.
- Author:
- Paul Ferraro
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deprecated, for removal: This API element is subject to removal in a future version.Closes any resources used by this dispatcher.<R> Map<Node,CompletionStage<R>> executeOnGroup(Command<R, ? super C> command, Node... excludedMembers) Deprecated, for removal: This API element is subject to removal in a future version.Executes the specified command on all members of the group, optionally excluding some members.<R> CompletionStage<R>executeOnMember(Command<R, ? super C> command, Node member) Deprecated, for removal: This API element is subject to removal in a future version.Executes the specified command on the specified group member.Deprecated, for removal: This API element is subject to removal in a future version.Returns the context with which this dispatcher was created.
-
Method Details
-
getContext
C getContext()Deprecated, for removal: This API element is subject to removal in a future version.Returns the context with which this dispatcher was created.- Returns:
- a command execution context
-
executeOnMember
<R> CompletionStage<R> executeOnMember(Command<R, ? super C> command, Node member) throws CommandDispatcherExceptionDeprecated, for removal: This API element is subject to removal in a future version.Executes the specified command on the specified group member. If the member has no corresponding dispatcher, the returned completion stage throws aCancellationException.- Type Parameters:
R- the command execution return type- Parameters:
command- the command to executemember- the group member on which to execute the command- Returns:
- the future result of the command execution
- Throws:
CommandDispatcherException- if the command could not be sent
-
executeOnGroup
<R> Map<Node,CompletionStage<R>> executeOnGroup(Command<R, ? super C> command, Node... excludedMembers) throws CommandDispatcherExceptionDeprecated, for removal: This API element is subject to removal in a future version.Executes the specified command on all members of the group, optionally excluding some members. If a given member has no corresponding dispatcher, its completion stage throws aCancellationException.- Type Parameters:
R- the command execution return type- Parameters:
command- the command to executeexcludedMembers- the members to be excluded from group command execution- Returns:
- a completion stage per member of the group on which the command was executed
- Throws:
CommandDispatcherException- if the command could not be sent
-
close
void close()Deprecated, for removal: This API element is subject to removal in a future version.Closes any resources used by this dispatcher. Once closed, a dispatcher can no longer execute commands.- Specified by:
closein interfaceAutoCloseable
-
CommandDispatcher.