org.rhq.enterprise.communications
Class GlobalConcurrencyLimitCommandListener

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

public class GlobalConcurrencyLimitCommandListener
extends Object
implements CommandListener

This is a listener for commands coming into the ServiceContainer's CommandPreprocessor and will immediately drop the command if the global concurrent limit has been exceeded. In other words, if we've received too many incoming commands at the same time, we'll start dropping additional incoming commands under the command processor can catch up.

Author:
John Mazzitelli

Field Summary
static String CONCURRENCY_LIMIT_NAME
           
 
Constructor Summary
GlobalConcurrencyLimitCommandListener(ServiceContainer serviceContainer)
           
 
Method Summary
 void processedCommand(Command command, CommandResponse response)
          This is called for every command that finished which includes all commands that succeeded, failed or was not permitted due to receivedCommand(Command) throwing a NotPermittedException.
 void receivedCommand(Command command)
          This will be called for every command coming in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONCURRENCY_LIMIT_NAME

public static final String CONCURRENCY_LIMIT_NAME
See Also:
Constant Field Values
Constructor Detail

GlobalConcurrencyLimitCommandListener

public GlobalConcurrencyLimitCommandListener(ServiceContainer serviceContainer)
Method Detail

receivedCommand

public void receivedCommand(Command command)
This will be called for every command coming in. We'll check to see if we are permitted to process this command - if we've reached the global concurrency limit, this method will throw a NotPermittedException.

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 which includes all commands that succeeded, failed or was not permitted due to receivedCommand(Command) throwing a NotPermittedException.

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)


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