Source Code Cross Referenced for GeoServerPlugIn.java in  » GIS » GeoServer » org » vfny » geoserver » global » 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 » GIS » GeoServer » org.vfny.geoserver.global 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org.  All rights reserved.
002:         * This code is licensed under the GPL 2.0 license, availible at the root
003:         * application directory.
004:         */
005:        package org.vfny.geoserver.global;
006:
007:        import org.apache.struts.action.ActionServlet;
008:        import org.apache.struts.action.PlugIn;
009:        import org.apache.struts.config.ModuleConfig;
010:        import java.io.File;
011:        import javax.servlet.ServletException;
012:
013:        /**
014:         * GeoServerPlugIn purpose.
015:         *
016:         * <p>
017:         * Used to load the config into GeoServer. Is a pre-Condition for ConfigPlugIn.
018:         * This is started by struts.
019:         * </p>
020:         *
021:         * <p></p>
022:         *
023:         * @author dzwiers, Refractions Research, Inc.
024:         * @version $Id: GeoServerPlugIn.java 6326 2007-03-15 18:36:40Z jdeolive $
025:         *
026:         * @see org.vfny.geoserver.config.ConfigPlugIn
027:         * @REVISIT: There seems to be quite a bit of code duplication in this class
028:         *           with LoadXMLAction, loading things, especially with the
029:         *           validation stuff.  Anyway we could cut that down?  Have one call
030:         *           the other?  Too close to release to do sucha refactoring but
031:         *           in 1.4 we should. -CH
032:         */
033:        public class GeoServerPlugIn implements  PlugIn {
034:            /**
035:             * To allow for this class to be used as a precondition, and be pre-inited.
036:             *
037:             * @see org.vfny.geoserver.config.ConfigPlugIn
038:             */
039:            private boolean started = false;
040:
041:            /**
042:             * Implement destroy.
043:             *
044:             * <p>
045:             * Does Nothing
046:             * </p>
047:             *
048:             * @see org.apache.struts.action.PlugIn#destroy()
049:             */
050:            public void destroy() {
051:            }
052:
053:            /**
054:             * Implement init.
055:             *
056:             * <p>
057:             * This does the load of the config files for GeoServer. Check the struts
058:             * configuration if this is not laoding correctly.
059:             * </p>
060:             *
061:             * @param as Used to get ServletContext
062:             * @param mc Not used
063:             *
064:             * @throws javax.servlet.ServletException
065:             * @throws ServletException when a load error occurs
066:             *
067:             * @see org.apache.struts.action.PlugIn#init(org.apache.struts.action.ActionServlet,
068:             *      org.apache.struts.config.ModuleConfig)
069:             */
070:            public void init(ActionServlet as, ModuleConfig mc)
071:                    throws javax.servlet.ServletException {
072:                if (started) {
073:                    return;
074:                }
075:
076:                //JD: kill this
077:                //        ServletContext sc = as.getServletContext()eos;
078:                //        File geoserverDataDir = GeoserverDataDirectory.getGeoserverDataDirectory(sc); //geoserver_home fix
079:                //
080:                //        try {
081:                //            File f = geoserverDataDir; //geoserver_home fix
082:                //            XMLConfigReader cr = new XMLConfigReader(f,sc);
083:                //            
084:                //            GeoServer gs = new GeoServer();
085:                //            sc.setAttribute(GeoServer.WEB_CONTAINER_KEY, gs);
086:                //            
087:                //            Data dt = new Data(f,gs);
088:                //            sc.setAttribute(Data.WEB_CONTAINER_KEY, dt);
089:                //            
090:                //            WFS wfs = new WFS();
091:                //            sc.setAttribute(WFS.WEB_CONTAINER_KEY, wfs);
092:                //            
093:                //            WMS wms = new WMS();
094:                //            sc.setAttribute(WMS.WEB_CONTAINER_KEY, wms);
095:                //            
096:                //            GeoValidator gv = new GeoValidator();
097:                //            sc.setAttribute(GeoValidator.WEB_CONTAINER_KEY, gv);
098:                //
099:                //            if (cr.isInitialized()) {
100:                //                gs.load(cr.getGeoServer(),sc);
101:                //                wfs.load(cr.getWfs());
102:                //                wms.load(cr.getWms());
103:                //                dt.load(cr.getData());
104:                //                
105:                //                wfs.setGeoServer(gs);
106:                //                wms.setGeoServer(gs);
107:                //                wfs.setData(dt);
108:                //                wms.setData(dt);
109:                //            } else {
110:                //                throw new ConfigurationException(
111:                //                    "An error occured loading the initial configuration.");
112:                //            }
113:                //
114:                //
115:                //            try {
116:                //            File plugInDir = findConfigDir(geoserverDataDir, "plugIns");
117:                //            File validationDir = findConfigDir(geoserverDataDir, "validation");
118:                //            	Map plugIns = null;
119:                //            	Map testSuites = null;
120:                //            	if(plugInDir.exists()){
121:                //            		plugIns = XMLReader.loadPlugIns(plugInDir);
122:                //            		if(validationDir.exists()){
123:                //            			testSuites = XMLReader.loadValidations(validationDir, plugIns);
124:                //            			gv.load(testSuites,plugIns);
125:                //            		}
126:                //            		testSuites = new HashMap();
127:                //            	}else{
128:                //            		plugIns = new HashMap();
129:                //            	}
130:                //            	wfs.setValidation(gv);
131:                //            } catch (Exception e) {
132:                //            	// LOG error
133:                //            	e.printStackTrace();
134:                //            }
135:                //        } catch (ConfigurationException e) {
136:                //            sc.setAttribute(GeoServer.WEB_CONTAINER_KEY, null);
137:                //            sc.setAttribute(Data.WEB_CONTAINER_KEY, null);
138:                //            sc.setAttribute(WFS.WEB_CONTAINER_KEY, null);
139:                //            sc.setAttribute(WMS.WEB_CONTAINER_KEY, null);
140:                //            sc.setAttribute(GeoValidator.WEB_CONTAINER_KEY, null);
141:                //            throw new ServletException(e);
142:                //        }
143:                started = true;
144:            }
145:
146:            private File findConfigDir(File rootDir, String name)
147:                    throws Exception {
148:                return GeoserverDataDirectory.findConfigDir(rootDir, name);
149:            }
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.