Source Code Cross Referenced for ApplicationSetupBean.java in  » Web-Framework » jWic » de » jwic » base » 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 » jWic » de.jwic.base 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005 jWic group (http://www.jwic.de)
003:         * 
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         *
016:         * de.jwic.base.ApplicationSetupBean
017:         * Created on 14.04.2005
018:         * $Id: ApplicationSetupBean.java,v 1.2 2006/08/14 09:34:58 lordsam Exp $
019:         */
020:        package de.jwic.base;
021:
022:        import java.lang.reflect.Constructor;
023:        import java.util.Properties;
024:
025:        /**
026:         * Bean-style application setup.
027:         * @author Florian Lippisch
028:         * @version $Revision: 1.2 $
029:         */
030:        public class ApplicationSetupBean implements  IApplicationSetup {
031:
032:            private static final long serialVersionUID = 1L;
033:
034:            private String name = null;
035:            private String classname = null;
036:            private String rootControlName = "root";
037:            private String rootControlClassName = null;
038:            private boolean serializable = true;
039:            private boolean singleSession = false;
040:            private boolean requireAuthentication = false;
041:            private boolean useAjaxRendering = true;
042:            private Properties properties = new Properties();
043:
044:            /* (non-Javadoc)
045:             * @see de.jwic.base.IApplicationSetup#getName()
046:             */
047:            public String getName() {
048:                return name;
049:            }
050:
051:            /* (non-Javadoc)
052:             * @see de.jwic.base.IApplicationSetup#getRootControlName()
053:             */
054:            public String getRootControlName() {
055:                return rootControlName;
056:            }
057:
058:            /* (non-Javadoc)
059:             * @see de.jwic.base.IApplicationSetup#createRootControl()
060:             */
061:            public IApplication createApplication() {
062:
063:                try {
064:                    if (classname != null) {
065:                        return (IApplication) Class.forName(classname)
066:                                .newInstance();
067:                    }
068:                    // create a dummy application that creates the root class. This is
069:                    // for compatibility with jWic v2.x.
070:                    IApplication app = new Application() {
071:                        private static final long serialVersionUID = 1L;
072:
073:                        public Control createRootControl(
074:                                IControlContainer container) {
075:                            try {
076:                                Class clazz = Class
077:                                        .forName(rootControlClassName);
078:                                Control control;
079:                                Constructor cstr = clazz
080:                                        .getConstructor(new Class[] {
081:                                                IControlContainer.class,
082:                                                String.class });
083:                                control = (Control) cstr
084:                                        .newInstance(new Object[] { container,
085:                                                rootControlName });
086:                                return control;
087:                            } catch (Exception e) {
088:                                throw new ControlNotAvailableException(
089:                                        "Can not create instance of '"
090:                                                + rootControlClassName
091:                                                + "'. Cause: " + e, e);
092:                            }
093:                        }
094:                    };
095:                    return app;
096:                } catch (Exception e) {
097:                    throw new JWicException("Can not create application '"
098:                            + classname + "':" + e, e);
099:                }
100:            }
101:
102:            /* (non-Javadoc)
103:             * @see de.jwic.base.IApplicationSetup#isSerializable()
104:             */
105:            public boolean isSerializable() {
106:                return serializable;
107:            }
108:
109:            /* (non-Javadoc)
110:             * @see de.jwic.base.IApplicationSetup#isSingleSession()
111:             */
112:            public boolean isSingleSession() {
113:                return singleSession;
114:            }
115:
116:            /* (non-Javadoc)
117:             * @see de.jwic.base.IApplicationSetup#isRequireAuthentication()
118:             */
119:            public boolean isRequireAuthentication() {
120:                return requireAuthentication;
121:            }
122:
123:            /* (non-Javadoc)
124:             * @see de.jwic.base.IApplicationSetup#getProperty(java.lang.String)
125:             */
126:            public String getProperty(String key) {
127:                if (properties == null) {
128:                    return null;
129:                }
130:                return properties.getProperty(key);
131:            }
132:
133:            /**
134:             * @return Returns the properties.
135:             */
136:            public Properties getProperties() {
137:                return properties;
138:            }
139:
140:            /**
141:             * @param properties The properties to set.
142:             */
143:            public void setProperties(Properties properties) {
144:                this .properties = properties;
145:            }
146:
147:            public void setProperty(String key, String value) {
148:                if (properties == null) {
149:                    properties = new Properties();
150:                }
151:                properties.setProperty(key, value);
152:            }
153:
154:            /**
155:             * @return Returns the rootControlClassName.
156:             */
157:            public String getRootControlClassName() {
158:                return rootControlClassName;
159:            }
160:
161:            /**
162:             * @param rootControlClassName The rootControlClassName to set.
163:             */
164:            public void setRootControlClassName(String rootControlClassName) {
165:                this .rootControlClassName = rootControlClassName;
166:            }
167:
168:            /**
169:             * @param name The name to set.
170:             */
171:            public void setName(String name) {
172:                this .name = name;
173:            }
174:
175:            /**
176:             * @param requireAuthentication The requireAuthentication to set.
177:             */
178:            public void setRequireAuthentication(boolean requireAuthentication) {
179:                this .requireAuthentication = requireAuthentication;
180:            }
181:
182:            /**
183:             * @param rootControlName The rootControlName to set.
184:             */
185:            public void setRootControlName(String rootControlName) {
186:                this .rootControlName = rootControlName;
187:            }
188:
189:            /**
190:             * @param serializable The serializable to set.
191:             */
192:            public void setSerializable(boolean serializable) {
193:                this .serializable = serializable;
194:            }
195:
196:            /**
197:             * @param singleSession The singleSession to set.
198:             */
199:            public void setSingleSession(boolean singleSession) {
200:                this .singleSession = singleSession;
201:            }
202:
203:            /* (non-Javadoc)
204:             * @see de.jwic.base.IApplicationSetup#isUseAjaxRendering()
205:             */
206:            public boolean isUseAjaxRendering() {
207:                return useAjaxRendering;
208:            }
209:
210:            /**
211:             * @param useAjaxRendering The useAjaxRendering to set.
212:             */
213:            public void setUseAjaxRendering(boolean useAjaxRendering) {
214:                this .useAjaxRendering = useAjaxRendering;
215:            }
216:
217:            /**
218:             * Get the classname of the IApplication implementation.
219:             * @return Returns the classname.
220:             */
221:            public String getClassname() {
222:                return classname;
223:            }
224:
225:            /**
226:             * Set the classname of the IApplication implementation.
227:             * @param classname The classname to set.
228:             */
229:            public void setClassname(String classname) {
230:                this.classname = classname;
231:            }
232:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.