org.rhq.enterprise.communications.command.client
Interface SendCallback


public interface SendCallback

This interface allows implementors to perform logic just before and just after the send. For asynchronous commands there may be a time lag between queuing and sending. And, the send may be performed on a different thread than the queuing. The main purpose of this is to provide a chance to set thread-local information that can affect the serialization logic.

Author:
Jay Shaughnessy, John Mazzitelli

Method Summary
 void sending(Command command)
          This method provides the hook for pre-send logic.
 CommandResponse sent(Command command, CommandResponse response)
          This method provides the hook for post-send logic.
 

Method Detail

sending

void sending(Command command)
This method provides the hook for pre-send logic. (such as setting ThreadLocals on the sender thread).

Parameters:
command - the command being sent

sent

CommandResponse sent(Command command,
                     CommandResponse response)
This method provides the hook for post-send logic. The command response can be inspected/manipulated if desired. If not modifying the response the method should return the passed-in .

Parameters:
command - the command being sent
Returns:
the command response. Not null, should return a new CommandRespose or the the passed in .


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.