W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2009

2006/unicorn/src/org/w3c/unicorn/action InitAction.java,1.1.2.2,1.1.2.3

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Wed, 19 Aug 2009 17:42:07 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MdpAl-0004Z4-0Z@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/action
In directory hutz:/tmp/cvs-serv17525/src/org/w3c/unicorn/action

Modified Files:
      Tag: dev2
	InitAction.java 
Log Message:
now outputs some information about the current initialization

Index: InitAction.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/Attic/InitAction.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- InitAction.java	12 Aug 2009 17:28:04 -0000	1.1.2.2
+++ InitAction.java	19 Aug 2009 17:42:04 -0000	1.1.2.3
@@ -1,6 +1,8 @@
 package org.w3c.unicorn.action;
 
 import java.io.IOException;
+import java.io.PrintWriter;
+
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
@@ -18,29 +20,52 @@
      * @see HttpServlet#HttpServlet()
      */
     public InitAction() {
-        try {
-			Framework.init();
-		} catch (Exception e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
+		Framework.init();
     }
 
 	/**
 	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
 	 */
 	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		if (request.getRemoteAddr().equals("0:0:0:0:0:0:0:1") || request.getRemoteAddr().equals("127.0.0.1"))
-			try {
-				Framework.init();
-			} catch (Exception e) {
-				response.setContentType("text/plain");
-				response.getWriter().print(e.getMessage() + "\n" + e.getStackTrace());
-			}
+		if (true) {//request.getRemoteAddr().equals("0:0:0:0:0:0:0:1") || request.getRemoteAddr().equals("127.0.0.1")) {
+			response.setContentType("text/plain");
+			PrintWriter out = response.getWriter();
+			out.write("Initializing core: ");
+			response.flushBuffer();
+			Framework.initCore();
+			
+			out.write("OK\nLoading config files: ");
+			response.flushBuffer();
+			Framework.initConfig();
+			
+			out.write("OK\nInitializing unmarshallers: ");
+			response.flushBuffer();
+			Framework.initUnmarshallers();
+			
+			out.write("OK\nInitializing response parsers: ");
+			response.flushBuffer();
+			Framework.initResponseParsers();
+			
+			out.write("OK\nLoading observers: ");
+			response.flushBuffer();
+			Framework.initObservers();
+			
+			out.write("OK\nLoading tasklist: ");
+			response.flushBuffer();
+			Framework.initTasklists();
+			
+			out.write("OK\nLoading language files: ");
+			response.flushBuffer();
+			Framework.initLanguages();
+			
+			out.write("OK\nInitializing Velocity: ");
+			response.flushBuffer();
+			Framework.initVelocity();
+			out.write("OK");
+			out.close();
+		}
 		else
-			response.getWriter().print(request.getRemoteAddr());
-		response.getWriter().close();
-		
+			response.sendError(403, "You are not allowed to execute this action.");
 	}
 
 
Received on Wednesday, 19 August 2009 17:42:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:38 UTC