Class LocalCommandDispatcher<C>
java.lang.Object
org.wildfly.clustering.server.local.dispatcher.LocalCommandDispatcher<C>
- Type Parameters:
C- command context
- All Implemented Interfaces:
AutoCloseable, CommandDispatcher<LocalGroupMember, C>
public class LocalCommandDispatcher<C>
extends Object
implements CommandDispatcher<LocalGroupMember, C>
Non-clustered
CommandDispatcher implementation- Author:
- Paul Ferraro
-
Constructor Summary
ConstructorsConstructorDescriptionLocalCommandDispatcher(LocalGroupMember member, C context) Creates a local command dispatcher. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()<R, E extends Exception>
Map<LocalGroupMember, CompletionStage<R>> dispatchToGroup(Command<R, ? super C, E> command, Set<LocalGroupMember> excluding) Executes the specified command on all members of the group, optionally excluding some members.<R, E extends Exception>
CompletionStage<R> dispatchToMember(Command<R, ? super C, E> command, LocalGroupMember member) Executes the specified command on the specified group member.Returns the context with which this dispatcher was created.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CommandDispatcher
dispatchToGroup
-
Constructor Details
-
LocalCommandDispatcher
Creates a local command dispatcher.- Parameters:
member- the local group member.context- the command context
-
-
Method Details
-
getContext
Description copied from interface:CommandDispatcherReturns the context with which this dispatcher was created.- Specified by:
getContextin interfaceCommandDispatcher<LocalGroupMember, C>- Returns:
- a command execution context
-
dispatchToMember
public <R, E extends Exception> CompletionStage<R> dispatchToMember(Command<R, ? super C, E> command, LocalGroupMember member) Description copied from interface:CommandDispatcherExecutes the specified command on the specified group member. If the member has no corresponding dispatcher, the returned completion stage throws aCancellationException.- Specified by:
dispatchToMemberin interfaceCommandDispatcher<LocalGroupMember, C>- Type Parameters:
R- the command execution return typeE- the command exception type- Parameters:
command- the command to executemember- the group member on which to execute the command- Returns:
- the future result of the command execution
-
dispatchToGroup
public <R, E extends Exception> Map<LocalGroupMember, CompletionStage<R>> dispatchToGroup(Command<R, ? super C, E> command, Set<LocalGroupMember> excluding) Description copied from interface:CommandDispatcherExecutes 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.- Specified by:
dispatchToGroupin interfaceCommandDispatcher<LocalGroupMember, C>- Type Parameters:
R- the command execution return typeE- the command exception type- Parameters:
command- the command to executeexcluding- the members to be excluded from group command execution- Returns:
- a completion stage per member of the group on which the command was executed
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCommandDispatcher<LocalGroupMember, C>
-