org.axonframework.commandhandling.distributed.jgroups.support.callbacks
Class MemberAwareCommandCallback<R>
java.lang.Object
org.axonframework.commandhandling.distributed.jgroups.support.callbacks.MemberAwareCommandCallback<R>
- Type Parameters:
R - The expected type of return value
- All Implemented Interfaces:
- org.axonframework.commandhandling.CommandCallback<R>
public class MemberAwareCommandCallback<R>
- extends Object
- implements org.axonframework.commandhandling.CommandCallback<R>
Callback implementation which wraps another callback, and is aware of the JGroups node responsible for providing the
value to invoke the wrapped callback with.
- Since:
- 2.0
- Author:
- Allard Buijze
|
Constructor Summary |
MemberAwareCommandCallback(org.jgroups.Address dest,
org.axonframework.commandhandling.CommandCallback<R> callback)
Initialize the callback, where the given dest is responsible for providing the value to invoke the
given callback with. |
|
Method Summary |
boolean |
isMemberLive(org.jgroups.View view)
Indicates whether the node responsible for providing the value to invoke the callback with is still alive in the
given currentView. |
void |
onFailure(Throwable cause)
|
void |
onSuccess(R result)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MemberAwareCommandCallback
public MemberAwareCommandCallback(org.jgroups.Address dest,
org.axonframework.commandhandling.CommandCallback<R> callback)
- Initialize the callback, where the given
dest is responsible for providing the value to invoke the
given callback with.
- Parameters:
dest - The destination of the command of which the result is to be passed to the callbackcallback - The callback to invoke with the result of the command
isMemberLive
public boolean isMemberLive(org.jgroups.View view)
- Indicates whether the node responsible for providing the value to invoke the callback with is still alive in the
given
currentView.
- Parameters:
view - The view containing the currently available nodes in the JGroups cluster
- Returns:
true if the node is live, otherwise false
onSuccess
public void onSuccess(R result)
- Specified by:
onSuccess in interface org.axonframework.commandhandling.CommandCallback<R>
onFailure
public void onFailure(Throwable cause)
- Specified by:
onFailure in interface org.axonframework.commandhandling.CommandCallback<R>
Copyright © 2010-2016. All Rights Reserved.