Source Code Cross Referenced for QuickServerConfig.java in  » Net » QuickServer » org » quickserver » util » xmlreader » 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 » Net » QuickServer » org.quickserver.util.xmlreader 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of the QuickServer library 
003:         * Copyright (C) 2003-2005 QuickServer.org
004:         *
005:         * Use, modification, copying and distribution of this software is subject to
006:         * the terms and conditions of the GNU Lesser General Public License. 
007:         * You should have received a copy of the GNU LGP License along with this 
008:         * library; if not, you can download a copy from <http://www.quickserver.org/>.
009:         *
010:         * For questions, suggestions, bug-reports, enhancement-requests etc.
011:         * visit http://www.quickserver.org
012:         *
013:         */
014:
015:        package org.quickserver.util.xmlreader;
016:
017:        import org.quickserver.net.server.QuickServer;
018:
019:        /**
020:         * This class encapsulate the configuration of QuickServer.
021:         * <p>
022:         * This is used by {@link QuickServer#configQuickServer} and
023:         * {@link QuickServer#initService} method to initialise 
024:         * QuickServer. 
025:         * </p>
026:         * @author Akshathkumar Shetty
027:         * @since 1.2
028:         */
029:        public class QuickServerConfig extends BasicServerConfig {
030:
031:            private QSAdminServerConfig qSAdminServerConfig;
032:            private DBObjectPoolConfig dDObjectPoolConfig;
033:            private ApplicationConfiguration applicationConfiguration;
034:            private InitServerHooks initServerHooks;
035:
036:            private String securityManagerClass = null;
037:            private String configFile = null;
038:            private String applicationJarPath = null;
039:
040:            public QuickServerConfig() {
041:                setName("QuickServer v" + QuickServer.getVersion());
042:            }
043:
044:            /**
045:             * Sets the QSAdminServer configuration.
046:             * XML Tag: &lt;qsadmin-server&gt;&lt;/qsadmin-server&gt;
047:             */
048:            public void setQSAdminServerConfig(QSAdminServerConfig config) {
049:                qSAdminServerConfig = config;
050:            }
051:
052:            /**
053:             * Returns QSAdminServer configuration.
054:             */
055:            public QSAdminServerConfig getQSAdminServerConfig() {
056:                return qSAdminServerConfig;
057:            }
058:
059:            /**
060:             * Sets the DBObjectPoolConfig
061:             * XML Tag: &lt;object-pool&gt;&lt;/object-pool&gt;
062:             * @since 1.3
063:             */
064:            public void setDBObjectPoolConfig(
065:                    DBObjectPoolConfig dDObjectPoolConfig) {
066:                this .dDObjectPoolConfig = dDObjectPoolConfig;
067:            }
068:
069:            /**
070:             * Returns DBObjectPoolConfig
071:             * @since 1.3
072:             */
073:            public DBObjectPoolConfig getDBObjectPoolConfig() {
074:                return dDObjectPoolConfig;
075:            }
076:
077:            /**
078:             * Sets the Application Configuration. This can be used by application to 
079:             * store its configuration information.
080:             * XML Tag: &lt;application-configuration&gt;&lt;/application-configuration&gt;
081:             * @since 1.3.2
082:             */
083:            public void setApplicationConfiguration(
084:                    ApplicationConfiguration applicationConfiguration) {
085:                this .applicationConfiguration = applicationConfiguration;
086:            }
087:
088:            /**
089:             * Returns ApplicationConfiguration
090:             * @since 1.3.2
091:             */
092:            public ApplicationConfiguration getApplicationConfiguration() {
093:                return applicationConfiguration;
094:            }
095:
096:            /**
097:             * Sets the SecurityManager class
098:             * XML Tag: &lt;security-manager-class&gt;&lt;/security-manager-class&gt;
099:             * @param securityManagerClass className the fully qualified name of the 
100:             * class that extends {@link java.lang.SecurityManager}.
101:             * @see #getSecurityManagerClass
102:             * @since 1.3.3
103:             */
104:            public void setSecurityManagerClass(String securityManagerClass) {
105:                if (securityManagerClass != null)
106:                    this .securityManagerClass = securityManagerClass;
107:            }
108:
109:            /**
110:             * Returns the SecurityManager class
111:             * @see #setSecurityManagerClass
112:             * @since 1.3.3
113:             */
114:            public String getSecurityManagerClass() {
115:                return securityManagerClass;
116:            }
117:
118:            /**
119:             * Sets the file path of the file that loaded the config from.
120:             * @since 1.3.3
121:             */
122:            protected void setConfigFile(String fileName) {
123:                configFile = fileName;
124:            }
125:
126:            /**
127:             * Returns the file path of the file that loaded the configuration file.
128:             * @since 1.3.3
129:             */
130:            public String getConfigFile() {
131:                return configFile;
132:            }
133:
134:            /**
135:             * Sets the applications jar/s path. This can be either absolute or
136:             * relative(to config file) path to the jar file or the directory containing the jars 
137:             * needed by the application.
138:             * @see #getApplicationJarPath
139:             * @since 1.3.3
140:             */
141:            public void setApplicationJarPath(String applicationJarPath) {
142:                this .applicationJarPath = applicationJarPath;
143:            }
144:
145:            /**
146:             * Returns the applications jar/s path. This can be either absolute or
147:             * relative(to config file) path to the jar file or the directory containing the jars 
148:             * needed by the application.
149:             * @see #setApplicationJarPath
150:             * @since 1.3.3
151:             */
152:            public String getApplicationJarPath() {
153:                return applicationJarPath;
154:            }
155:
156:            /**
157:             * Sets the InitServerHooks. 
158:             * @see #getInitServerHooks
159:             * @since 1.4
160:             */
161:            public void setInitServerHooks(InitServerHooks initServerHooks) {
162:                this .initServerHooks = initServerHooks;
163:            }
164:
165:            /**
166:             * Returns the InitServerHooks.
167:             * @see #setInitServerHooks
168:             * @since 1.4
169:             */
170:            public InitServerHooks getInitServerHooks() {
171:                return initServerHooks;
172:            }
173:
174:            /**
175:             * Returns XML config of this class.
176:             * @since 1.3
177:             */
178:            public String toXML(String pad) {
179:                if (pad == null)
180:                    pad = "";
181:                StringBuffer sb = new StringBuffer();
182:                sb.append(pad + "<quickserver>\n");
183:
184:                if (getName() != null)
185:                    sb.append(pad + "\t<name>" + getName() + "</name>\n");
186:                if (getServerBanner() != null)
187:                    sb.append(pad + "\t<server-banner>" + getServerBanner()
188:                            + "</server-banner>\n");
189:                sb.append(pad + "\t<port>" + getPort() + "</port>\n");
190:                if (getBindAddr() != null)
191:                    sb.append(pad + "\t<bind-address>" + getBindAddr()
192:                            + "</bind-address>\n");
193:
194:                sb.append(getServerMode().toXML(pad + "\t"));
195:
196:                if (getClientEventHandler() != null)
197:                    sb.append(pad + "\t<client-event-handler>"
198:                            + getClientEventHandler()
199:                            + "</client-event-handler>\n");
200:                if (getClientCommandHandler() != null)
201:                    sb.append(pad + "\t<client-command-handler>"
202:                            + getClientCommandHandler()
203:                            + "</client-command-handler>\n");
204:                if (getClientObjectHandler() != null)
205:                    sb.append(pad + "\t<client-object-handler>"
206:                            + getClientObjectHandler()
207:                            + "</client-object-handler>\n");
208:                if (getClientBinaryHandler() != null)
209:                    sb.append(pad + "\t<client-binary-handler>"
210:                            + getClientBinaryHandler()
211:                            + "</client-binary-handler>\n");
212:                if (getClientWriteHandler() != null)
213:                    sb.append(pad + "\t<client-write-handler>"
214:                            + getClientWriteHandler()
215:                            + "</client-write-handler>\n");
216:                if (getClientAuthenticationHandler() != null)
217:                    sb.append(pad + "\t<client-authentication-handler>"
218:                            + getClientAuthenticationHandler()
219:                            + "</client-authentication-handler>\n");
220:                else if (getAuthenticator() != null)
221:                    sb.append(pad + "\t<authenticator>" + getAuthenticator()
222:                            + "</authenticator>\n");
223:                if (getClientData() != null)
224:                    sb.append(pad + "\t<client-data>" + getClientData()
225:                            + "</client-data>\n");
226:                if (getClientExtendedEventHandler() != null)
227:                    sb.append(pad + "\t<client-extended-event-handler>"
228:                            + getClientExtendedEventHandler()
229:                            + "</client-extended-event-handler>\n");
230:
231:                sb.append(getDefaultDataMode().toXML(pad + "\t"));
232:
233:                sb.append(pad + "\t<timeout>" + getTimeout() + "</timeout>\n");
234:                if (getTimeoutMsg() != null)
235:                    sb.append(pad + "\t<timeout-msg>" + getTimeoutMsg()
236:                            + "</timeout-msg>\n");
237:
238:                sb.append(pad + "\t<max-auth-try>" + getMaxAuthTry()
239:                        + "</max-auth-try>\n");
240:                if (getMaxAuthTryMsg() != null)
241:                    sb.append(pad + "\t<max-auth-try-msg>" + getMaxAuthTryMsg()
242:                            + "</max-auth-try-msg>\n");
243:
244:                sb.append(pad + "\t<max-connection>" + getMaxConnection()
245:                        + "</max-connection>\n");
246:                if (getMaxConnectionMsg() != null)
247:                    sb
248:                            .append(pad + "\t<max-connection-msg>"
249:                                    + getMaxConnectionMsg()
250:                                    + "</max-connection-msg>\n");
251:
252:                if (getConsoleLoggingLevel() != null)
253:                    sb.append(pad + "\t<console-logging-level>"
254:                            + getConsoleLoggingLevel()
255:                            + "</console-logging-level>\n");
256:                if (getConsoleLoggingFormatter() != null)
257:                    sb.append(pad + "\t<console-logging-formatter>"
258:                            + getConsoleLoggingFormatter()
259:                            + "</console-logging-formatter>\n");
260:
261:                sb.append(getObjectPoolConfig().toXML(pad + "\t"));
262:
263:                sb.append(pad + "\t<communication-logging>\n");
264:                sb.append(pad + "\t\t<enable>" + getCommunicationLogging()
265:                        + "</enable>\n");
266:                sb.append(pad + "\t</communication-logging>\n");
267:
268:                if (getDBObjectPoolConfig() != null) {
269:                    sb.append(getDBObjectPoolConfig().toXML(pad + "\t"));
270:                }
271:
272:                if (getSecurityManagerClass() != null) {
273:                    sb.append(pad + "\t<security-manager-class>"
274:                            + getSecurityManagerClass()
275:                            + "</security-manager-class>\n");
276:                }
277:
278:                if (getAccessConstraintConfig() != null) {
279:                    sb.append(getAccessConstraintConfig().toXML(pad + "\t"));
280:                }
281:
282:                if (getQSAdminServerConfig() != null)
283:                    sb.append(getQSAdminServerConfig().toXML(pad + "\t"));
284:
285:                if (getApplicationConfiguration() != null) {
286:                    sb.append(getApplicationConfiguration().toXML(pad + "\t"));
287:                }
288:
289:                if (getApplicationJarPath() != null) {
290:                    sb.append(pad + "\t<application-jar-path>"
291:                            + getApplicationJarPath()
292:                            + "</application-jar-path>\n");
293:                }
294:
295:                if (getServerHooks() != null) {
296:                    sb.append(getServerHooks().toXML(pad + "\t"));
297:                }
298:
299:                if (getInitServerHooks() != null) {
300:                    sb.append(getInitServerHooks().toXML(pad + "\t"));
301:                }
302:
303:                sb.append(getSecure().toXML(pad + "\t"));
304:                sb.append(getAdvancedSettings().toXML(pad + "\t"));
305:
306:                sb.append(pad + "</quickserver>\n");
307:                return sb.toString();
308:            }
309:
310:            public String toString() {
311:                return toXML(null);
312:            }
313:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.