Java Doc for LookupCommand.java in  » Library » Apache-commons-chain-1.1-src » org » apache » commons » chain » generic » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache commons chain 1.1 src » org.apache.commons.chain.generic 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.chain.generic.LookupCommand

All known Subclasses:   org.apache.commons.chain.generic.DispatchLookupCommand,
LookupCommand
public class LookupCommand implements Filter(Code)

Look up a specified Command (which could also be a org.apache.commons.chain.Chain ) in a Catalog , and delegate execution to it. If the delegated-to Command is also a Filter , its postprocess() method will also be invoked at the appropriate time.

The name of the Command can be specified either directly (via the name property) or indirectly (via the nameKey property). Exactly one of these must be set.

If the optional property is set to true, failure to find the specified command in the specified catalog will be silently ignored. Otherwise, a lookup failure will trigger an IllegalArgumentException.


author:
   Craig R. McClanahan
version:
   $Revision: 411876 $ $Date: 2006-06-05 19:02:19 +0100 (Mon, 05 Jun 2006) $



Constructor Summary
public  LookupCommand()
     Create an instance, setting its catalogFactory property to the value of CatalogFactory.getInstance().
public  LookupCommand(CatalogFactory factory)
    

Method Summary
public  booleanexecute(Context context)
    

Look up the specified command, and (if found) execute it. Unless ignoreExecuteResult is set to true, return the result of executing the found command.

public  CatalogFactorygetCatalogFactory()
     Return the CatalogFactory from which lookups will be performed.
public  StringgetCatalogName()
    
protected  CommandgetCommand(Context context)
    
public  StringgetName()
    
public  StringgetNameKey()
    
public  booleanisIgnoreExecuteResult()
    

Return true if this command should ignore the return value from executing the looked-up command.

public  booleanisIgnorePostprocessResult()
    

Return true if this command is a Filter and should ignore the return value from executing the looked-up Filter's postprocess() method.

public  booleanisOptional()
    
public  booleanpostprocess(Context context, Exception exception)
    

If the executed command was itself a Filter , call the postprocess() method of that Filter as well.


Parameters:
  context - The context for this request
Parameters:
  exception - Any Exception thrown by command execution the result of executing the postprocess methodof the looked-up command, unless ignorePostprocessResult istrue.
public  voidsetCatalogFactory(CatalogFactory catalogFactory)
    
public  voidsetCatalogName(String catalogName)
    
public  voidsetIgnoreExecuteResult(boolean ignoreReturn)
    
public  voidsetIgnorePostprocessResult(boolean ignorePostprocessResult)
    
public  voidsetName(String name)
    
public  voidsetNameKey(String nameKey)
    
public  voidsetOptional(boolean optional)
    


Constructor Detail
LookupCommand
public LookupCommand()(Code)
Create an instance, setting its catalogFactory property to the value of CatalogFactory.getInstance().
since:
   Chain 1.1



LookupCommand
public LookupCommand(CatalogFactory factory)(Code)
Create an instance and initialize the catalogFactory property to given factory/
Parameters:
  factory - The Catalog Factory.
since:
   Chain 1.1




Method Detail
execute
public boolean execute(Context context) throws Exception(Code)

Look up the specified command, and (if found) execute it. Unless ignoreExecuteResult is set to true, return the result of executing the found command. If no command is found, return false, unless the optional property is false, in which case an IllegalArgumentException will be thrown.


Parameters:
  context - The context for this request
exception:
  IllegalArgumentException - if no such Commandcan be found and the optional property is setto false the result of executing the looked-up command, orfalse if no command is found or if the commandis found but the ignoreExecuteResult property of thisinstance is true
throws:
  Exception - if and error occurs in the looked-up Command.



getCatalogFactory
public CatalogFactory getCatalogFactory()(Code)
Return the CatalogFactory from which lookups will be performed. The Catalog factory.
since:
   Chain 1.1



getCatalogName
public String getCatalogName()(Code)

Return the name of the Catalog to be searched, or null to search the default Catalog .

The Catalog name.



getCommand
protected Command getCommand(Context context)(Code)

Return the Command instance to be delegated to.


Parameters:
  context - Context for this request The looked-up Command.
exception:
  IllegalArgumentException - if no such Commandcan be found and the optional property is setto false



getName
public String getName()(Code)

Return the name of the Command that we will look up and delegate execution to.

The name of the Command.



getNameKey
public String getNameKey()(Code)

Return the context attribute key under which the Command name is stored.

The context key of the Command.



isIgnoreExecuteResult
public boolean isIgnoreExecuteResult()(Code)

Return true if this command should ignore the return value from executing the looked-up command. Defaults to false, which means that the return result of executing this lookup will be whatever is returned from that command.

true if result of the looked up Commandshould be ignored.
since:
   Chain 1.1



isIgnorePostprocessResult
public boolean isIgnorePostprocessResult()(Code)

Return true if this command is a Filter and should ignore the return value from executing the looked-up Filter's postprocess() method. Defaults to false, which means that the return result of executing this lookup will be whatever is returned from that Filter.

true if result of the looked up Filter'spostprocess() method should be ignored.
since:
   Chain 1.1



isOptional
public boolean isOptional()(Code)

Return true if locating the specified command is optional.

true if the Command is optional.



postprocess
public boolean postprocess(Context context, Exception exception)(Code)

If the executed command was itself a Filter , call the postprocess() method of that Filter as well.


Parameters:
  context - The context for this request
Parameters:
  exception - Any Exception thrown by command execution the result of executing the postprocess methodof the looked-up command, unless ignorePostprocessResult istrue. If no command is found, return false,unless the optional property is false, in whichcase IllegalArgumentException will be thrown.



setCatalogFactory
public void setCatalogFactory(CatalogFactory catalogFactory)(Code)

Set the CatalogFactory from which lookups will be performed.


Parameters:
  catalogFactory - The Catalog Factory.
since:
   Chain 1.1



setCatalogName
public void setCatalogName(String catalogName)(Code)

Set the name of the Catalog to be searched, or null to search the default Catalog .


Parameters:
  catalogName - The new Catalog name or null



setIgnoreExecuteResult
public void setIgnoreExecuteResult(boolean ignoreReturn)(Code)

Set the rules for whether or not this class will ignore or pass through the value returned from executing the looked up command.

If you are looking up a chain which may be "aborted" and you do not want this class to stop chain processing, then this value should be set to true


Parameters:
  ignoreReturn - true if result of thelooked up Command should be ignored.
since:
   Chain 1.1



setIgnorePostprocessResult
public void setIgnorePostprocessResult(boolean ignorePostprocessResult)(Code)

Set the rules for whether or not this class will ignore or pass through the value returned from executing the looked up Filter's postprocess() method.

If you are looking up a Filter which may be "aborted" and you do not want this class to stop chain processing, then this value should be set to true


Parameters:
  ignorePostprocessResult - true if result of thelooked up Filter's postprocess() method should be ignored.
since:
   Chain 1.1



setName
public void setName(String name)(Code)

Set the name of the Command that we will look up and delegate execution to.


Parameters:
  name - The new command name



setNameKey
public void setNameKey(String nameKey)(Code)

Set the context attribute key under which the Command name is stored.


Parameters:
  nameKey - The new context attribute key



setOptional
public void setOptional(boolean optional)(Code)

Set the optional flag for finding the specified command.


Parameters:
  optional - The new optional flag



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.