Java Doc for DispatchLookupCommand.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
      org.apache.commons.chain.generic.DispatchLookupCommand

DispatchLookupCommand
public class DispatchLookupCommand extends LookupCommand implements Filter(Code)

This command combines elements of the LookupCommand with the DispatchCommand . Look up a specified Command (which could also be a org.apache.commons.chain.Chain ) in a org.apache.commons.chain.Catalog , and delegate execution to it. Introspection is used to lookup the appropriate method to delegate execution to. 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.

The name of the method to be called can be specified either directly (via the method property) or indirectly (via the methodKey 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:
   Sean Schofield
version:
   $Revision: 411876 $
since:
   Chain 1.1



Constructor Summary
public  DispatchLookupCommand()
     Create an instance with an unspecified catalogFactory property.
public  DispatchLookupCommand(CatalogFactory factory)
     Create an instance and initialize the catalogFactory property to given factory.

Method Summary
public  booleanexecute(Context context)
    
protected  Object[]getArguments(Context context)
     Get the arguments to be passed into the dispatch method. Default implementation simply returns the context which was passed in, but subclasses could use this to wrap the context in some other type, or extract key values from the context to pass in.
public  StringgetMethod()
     Return the method name.
public  StringgetMethodKey()
     Return the Context key for the method name.
protected  Class[]getSignature()
    

Return a Class[] describing the expected signature of the method.

public  voidsetMethod(String method)
     Set the method name.
public  voidsetMethodKey(String methodKey)
     Set the Context key for the method name.


Constructor Detail
DispatchLookupCommand
public DispatchLookupCommand()(Code)
Create an instance with an unspecified catalogFactory property. This property can be set later using setProperty, or if it is not set, the static singleton instance from CatalogFactory.getInstance() will be used.



DispatchLookupCommand
public DispatchLookupCommand(CatalogFactory factory)(Code)
Create an instance and initialize the catalogFactory property to given factory.
Parameters:
  factory - The Catalog Factory.




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

Look up the specified command, and (if found) execute it.


Parameters:
  context - The context for this request the result of executing the looked-up command's method, orfalse if no command is found.
throws:
  Exception - if no such Command can be found and theoptional property is set to false



getArguments
protected Object[] getArguments(Context context)(Code)
Get the arguments to be passed into the dispatch method. Default implementation simply returns the context which was passed in, but subclasses could use this to wrap the context in some other type, or extract key values from the context to pass in. The length and types of values returned by this must coordinate with the return value of getSignature()
Parameters:
  context - The context associated with the request the method arguments to be used



getMethod
public String getMethod()(Code)
Return the method name. The method name.



getMethodKey
public String getMethodKey()(Code)
Return the Context key for the method name. The Context key for the method name.



getSignature
protected Class[] getSignature()(Code)

Return a Class[] describing the expected signature of the method. The default is a signature that just accepts the command's Context . The method can be overidden to provide a different method signature.

the expected method signature




setMethod
public void setMethod(String method)(Code)
Set the method name.
Parameters:
  method - The method name.



setMethodKey
public void setMethodKey(String methodKey)(Code)
Set the Context key for the method name.
Parameters:
  methodKey - The Context key for the method name.



Methods inherited from org.apache.commons.chain.generic.LookupCommand
public boolean execute(Context context) throws Exception(Code)(Java Doc)
public CatalogFactory getCatalogFactory()(Code)(Java Doc)
public String getCatalogName()(Code)(Java Doc)
protected Command getCommand(Context context)(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public String getNameKey()(Code)(Java Doc)
public boolean isIgnoreExecuteResult()(Code)(Java Doc)
public boolean isIgnorePostprocessResult()(Code)(Java Doc)
public boolean isOptional()(Code)(Java Doc)
public boolean postprocess(Context context, Exception exception)(Code)(Java Doc)
public void setCatalogFactory(CatalogFactory catalogFactory)(Code)(Java Doc)
public void setCatalogName(String catalogName)(Code)(Java Doc)
public void setIgnoreExecuteResult(boolean ignoreReturn)(Code)(Java Doc)
public void setIgnorePostprocessResult(boolean ignorePostprocessResult)(Code)(Java Doc)
public void setName(String name)(Code)(Java Doc)
public void setNameKey(String nameKey)(Code)(Java Doc)
public void setOptional(boolean optional)(Code)(Java Doc)

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.