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


public interface InitializeCallback

Callback that is informed when a communicator is about to send its very first command since being connected.

Author:
John Mazzitelli

Method Summary
 boolean sendingInitialCommand(RemoteCommunicator remoteCommunicator, Command command)
          The callback method that is called when a remote communicator is about to send its very first command.
 

Method Detail

sendingInitialCommand

boolean sendingInitialCommand(RemoteCommunicator remoteCommunicator,
                              Command command)
                              throws Throwable
The callback method that is called when a remote communicator is about to send its very first command. The callback is not responsible for sending the given command, rather, this is just a notification to let the callback know what command is about to be sent by the communicator. Implementations can indicate if the request should be aborted by throwing an exception. Returning normally means the initializer has finished doing what its doing and the remote communicator can continue with sending that first message. This callback method is allowed to send commands itself to the remote endpoint via RemoteCommunicator.sendWithoutCallbacks(Command) or RemoteCommunicator.sendWithoutInitializeCallback(Command). If no exception occurred within the callback method implementation, but the callback wants to be called again the next time a command is to be sent, return false. A true will indicate the callback is done what it had to do and no longer needs to be called.

Parameters:
remoteCommunicator - the communicator object that is making the call
command - the command that is being sent that triggered this callback
Returns:
true if the callback finished performing its initialization and no longer needs to be called. false means the callback would like to be invoked again the next time a command is to be sent.
Throws:
Exception - if for some reason the callback has detected a problem that should prohibit the remote communicator from sending the command to the remote endpoint.
Throwable


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