Source Code Cross Referenced for RSFRenderHandler.java in  » Web-Framework » RSF » uk » org » ponder » rsf » processor » 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 » Web Framework » RSF » uk.org.ponder.rsf.processor 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Nov 20, 2005
003:         */
004:        package uk.org.ponder.rsf.processor;
005:
006:        import uk.org.ponder.messageutil.TargettedMessageList;
007:        import uk.org.ponder.rsf.componentprocessor.ViewProcessor;
008:        import uk.org.ponder.rsf.preservation.StatePreservationManager;
009:        import uk.org.ponder.rsf.renderer.ViewRender;
010:        import uk.org.ponder.rsf.state.ErrorStateManager;
011:        import uk.org.ponder.rsf.view.View;
012:        import uk.org.ponder.rsf.view.support.ViewGenerator;
013:        import uk.org.ponder.rsf.viewstate.ViewParameters;
014:        import uk.org.ponder.streamutil.write.PrintOutputStream;
015:        import uk.org.ponder.util.RunnableInvoker;
016:
017:        /**
018:         * Controls the operation of a "render cycle" of RSF. Locates component
019:         * producers, generates the view, performs fixups, and invokes the renderer. Any
020:         * errors through the construction of this bean are passed back through GetHandler.
021:         * 
022:         * @author Antranig Basman (antranig@caret.cam.ac.uk)
023:         * 
024:         */
025:        public class RSFRenderHandler implements  RenderHandler {
026:            // all request-scope dependencies
027:            private ViewGenerator viewgenerator;
028:            private ErrorStateManager errorstatemanager;
029:            private RunnableInvoker getwrapper;
030:            private ViewProcessor viewprocessor;
031:            private ViewParameters viewparams;
032:
033:            private StatePreservationManager presmanager;
034:            private ViewRender viewrender;
035:            private TargettedMessageList targettedMessageList;
036:            private boolean enableDebugRendering;
037:
038:            public void setTargettedMessageList(
039:                    TargettedMessageList targettedMessageList) {
040:                this .targettedMessageList = targettedMessageList;
041:            }
042:
043:            public void setViewGenerator(ViewGenerator viewgenerator) {
044:                this .viewgenerator = viewgenerator;
045:            }
046:
047:            public void setErrorStateManager(ErrorStateManager errorstatemanager) {
048:                this .errorstatemanager = errorstatemanager;
049:            }
050:
051:            public void setAlterationWrapper(RunnableInvoker getwrapper) {
052:                this .getwrapper = getwrapper;
053:            }
054:
055:            public void setViewProcessor(ViewProcessor viewprocessor) {
056:                this .viewprocessor = viewprocessor;
057:            }
058:
059:            public void setViewParameters(ViewParameters viewparams) {
060:                this .viewparams = viewparams;
061:            }
062:
063:            public void setStatePreservationManager(
064:                    StatePreservationManager presmanager) {
065:                this .presmanager = presmanager;
066:            }
067:
068:            public void setEnableDebugRendering(boolean enableDebugRendering) {
069:                this .enableDebugRendering = enableDebugRendering;
070:            }
071:
072:            public void setViewRender(ViewRender viewrender) {
073:                this .viewrender = viewrender;
074:            }
075:
076:            // Since this is a request-scope bean, there is no problem letting the
077:            // returned view from the getwrapper escape into this member.
078:            private View view;
079:
080:            /**
081:             * The beanlocator is passed in to allow the late location of the ViewRender
082:             * bean which needs to occur in a controlled exception context.
083:             */
084:            public void handle(PrintOutputStream pos) {
085:                // *outside* alteration wrapper so that AW may be BeanFetchBracketed.
086:                presmanager.scopeRestore();
087:                getwrapper.invokeRunnable(new Runnable() {
088:                    public void run() {
089:                        if (viewparams.flowtoken != null) {
090:                            presmanager.restore(viewparams.flowtoken,
091:                                    viewparams.endflow != null);
092:                        }
093:                        // this must now be AFTER restoration since the templateexpander may
094:                        // access the model. Shucks!!
095:                        view = viewgenerator.generateView();
096:                        // even a "read" from the model may want to cause a scope to be allocated.
097:                        // it will have to be the user's responsibility not to violate idempotency.
098:                        presmanager.scopePreserve();
099:                        viewprocessor.setView(view);
100:                        view = viewprocessor.getProcessedView();
101:                    }
102:                });
103:                viewrender.setMessages(targettedMessageList);
104:                // TODO: globaltargetid detection has not been investigated for a while
105:                viewrender
106:                        .setGlobalMessageTarget(errorstatemanager.errorstate.globaltargetid);
107:                viewrender.setView(view);
108:                viewrender.setDebugRender(enableDebugRendering
109:                        && viewparams.debugrender != null);
110:                viewrender.render(pos);
111:            }
112:
113:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.