Class ThreadedCommandFilter<C extends Command>

  extended by com.mooapi.server.handler.ThreadedCommandFilter<C>
All Implemented Interfaces:

public class ThreadedCommandFilter<C extends Command>
extends java.lang.Object
implements CommandProcessor<C>

This class implements a threaded filtering command processor. When a command is passed to process(com.mooapi.server.MooConnection, com.mooapi.common.command.Command), it is added to an internal queue. A worker thread continuously consumes commands from the queue, passsing them through a supplied filter, then passing them to the next CommandProcessor when they pass through the filter. The filter may modify or block the commands.

Steve Taylor
See Also:
CommandFilter}, {@link CommandProcessor}.

Constructor Summary
ThreadedCommandFilter(CommandFilter commandFilter, CommandProcessor nextCommandProcessor, int priority)
Method Summary
 void process(MooConnection source, C command)
          Process the specified command.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ThreadedCommandFilter(CommandFilter commandFilter,
                             CommandProcessor nextCommandProcessor,
                             int priority)
Method Detail


public void process(MooConnection source,
                    C command)
Process the specified command.

Specified by:
process in interface CommandProcessor<C extends Command>
command - The specified command.
source - The connection sending/receiving the command.

Copyright © 2009. All Rights Reserved.