Source Code Cross Referenced for FreefsLog.java in  » GIS » GeoServer » org » vfny » geoserver » servlets » 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.servlets 
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.servlets;
006:
007:        import org.geotools.data.jdbc.ConnectionPoolManager;
008:        import java.util.logging.Logger;
009:        import javax.servlet.ServletException;
010:        import javax.servlet.http.HttpServlet;
011:        import javax.servlet.http.HttpServletRequest;
012:        import javax.servlet.http.HttpServletResponse;
013:
014:        /**
015:         * Initializes all logging functions.
016:         *
017:         * @author Rob Hranac, Vision for New York
018:         * @author Chris Holmes, TOPP
019:         * @version $Id: FreefsLog.java 7746 2007-11-13 15:38:35Z aaime $
020:         */
021:        public class FreefsLog extends HttpServlet {
022:            /** Standard logging instance for class */
023:            private static final Logger LOGGER = org.geotools.util.logging.Logging
024:                    .getLogger("org.vfny.geoserver.servlets");
025:
026:            /** Default name for configuration directory */
027:            private static final String CONFIG_DIR = "data/";
028:
029:            /**
030:             * Initializes logging and config.
031:             *
032:             * @throws ServletException DOCUMENT ME!
033:             */
034:            public void init() throws ServletException {
035:                //configure log4j, since console logging is configured elsewhere 
036:                // we deny all logging, this is really just to prevent log4j 
037:                // initilization warnings
038:                // TODO: this is a hack, log config should be cleaner 
039:
040:                //JD: Commenting out
041:                //    	ConsoleAppender appender = new ConsoleAppender(new PatternLayout());
042:                //    	appender.addFilter(new DenyAllFilter());
043:                //    	
044:                //    	BasicConfigurator.configure(appender);
045:                //	
046:                //HACK: java.util.prefs are awful.  See
047:                //http://www.allaboutbalance.com/disableprefs.  When the site comes
048:                //back up we should implement their better way of fixing the problem.
049:                System.setProperty("java.util.prefs.syncInterval", "5000000");
050:            }
051:
052:            /**
053:             * Initializes logging.
054:             *
055:             * @param req The servlet request object.
056:             * @param res The servlet response object.
057:             */
058:            public void doGet(HttpServletRequest req, HttpServletResponse res) {
059:                //BasicConfigurator.configure();
060:            }
061:
062:            /**
063:             * Closes down the zserver if it is running, and frees up resources.
064:             *
065:             * @task REVISIT: what we should consider is having geotools provide a
066:             *       nicer way to clean up datastores's resources, something like a
067:             *       close, so that we could just iterate through all the datastores
068:             *       calling close. Once that's done we can clean up this method a
069:             *       bit.
070:             */
071:            public void destroy() {
072:                super .destroy();
073:                ConnectionPoolManager.getInstance().closeAll();
074:
075:                /*
076:                   HACK: we must get a standard API way for releasing resources...
077:                 */
078:                try {
079:                    Class sdepfClass = Class
080:                            .forName("org.geotools.data.arcsde.ConnectionPoolFactory");
081:
082:                    LOGGER.fine("SDE datasource found, releasing resources");
083:
084:                    java.lang.reflect.Method m = sdepfClass.getMethod(
085:                            "getInstance", new Class[0]);
086:                    Object pfInstance = m.invoke(sdepfClass, new Object[0]);
087:
088:                    LOGGER.fine("got sde connection pool factory instance: "
089:                            + pfInstance);
090:
091:                    java.lang.reflect.Method closeMethod = pfInstance
092:                            .getClass().getMethod("closeAll", new Class[0]);
093:
094:                    closeMethod.invoke(pfInstance, new Object[0]);
095:                    LOGGER
096:                            .info("just asked SDE datasource to release connections");
097:                } catch (ClassNotFoundException cnfe) {
098:                    LOGGER.fine("No SDE datasource found");
099:                } catch (Exception ex) {
100:                    ex.printStackTrace();
101:                }
102:            }
103:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.