ks.server.processor
Class CommandProcessor

java.lang.Object
  |
  +--ks.server.processor.CommandProcessor

public class CommandProcessor
extends java.lang.Object

Standard processor of Commands. Provides stub interfaces for all command types. For an entity to process a particular command, subclass this class and provide the implementation.

The CommandProcessor is truly the central place where commands are sent. To process them, each method will speak to various managers in the server, such as the serverPluginManager, tableManager, and userManager.

Full Block component


Field Summary
protected  IOutput output
          CommandProcessor knows who can deliver output.
protected  java.util.ArrayList processors
          Processors currently registered.
protected  java.util.Vector provided
          provided set of interfaces.
protected  java.util.Vector required
          required set of interfaces.
 
Constructor Summary
CommandProcessor()
          CommandProcessor constructor must be available for Block.
 
Method Summary
 boolean activate()
          Activate does nothing.
 boolean connect(IBlock block, java.lang.String interfaceName)
          Required interfaces will be ProcessCommand entities and single IOutput We will add to our set of processors, and set Output.
 void deactivate()
          Not much to do here.
 java.util.Enumeration getProvided()
          We expose ProcessCommand interface.
 java.util.Enumeration getRequired()
          We expose ProcessCommand and IOutput required interfaces.
 boolean process(java.lang.String userName, Command c)
          Deliver command to appropriate handlers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

output

protected IOutput output
CommandProcessor knows who can deliver output.


processors

protected java.util.ArrayList processors
Processors currently registered.


provided

protected java.util.Vector provided
provided set of interfaces.


required

protected java.util.Vector required
required set of interfaces.

Constructor Detail

CommandProcessor

public CommandProcessor()
CommandProcessor constructor must be available for Block.

Method Detail

process

public boolean process(java.lang.String userName,
                       Command c)
Deliver command to appropriate handlers.

If no processor is registered for the specific Command type, then false is returned, otherwise true.

Parameters:
c - ks.common.command.Command

activate

public boolean activate()
                 throws java.lang.Exception
Activate does nothing.

java.lang.Exception
See Also:
edu.wpi.cs.cs509.cmi.interfaces.IBlock#activate()

connect

public boolean connect(IBlock block,
                       java.lang.String interfaceName)
                throws java.lang.Exception
Required interfaces will be ProcessCommand entities and single IOutput We will add to our set of processors, and set Output.

java.lang.Exception
See Also:
edu.wpi.cs.cs509.cmi.interfaces.IBlock#connect(edu.wpi.cs.cs509.cmi.interfaces.IBlock, java.lang.String)

deactivate

public void deactivate()
                throws java.lang.Exception
Not much to do here.

java.lang.Exception
See Also:
edu.wpi.cs.cs509.cmi.interfaces.IBlock#deactivate()

getProvided

public java.util.Enumeration getProvided()
We expose ProcessCommand interface.

See Also:
edu.wpi.cs.cs509.cmi.interfaces.IBlock#getProvided()

getRequired

public java.util.Enumeration getRequired()
We expose ProcessCommand and IOutput required interfaces.

See Also:
edu.wpi.cs.cs509.cmi.interfaces.IBlock#getRequired()