com.itmusings.owiz.impl
Class Router<InputType>

java.lang.Object
  extended by com.itmusings.owiz.impl.CommandBase<InputType>
      extended by com.itmusings.owiz.impl.Router<InputType>
All Implemented Interfaces:
AttachableCommand<InputType>, Command<InputType>
Direct Known Subclasses:
OgnlRouter

public abstract class Router<InputType>
extends CommandBase<InputType>
implements Command<InputType>, AttachableCommand<InputType>

A router is a command that executes one of several commands based on a routing string. The computation of the routing string is left to a sub class and hence this is an abstract class.

Author:
Raja Shankar Kolluru

Field Summary
protected  Map<String,CommandDescriptor<InputType>> commandsMap
           
static String DEFAULT
           
protected  CommandDescriptor<InputType> defaultCommandDescriptor
           
static String ROUTE
           
 
Constructor Summary
Router()
           
 
Method Summary
 void attachCommand(AttachmentDescriptor<InputType> attachmentDescriptor, CommandDescriptor<InputType> command)
           
protected abstract  String computeRoutingString(InputType context)
           
 void doExecute(InputType context)
           
 
Methods inherited from class com.itmusings.owiz.impl.CommandBase
execute, getConfigValue, postprocess, preprocess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROUTE

public static final String ROUTE
See Also:
Constant Field Values

DEFAULT

public static final String DEFAULT
See Also:
Constant Field Values

commandsMap

protected Map<String,CommandDescriptor<InputType>> commandsMap

defaultCommandDescriptor

protected CommandDescriptor<InputType> defaultCommandDescriptor
Constructor Detail

Router

public Router()
Method Detail

attachCommand

public void attachCommand(AttachmentDescriptor<InputType> attachmentDescriptor,
                          CommandDescriptor<InputType> command)
Specified by:
attachCommand in interface AttachableCommand<InputType>

doExecute

public void doExecute(InputType context)
               throws Exception
Specified by:
doExecute in class CommandBase<InputType>
Throws:
Exception

computeRoutingString

protected abstract String computeRoutingString(InputType context)
                                        throws Exception
Throws:
Exception


Copyright © 2010 ITMUSINGS. All Rights Reserved.