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


001:        /*
002:         * Created on 22 Jul 2006
003:         */
004:        package uk.org.ponder.rsf.state.scope;
005:
006:        import java.util.Map;
007:
008:        import org.springframework.beans.factory.BeanNameAware;
009:
010:        import uk.org.ponder.rsf.state.TokenStateHolder;
011:        import uk.org.ponder.stringutil.StringList;
012:
013:        /** Manages a set of beans within a named scope. The beans will be 
014:         * automatically preserved to the nominated TokenStateHolder at the end of
015:         * every action request, and restored at the beginning of every request.
016:         * 
017:         * The beans in storage will expire on the natural expiry of the TSH, or on
018:         * triggering of destruction through one of the <code>destroy</code> methods
019:         * on this bean, whichever is sooner.
020:         * @author Antranig Basman (antranig@caret.cam.ac.uk)
021:         *
022:         */
023:
024:        public class ScopedBeanManager implements  BeanDestroyer, BeanNameAware {
025:            public static final char SPEC_SPLIT_CHAR = '|';
026:            private String scopeName;
027:            private String copyPreservingBeans;
028:
029:            private TokenStateHolder tokenStateHolder;
030:            private Map destroyed;
031:            private boolean exclusive;
032:            private boolean alwaysPreserve;
033:
034:            private StringList copyPreservingBeanList;
035:            private StringList targetPreservingKeyList;
036:            private BeanDestroyer destroyer;
037:
038:            public void setDestroyedScopeMap(Map destroyed) {
039:                this .destroyed = destroyed;
040:            }
041:
042:            public void setBeanDestroyer(BeanDestroyer destroyer) {
043:                this .destroyer = destroyer;
044:            }
045:
046:            public void destroy() {
047:                destroyer.destroy();
048:
049:            }
050:
051:            public void setScopeName(String scopeName) {
052:                this .scopeName = scopeName;
053:            }
054:
055:            public String getScopeName() {
056:                return scopeName;
057:            }
058:
059:            /** Set to <code>true</code> if multiple requests are to be prevented
060:             * from accessing this scope simultaneously. A second request trying to
061:             * access the same scope will block in its alterationWrapper until 
062:             * the first has concluded. 
063:             */
064:            public void setExclusive(boolean exclusive) {
065:                this .exclusive = exclusive;
066:            }
067:
068:            public boolean getExclusive() {
069:                return exclusive;
070:            }
071:
072:            /** Set to <code>true</code> if this is a "bad" kind of scope (with the
073:             * potential to violate HTTP semantics) that requires to be preserved
074:             * on <code>RENDER</code> cycles as well as <code>ACTION</code> cycles.
075:             */
076:            public void setAlwaysPreserve(boolean alwaysPreserve) {
077:                this .alwaysPreserve = alwaysPreserve;
078:            }
079:
080:            public boolean getAlwaysPreserve() {
081:                return alwaysPreserve;
082:            }
083:
084:            public void setCopyPreservingBeans(String copyPreservingBeans) {
085:                StringList specs = StringList.fromString(copyPreservingBeans);
086:                if (copyPreservingBeans.indexOf(SPEC_SPLIT_CHAR) != -1) {
087:                    copyPreservingBeanList = new StringList();
088:                    targetPreservingKeyList = new StringList();
089:                    for (int i = 0; i < specs.size(); ++i) {
090:                        String spec = specs.stringAt(i);
091:                        int splitpos = spec.indexOf(SPEC_SPLIT_CHAR);
092:                        String bean = null, key = null;
093:                        if (splitpos == -1) {
094:                            bean = key = spec;
095:                        } else {
096:                            bean = spec.substring(0, splitpos);
097:                            key = spec.substring(splitpos + 1);
098:                        }
099:                        copyPreservingBeanList.add(bean);
100:                        targetPreservingKeyList.add(key);
101:                    }
102:                } else {
103:                    copyPreservingBeanList = specs;
104:                }
105:            }
106:
107:            public StringList getCopyPreservingBeanList() {
108:                return copyPreservingBeanList;
109:            }
110:
111:            public StringList getTargetPreservingKeyList() {
112:                return targetPreservingKeyList;
113:            }
114:
115:            public void setTokenStateHolder(TokenStateHolder tokenStateHolder) {
116:                this .tokenStateHolder = tokenStateHolder;
117:            }
118:
119:            public TokenStateHolder getTokenStateHolder() {
120:                return tokenStateHolder;
121:            }
122:
123:            public void setBeanName(String name) {
124:                scopeName = name;
125:            }
126:
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.