org.axonframework.commandhandling.distributed.jgroups.support.callbacks
Class ReplyingCallback

java.lang.Object
  extended by org.axonframework.commandhandling.distributed.jgroups.support.callbacks.ReplyingCallback
All Implemented Interfaces:
CommandCallback<Object>

public class ReplyingCallback
extends Object
implements CommandCallback<Object>

Callback implementation that forwards the callback invocation as a reply to an incoming message.

Since:
2.0
Author:
Allard Buijze

Constructor Summary
ReplyingCallback(org.jgroups.JChannel channel, org.jgroups.Address address, CommandMessage commandMessage, Serializer serializer)
          Initialize the callback to send a reply for an incoming commandMessage to given address using the given channel.
 
Method Summary
 void onFailure(Throwable cause)
          Invoked when command handling execution resulted in an error.
 void onSuccess(Object result)
          Invoked when command handling execution was successful.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplyingCallback

public ReplyingCallback(org.jgroups.JChannel channel,
                        org.jgroups.Address address,
                        CommandMessage commandMessage,
                        Serializer serializer)
Initialize the callback to send a reply for an incoming commandMessage to given address using the given channel. The given serializer is used to serialize the reply message.

Parameters:
channel - The channel to send the reply on
address - The destination for the reply message
commandMessage - The incoming command message
serializer - The serializer to serialize the reply with
Method Detail

onSuccess

public void onSuccess(Object result)
Description copied from interface: CommandCallback
Invoked when command handling execution was successful.

Specified by:
onSuccess in interface CommandCallback<Object>
Parameters:
result - The result of the command handling execution, if any.

onFailure

public void onFailure(Throwable cause)
Description copied from interface: CommandCallback
Invoked when command handling execution resulted in an error.

Specified by:
onFailure in interface CommandCallback<Object>
Parameters:
cause - The exception raised during command handling


Copyright © 2010-2016. All Rights Reserved.