Source Code Cross Referenced for BeanInvokingActionFactory.java in  » Workflow-Engines » spring-webflow-1.0.4 » org » springframework » webflow » action » 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 » Workflow Engines » spring webflow 1.0.4 » org.springframework.webflow.action 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         * Copyright 2004-2007 the original author or authors.
03:         *
04:         * Licensed under the Apache License, Version 2.0 (the "License");
05:         * you may not use this file except in compliance with the License.
06:         * You may obtain a copy of the License at
07:         *
08:         *      http://www.apache.org/licenses/LICENSE-2.0
09:         *
10:         * Unless required by applicable law or agreed to in writing, software
11:         * distributed under the License is distributed on an "AS IS" BASIS,
12:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13:         * See the License for the specific language governing permissions and
14:         * limitations under the License.
15:         */
16:        package org.springframework.webflow.action;
17:
18:        import org.springframework.beans.factory.BeanFactory;
19:        import org.springframework.binding.convert.ConversionService;
20:        import org.springframework.binding.method.MethodKey;
21:        import org.springframework.binding.method.MethodSignature;
22:        import org.springframework.webflow.core.collection.AttributeMap;
23:        import org.springframework.webflow.execution.Action;
24:
25:        /**
26:         * A helper factory for {@link Action} instances that invoke methods on beans
27:         * managed in a Spring bean factory.
28:         * <p>
29:         * This factory encapsulates the logic required to take an arbitrary
30:         * <code>java.lang.Object</code> from a Spring bean factory and adapt a method
31:         * on it to the {@link Action} interface. If the bean you want to use is not
32:         * managed in a Spring bean factory, consider subclassing
33:         * {@link AbstractBeanInvokingAction} and using it directly.
34:         * 
35:         * @see AbstractBeanInvokingAction
36:         * 
37:         * @author Keith Donald
38:         */
39:        public class BeanInvokingActionFactory {
40:
41:            /**
42:             * Determines which result event factory should be used for each bean
43:             * invoking action created by this factory.
44:             */
45:            private ResultEventFactorySelector resultEventFactorySelector = new ResultEventFactorySelector();
46:
47:            /**
48:             * Returns the strategy for calculating the result event factory to
49:             * configure for each bean invoking action created by this factory.
50:             */
51:            public ResultEventFactorySelector getResultEventFactorySelector() {
52:                return resultEventFactorySelector;
53:            }
54:
55:            /**
56:             * Sets the strategy to calculate the result event factory to configure for
57:             * each bean invoking action created by this factory.
58:             */
59:            public void setResultEventFactorySelector(
60:                    ResultEventFactorySelector resultEventFactorySelector) {
61:                this .resultEventFactorySelector = resultEventFactorySelector;
62:            }
63:
64:            /**
65:             * Factory method that creates a bean invoking action, an adapter that
66:             * adapts a method on an abitrary {@link Object} to the {@link Action}
67:             * interface. This method is an atomic operation that returns a fully
68:             * initialized Action. It encapsulates the selection of the action
69:             * implementation as well as the action assembly.
70:             * @param beanId the id of the bean to be adapted to an Action instance
71:             * @param beanFactory the bean factory where the bean is managed
72:             * @param methodSignature the method to invoke on the bean when the action
73:             * is executed (required)
74:             * @param resultExposer the specification for what to do with the method
75:             * return value (optional)
76:             * @param conversionService the conversion service to be used to convert
77:             * method parameters (optional)
78:             * @param attributes attributes that may be used to affect the bean invoking
79:             * action's construction
80:             * @return the fully configured bean invoking action instance
81:             */
82:            public Action createBeanInvokingAction(String beanId,
83:                    BeanFactory beanFactory, MethodSignature methodSignature,
84:                    ActionResultExposer resultExposer,
85:                    ConversionService conversionService, AttributeMap attributes) {
86:                Object bean = beanFactory.getBean(beanId);
87:                AbstractBeanInvokingAction action = new LocalBeanInvokingAction(
88:                        methodSignature, bean);
89:                action.setMethodResultExposer(resultExposer);
90:                MethodKey methodKey = new MethodKey(bean.getClass(),
91:                        methodSignature.getMethodName(), methodSignature
92:                                .getParameters().getTypesArray());
93:                action.setResultEventFactory(resultEventFactorySelector
94:                        .forMethod(methodKey.getMethod()));
95:                action.setConversionService(conversionService);
96:                return action;
97:            }
98:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.