W3C home > Mailing lists > Public > www-validator-cvs@w3.org > April 2008

2006/unicorn/org/w3c/unicorn Framework.java,1.8,1.9

From: Jean-Guilhem Rouel via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 18 Apr 2008 12:35:23 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1JmpoJ-0006aa-SB@lionel-hutz.w3.org>

Update of /sources/public/2006/unicorn/org/w3c/unicorn
In directory hutz:/tmp/cvs-serv25229/org/w3c/unicorn

Modified Files:
	Framework.java 
Log Message:
fixed a bug preventing the completion of unicorn initialization + misc

Index: Framework.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/Framework.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Framework.java	20 Feb 2008 15:14:34 -0000	1.8
+++ Framework.java	18 Apr 2008 12:35:21 -0000	1.9
@@ -11,7 +11,6 @@
 import java.io.FileReader;
 import java.io.IOException;
 import java.net.MalformedURLException;
-import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
@@ -21,8 +20,6 @@
 import java.util.Map.Entry;
 
 import javax.xml.bind.JAXBException;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPathExpressionException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -38,7 +35,6 @@
 import org.w3c.unicorn.util.ListFiles;
 import org.w3c.unicorn.util.LocalizedString;
 import org.w3c.unicorn.util.Property;
-import org.xml.sax.SAXException;
 
 /**
  * Main class of the central module of UniCORN.
@@ -76,6 +72,9 @@
 
 	static {
 		// TODO load the map of ResponseParser
+		if (Framework.logger.isDebugEnabled()) {
+			Framework.logger.debug("Loading available parsers...");
+		}
 		try {
 			mapOfReponseParser = new LinkedHashMap<String, ResponseParser>();
 			final URL aURLPropFile = Framework.class.getResource("responseParsers.properties");			
@@ -85,19 +84,14 @@
 				ResponseParser aResponseParser = (ResponseParser)(Class.forName((String)(e.getValue())).newInstance());
 				mapOfReponseParser.put((String)(e.getKey()),aResponseParser);
 			}
-		} catch (final IOException e) {
-			Framework.logger.error("IOException : "+e.getMessage(), e);
-			e.printStackTrace();
-		} catch (InstantiationException e) {
-			Framework.logger.error("InstantiationException : "+e.getMessage(), e);
-			e.printStackTrace();
-		} catch (IllegalAccessException e) {
-			Framework.logger.error("IllegalAccessException : "+e.getMessage(), e);
-			e.printStackTrace();
-		} catch (ClassNotFoundException e) {
-			Framework.logger.error("ClassNotFoundException : "+e.getMessage(), e);
+		} catch (Exception e) {
 			e.printStackTrace();
 		}
+		finally {
+			if (Framework.logger.isDebugEnabled()) {
+				Framework.logger.debug("... Parsers loaded");
+			}		
+		}
 	}
 	
 	/**
@@ -105,7 +99,7 @@
 	 */
 	static {
 		if (Framework.logger.isDebugEnabled()) {
-			Framework.logger.debug("Observer initialisation.");
+			Framework.logger.debug("Loading available observers...");
 		}
 		//final String sLanguage = Property.get("DEFAULT_LANGUAGE");
 		final String sLanguage = Property.get("DEFAULT_LANGUAGE");
@@ -143,52 +137,31 @@
 					if (Framework.logger.isDebugEnabled()) {
 						Framework.logger.debug("Observer WADL file : "+sWADL+".");
 					}
-						
-					try {
-						
-						final Observer aObserver = new Observer();
-						final WADLUnmarshaller aWADLUnmarshaller = new WADLUnmarshallerXPath();
-						aWADLUnmarshaller.addURL(new URL(sWADL));
-						aWADLUnmarshaller.unmarshal();
-						
-						aObserver.setListOfCallMethod(aWADLUnmarshaller.getListOfCallMethod());
-						aObserver.setParamLangName(aWADLUnmarshaller.getNameOfLangParameter());
-						aObserver.setID(aWADLUnmarshaller.getID());
-						aObserver.setName(aWADLUnmarshaller.getName());
-						aObserver.setDescription(aWADLUnmarshaller.getDescription());
-						aObserver.setHelpLocation(aWADLUnmarshaller.getHelpLocation());
-						aObserver.setProvider(aWADLUnmarshaller.getProvider());
-						aObserver.setMapOfInputMethod(aWADLUnmarshaller.getMapOfInputMethod());
-						aObserver.setResponseType(aWADLUnmarshaller.getResponseType());
-						Framework.mapOfObserver.put(new String(aObserver.getID()), aObserver);
-					}
-					catch (final ParserConfigurationException e) {
-						Framework.logger.error("ParserConfigurationException : "+e.getMessage(), e);
-						e.printStackTrace();
-					}
-					catch (final XPathExpressionException e) {
-						Framework.logger.error("XPathExpressionException : "+e.getMessage(), e);
-						e.printStackTrace();
-					}
-					catch (final SAXException e) {
-						Framework.logger.error("SAXException : "+e.getMessage(), e);
-						e.printStackTrace();
-					}
-					catch (final IOException e) {
-						Framework.logger.error("IOException : "+e.getMessage(), e);
-						e.printStackTrace();
-					}
-					catch (final URISyntaxException e) {
-						Framework.logger.error("URISyntaxException : "+e.getMessage(), e);
-						e.printStackTrace();
-					}
+
+					final Observer aObserver = new Observer();
+					final WADLUnmarshaller aWADLUnmarshaller = new WADLUnmarshallerXPath();
+					aWADLUnmarshaller.addURL(new URL(sWADL));
+					aWADLUnmarshaller.unmarshal();
+					
+					aObserver.setListOfCallMethod(aWADLUnmarshaller.getListOfCallMethod());
+					aObserver.setParamLangName(aWADLUnmarshaller.getNameOfLangParameter());
+					aObserver.setID(aWADLUnmarshaller.getID());
+					aObserver.setName(aWADLUnmarshaller.getName());
+					aObserver.setDescription(aWADLUnmarshaller.getDescription());
+					aObserver.setHelpLocation(aWADLUnmarshaller.getHelpLocation());
+					aObserver.setProvider(aWADLUnmarshaller.getProvider());
+					aObserver.setMapOfInputMethod(aWADLUnmarshaller.getMapOfInputMethod());
+					aObserver.setResponseType(aWADLUnmarshaller.getResponseType());
+					Framework.mapOfObserver.put(new String(aObserver.getID()), aObserver);
 				}
-				catch (final Exception aException) {
-					aException.printStackTrace();
-					Framework.logger.error("Exception : "+aException.getMessage(), aException);
+				catch (final Exception e) {					
+					Framework.logger.error("Exception : "+e.getMessage(), e);
+					e.printStackTrace();
 				}
 			}
-				
+			if (Framework.logger.isDebugEnabled()) {
+				Framework.logger.debug("... Observers loaded.");
+			}				
 		}
 		catch (final FileNotFoundException aFileNotFoundException) {
 			Framework.logger.error(
Received on Friday, 18 April 2008 12:36:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:02:27 UTC