com.mooapi.server.handler
Class ThreadedCommandFilter<C extends Command>

java.lang.Object
  extended by com.mooapi.server.handler.ThreadedCommandFilter<C>
All Implemented Interfaces:
CommandProcessor<C>

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.

Author:
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

ThreadedCommandFilter

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

process

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

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


Copyright © 2009. All Rights Reserved.