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


public interface ClientCommandSenderStateListener

This interface defines an object that is to listen for state changes to a ClientCommandSender. A state change is either one in which the sender goes from sending-to-not-sending or from not-sending-to-sending.

Add implementations of this listener to a sender object via ClientCommandSender.addStateListener(ClientCommandSenderStateListener, boolean)

Author:
John Mazzitelli

Method Summary
 boolean startedSending(ClientCommandSender sender)
          The notification method that is called when the sender this object is listening to has started sending commands to its remote endpoint.
 boolean stoppedSending(ClientCommandSender sender)
          The notification method that is called when the sender this object is listening to has stopped sending commands to its remote endpoint.
 

Method Detail

startedSending

boolean startedSending(ClientCommandSender sender)
The notification method that is called when the sender this object is listening to has started sending commands to its remote endpoint.

If the listener wants to keep listening, it must return true. If this method throws an exception, it is the same as if false is returned; that is, it will be removed and thus no longer receive notifications.

Parameters:
sender - the sender that emitted the notification
Returns:
true if this listener wants to keep listening for state changes; false if the listener no longer wishes to listen for state changes and should be removed from the sender's list of listeners.

stoppedSending

boolean stoppedSending(ClientCommandSender sender)
The notification method that is called when the sender this object is listening to has stopped sending commands to its remote endpoint.

If the listener wants to keep listening, it must return true. If this method throws an exception, it is the same as if false is returned; that is, it will be removed and thus no longer receive notifications.

Parameters:
sender -
Returns:
true if this listener wants to keep listening for state changes; false if the listener no longer wishes to listen for state changes and should be removed from the sender's list of listeners.


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