Class CommandCallbackRepository<A>
java.lang.Object
org.axonframework.commandhandling.distributed.CommandCallbackRepository<A>
- Type Parameters:
A- The type of the endpoint identifier.
This class retains a list of callbacks for CommandCallbackConnectors to use.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String, CommandCallbackWrapper> Returns the callbacks mapped by callback identifier.voidcancelCallbacks(A channelId) Deprecated.cancelCallbacksForChannel(A channelId) Removes all callbacks for a given channel.<E,C, R> CommandCallbackWrapper <E, C, R> fetchAndRemove(String callbackId) Fetches and removes a callback.<E,C, R> void store(String callbackId, CommandCallbackWrapper<E, C, R> commandCallbackWrapper) Stores a callback
-
Constructor Details
-
CommandCallbackRepository
public CommandCallbackRepository()
-
-
Method Details
-
cancelCallbacks
Deprecated.usecancelCallbacksForChannel(Object)insteadRemoves all callbacks for a given channel. Registered callbacks will receive a failure response containing aCommandBusConnectorCommunicationException.- Parameters:
channelId- the channel identifier
-
cancelCallbacksForChannel
Removes all callbacks for a given channel. Registered callbacks will receive a failure response containing aCommandBusConnectorCommunicationException.- Parameters:
channelId- the channel identifier- Returns:
- the collection of removed callbacks
-
fetchAndRemove
Fetches and removes a callback. The callback will not be used a second time, so removal should be fine- Type Parameters:
E- The type of the remote endpoint identifierC- The type of the commandR- The type of the result- Parameters:
callbackId- The Callback Id to fetch the callback for- Returns:
- The stored CommandCallbackWrapper or null if not found
-
store
public <E,C, void storeR> (String callbackId, CommandCallbackWrapper<E, C, R> commandCallbackWrapper) Stores a callback- Type Parameters:
E- The type of the remote endpoint identifierC- The type of the commandR- The type of the result- Parameters:
callbackId- The id to store the callback withcommandCallbackWrapper- The CommandCallbackWrapper to store
-
callbacks
Returns the callbacks mapped by callback identifier.- Returns:
- the command callbacks by id
-
cancelCallbacksForChannel(Object)instead