org.apache.shale.clay.utils
Class PluggableLookupCommand

java.lang.Object
  extended by org.apache.commons.chain.generic.LookupCommand
      extended by org.apache.shale.clay.utils.PluggableLookupCommand
All Implemented Interfaces:
Command, Filter

public class PluggableLookupCommand
extends LookupCommand

This chains class performs a check to verify the catalog exists. If the catalog doesn't exist, it returns true if the optional property in the super class is true. If the catalog is not found and the command is not optional, it returns a false value. Otherwise, if the catalog exists, the super implementation is invoked. The name of the command can be a value binding expression. The value is evaluated if it contains an expression and the resolved command is invoked.


Field Summary
 
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
 
Constructor Summary
PluggableLookupCommand()
           
 
Method Summary
 boolean execute(Context context)
          Adds an additional check to determine if the catalog name is loaded.
 
Methods inherited from class org.apache.commons.chain.generic.LookupCommand
getCatalogFactory, getCatalogName, getCommand, getName, getNameKey, isIgnoreExecuteResult, isIgnorePostprocessResult, isOptional, postprocess, setCatalogFactory, setCatalogName, setIgnoreExecuteResult, setIgnorePostprocessResult, setName, setNameKey, setOptional
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluggableLookupCommand

public PluggableLookupCommand()
Method Detail

execute

public boolean execute(Context context)
                throws Exception

Adds an additional check to determine if the catalog name is loaded. If loaded, the super implementation is invoked. Otherwise, the chain continues if the command is optional.

Specified by:
execute in interface Command
Overrides:
execute in class LookupCommand
Parameters:
context - chains context
Returns:
true if the chain is done
Throws:
Exception - up the calling chain


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.