Return-Path: Delivered-To: apmail-jakarta-avalon-cvs-archive@apache.org Received: (qmail 21186 invoked from network); 25 Sep 2002 20:04:08 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 25 Sep 2002 20:04:08 -0000 Received: (qmail 21851 invoked by uid 97); 25 Sep 2002 20:04:47 -0000 Delivered-To: qmlist-jakarta-archive-avalon-cvs@jakarta.apache.org Received: (qmail 21835 invoked by uid 97); 25 Sep 2002 20:04:46 -0000 Mailing-List: contact avalon-cvs-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-cvs@jakarta.apache.org Received: (qmail 21824 invoked by uid 97); 25 Sep 2002 20:04:45 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 25 Sep 2002 20:03:57 -0000 Message-ID: <20020925200357.56183.qmail@icarus.apache.org> From: bloritsch@apache.org To: jakarta-avalon-excalibur-cvs@apache.org Subject: cvs commit: jakarta-avalon-excalibur/event/src/xdocs command.xml menu.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bloritsch 2002/09/25 13:03:57 Modified: event/src/xdocs menu.xml Added: event/src/xdocs command.xml Log: Add new page to event docs Revision Changes Path 1.3 +2 -2 jakarta-avalon-excalibur/event/src/xdocs/menu.xml Index: menu.xml =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/event/src/xdocs/menu.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- menu.xml 25 Sep 2002 18:03:47 -0000 1.2 +++ menu.xml 25 Sep 2002 20:03:56 -0000 1.3 @@ -12,8 +12,8 @@ - 1.1 jakarta-avalon-excalibur/event/src/xdocs/command.xml Index: command.xml ===================================================================
Excalibur Event - Command

Command was created as a way to offload management functions to a CommandManager which would execute the functions in the background. The benefits of this approach are tremendous when you are handling several requests at the same time. As load increases, you don't increase the frequency in which certain functions are performed (as in the normal synchronous management), and you reduce the time for the critical path to execute. The critical path is the part of your code that actually solves your problems as opposed to managing resources.

A better question might be "when should I not to use Command?". The complexity of the thread management and command timing is completely hidden from you. That makes Command as easy to use as any event based system like Swing. That said, if you have a really trivial system, or you do not work with heavy request loads it is definitely easier to design your system the old fashioned way. If you do expect your application to work under heavy load, you will find Command to be indespensible.

Command is built on top of Event. That means we use a Command Sink to enqueue Commands for the CommandManager to process. The CommandManager then executes the commands as they are pulled off of the queue. A Command can be a repeating command, so CommandManager will automatically requeue that command for you.

A Command is an object that performs any function you desire. You create it by simply implementing the Command interface. There are three types of commands: a generic command that is executed immediately in a background thread, a delayed command that is executed after a specified period of time, and a repeated command that is executed again and again until the Command Manager is shut down.

The Command Manager takes care of processing both Commands and Signals. With Signals, it will notify the registered Signal listener. With commands it schedules their execution in a background thread.

A Thread Manager takes care of the threading policy for the Command Manager. It manages the thread pool size, and how often the Event Pipeline (the path from a Source to an EventHandler) is checked.

Copyright (c) @year@ The Jakarta Apache Project All rights reserved. $Revision: 1.1 $ $Date: 2002/09/25 20:03:56 $
-- To unsubscribe, e-mail: For additional commands, e-mail: