Java Doc for DispatchCommand.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.DispatchCommand

DispatchCommand
abstract public class DispatchCommand implements Command(Code)
An abstract base command which uses introspection to look up a method to execute. For use by developers who prefer to group related functionality into a single class rather than an inheritance family.
since:
   Chain 1.1


Field Summary
final protected static  Class[]DEFAULT_SIGNATURE
     The base implementation expects dispatch methods to take a Context as their only argument.


Method Summary
protected  booleanevaluateResult(Object o)
     Evaluate the result of the method invocation as a boolean value.
public  booleanexecute(Context context)
     Look up the method specified by either "method" or "methodKey" and invoke it, returning a boolean value as interpreted by evaluateResult.
Parameters:
  context - The Context to be processed by this Command.
protected  MethodextractMethod(Context context)
     Extract the dispatch method.
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.

Field Detail
DEFAULT_SIGNATURE
final protected static Class[] DEFAULT_SIGNATURE(Code)
The base implementation expects dispatch methods to take a Context as their only argument.





Method Detail
evaluateResult
protected boolean evaluateResult(Object o)(Code)
Evaluate the result of the method invocation as a boolean value. Base implementation expects that the invoked method returns boolean true/false, but subclasses might implement other interpretations.
Parameters:
  o - The result of the methid execution The evaluated result/



execute
public boolean execute(Context context) throws Exception(Code)
Look up the method specified by either "method" or "methodKey" and invoke it, returning a boolean value as interpreted by evaluateResult.
Parameters:
  context - The Context to be processed by this Command. the result of method being dispatched to.
throws:
  IllegalStateException - if neither 'method' nor 'methodKey' properties are defined
throws:
  Exception - if any is thrown by the invocation. Note that if invoking the methodresults in an InvocationTargetException, the cause of that exception is thrown instead ofthe exception itself, unless the cause is an Error or other Throwablewhich is not an Exception.



extractMethod
protected Method extractMethod(Context context) throws NoSuchMethodException(Code)
Extract the dispatch method. The base implementation uses the command's method property as the name of a method to look up, or, if that is not defined, looks up the the method name in the Context using the methodKey.
Parameters:
  context - The Context being processed by this Command. The method to execute
throws:
  NoSuchMethodException - if no method can be found under the specified name.
throws:
  NullPointerException - if no methodName cannot be determined



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 being processed by this Command. The method arguments.



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 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 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.