CommandDispatcherDelegate

public interface CommandDispatcherDelegate

A common interface for objects which need to dispatch the commands, but are unable to implement the CommandDispatcher.

A typical example of a CommandDispatcherDelegate usage is a routine, which simultaneously dispatches different types of messages in addition to Commands.

In this case such a class would have to implement several MessageDispatcher child interfaces (such as CommandDispatcher or EventDispatcher). However, it is impossible to implement the same getMessageClasses() method several times with the different types of MessageClasses returned.

The same interference takes place in attempt to implement UnicastDispatcher.dispatch(MessageEnvelope) method with the different types of MessageEnvelopes dispatches simultaneously.

That's why unlike MessageDispatcher, this interface defines its own contract for declaring the dispatched command classes, which does not interfere with the MessageDispatcher API.

See also

Inheritors

Functions

Link copied to clipboard
public abstract ImmutableSet<CommandClass> commandClasses()
Obtains the classes of dispatched commands.
Link copied to clipboard
public abstract DispatchOutcome dispatchCommand(CommandEnvelope envelope)
Dispatches the command and returns the outcome of the dispatching.
Link copied to clipboard
public boolean dispatchesCommands()
Tells if this instance dispatches at least one command.