Changeset 802:789225066772
- Timestamp:
- 10/19/09 12:47:05 (4 years ago)
- Author:
- tgambet
- Branch:
- default
- convert_revision:
- svn:cdcfb263-7567-472c-a848-e2c2df3466e7/trunk@803
- Message:
-
renamed responseParser.properties file to responseImpl.properties
+ renamed initResponseParsers() method to initResponseImplementations()
+ added reference to the old schema implementation class
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r794
|
r802
|
|
| 1 | | // $Id: Framework.java,v 1.23 2009-10-19 10:09:04 tgambet Exp $ |
| | 1 | // $Id: Framework.java,v 1.24 2009-10-19 12:47:05 tgambet Exp $ |
| 2 | 2 | // Author: Damien LEROY & Thomas GAMBET. |
| 3 | 3 | // (c) COPYRIGHT MIT, ERCIM ant Keio, 2006. |
| … |
… |
|
| 96 | 96 | private static String[] configFiles = { |
| 97 | 97 | "extensions.properties", |
| 98 | | "responseParsers.properties", |
| | 98 | "responseImpl.properties", |
| 99 | 99 | "output.properties", |
| 100 | 100 | "velocity.properties", |
| … |
… |
|
| 121 | 121 | initConfig(); |
| 122 | 122 | initUnmarshallers(); |
| 123 | | initResponseParsers(); |
| | 123 | initResponseImplementations(); |
| 124 | 124 | initObservers(); |
| 125 | 125 | initTasklists(); |
| … |
… |
|
| 261 | 261 | |
| 262 | 262 | @SuppressWarnings("unchecked") |
| 263 | | public static void initResponseParsers() throws InitializationFailedException { |
| | 263 | public static void initResponseImplementations() throws InitializationFailedException { |
| 264 | 264 | // Load the map of ResponseParser |
| 265 | 265 | logger.debug("-------------------------------------------------------"); |
| 266 | | logger.debug("Loading available response implementations form responseParsers.properties"); |
| 267 | | Properties aProperties = Property.getProps("responseParsers.properties"); |
| | 266 | logger.debug("Loading available response implementations form responseImpl.properties"); |
| | 267 | Properties aProperties = Property.getProps("responseImpl.properties"); |
| 268 | 268 | for (Object key : aProperties.keySet()) { |
| 269 | 269 | String className = aProperties.getProperty(key.toString()); |
| … |
… |
|
| 272 | 272 | Class.forName(className).getConstructor(InputStream.class, String.class); |
| 273 | 273 | responseImpl.put(key.toString(), (Class<Response>) Class.forName(className)); |
| 274 | | logger.debug("> Parser loaded: " + responseImpl.get(key).getClass().toString()); |
| | 274 | logger.debug("> Implementation loaded: " + responseImpl.get(key).getClass().toString()); |
| 275 | 275 | } else { |
| 276 | 276 | logger.error("> Class: " + className + " is not a Response implementation."); |
| 277 | 277 | } |
| 278 | 278 | } catch (ClassNotFoundException e) { |
| 279 | | logger.error("Class not found: " + className + ". Check responseParsers.properties."); |
| | 279 | logger.error("Class not found: " + className + ". Check responseImpl.properties."); |
| 280 | 280 | } catch (NoSuchMethodException e) { |
| 281 | 281 | logger.error("Response implementation: " + className + " does not have a constructor with signature (InputStream is, String charset). Implementation skipped."); |
| … |
… |
|
| 285 | 285 | } |
| 286 | 286 | if (responseImpl.size() == 0) { |
| 287 | | throw new InitializationFailedException("There is no parser loaded. Check responseParsers.properties."); |
| | 287 | throw new InitializationFailedException("There is no response implementation loaded. Check responseImpl.properties."); |
| 288 | 288 | } else { |
| 289 | 289 | logger.info("OK - " + responseImpl.size() + " implementation(s) successfully loaded."); |
-
|
r357
|
r802
|
|
| 76 | 76 | response.flushBuffer(); |
| 77 | 77 | try { |
| 78 | | Framework.initResponseParsers(); |
| | 78 | Framework.initResponseImplementations(); |
| 79 | 79 | out.write("OK\n"); |
| 80 | 80 | } catch (InitializationFailedException e) { |