org.rhq.enterprise.communications
Class GlobalSuspendCommandListener

java.lang.Object
  extended by org.rhq.enterprise.communications.GlobalSuspendCommandListener
All Implemented Interfaces:
CommandListener

public class GlobalSuspendCommandListener
extends Object
implements CommandListener

This is a listener for commands coming into the ServiceContainer's CommandPreprocessor and will immediately deny processing of the command, returning a NotProcessedException. This is used if for some reason all command processing should stop temporarily. Adding the listener will stop all commands and deleting the listener will resume command processing.

Author:
Jay Shaughnessy

Constructor Summary
GlobalSuspendCommandListener(String name, String reason)
           
 
Method Summary
 boolean equals(Object obj)
           
 int hashCode()
           
 void processedCommand(Command command, CommandResponse response)
          This is called for every command that finished.
 void receivedCommand(Command command)
          This will be called for every command coming in.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalSuspendCommandListener

public GlobalSuspendCommandListener(String name,
                                    String reason)
Parameters:
reason - The reason command processing is being suspended. If provided will be supplied to NotProcessedException
Method Detail

receivedCommand

public void receivedCommand(Command command)
This will be called for every command coming in. We'll simply deny service to the command by throwing a NotProcessedException.

Specified by:
receivedCommand in interface CommandListener
Parameters:
command - the new command that was received
See Also:
CommandListener.receivedCommand(Command)

processedCommand

public void processedCommand(Command command,
                             CommandResponse response)
This is called for every command that finished. It does nothing since we always throw a NotProcessedException.

Specified by:
processedCommand in interface CommandListener
Parameters:
command - the command that was received and processed
response - the results of the command - this is being sent back to the client
See Also:
CommandListener.processedCommand(Command, CommandResponse)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


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