| | |
| | | } |
| | | |
| | | if (!extensionsPath.isDirectory()) { |
| | | // The extensions directory is not a directory. This is more |
| | | // critical. |
| | | LocalizableMessage message = |
| | | ERR_ADMIN_EXTENSIONS_DIR_NOT_DIRECTORY.get( |
| | | String.valueOf(extensionsPath)); |
| | | throw new InitializationException(message); |
| | | // The extensions directory is not a directory. This is more critical. |
| | | throw new InitializationException(ERR_ADMIN_EXTENSIONS_DIR_NOT_DIRECTORY.get(extensionsPath)); |
| | | } |
| | | |
| | | // Get each extension file name. |
| | |
| | | logger.traceException(e); |
| | | |
| | | LocalizableMessage message = ERR_ADMIN_EXTENSIONS_CANNOT_LIST_FILES.get( |
| | | String.valueOf(extensionsPath), stackTraceToSingleLineString(e)); |
| | | extensionsPath, stackTraceToSingleLineString(e)); |
| | | throw new InitializationException(message, e); |
| | | } |
| | | } |
| | |
| | | try { |
| | | className = reader.readLine(); |
| | | } catch (IOException e) { |
| | | LocalizableMessage msg = ERR_CLASS_LOADER_CANNOT_READ_MANIFEST_FILE.get(String |
| | | .valueOf(e.getMessage())); |
| | | throw new InitializationException(msg, e); |
| | | throw new InitializationException( |
| | | ERR_CLASS_LOADER_CANNOT_READ_MANIFEST_FILE.get(e.getMessage()), e); |
| | | } |
| | | |
| | | // Break out when the end of the manifest is reached. |
| | |
| | | try { |
| | | theClass = Class.forName(className, true, loader); |
| | | } catch (Exception e) { |
| | | LocalizableMessage msg = ERR_CLASS_LOADER_CANNOT_LOAD_CLASS.get(className, String |
| | | .valueOf(e.getMessage())); |
| | | throw new InitializationException(msg, e); |
| | | throw new InitializationException( |
| | | ERR_CLASS_LOADER_CANNOT_LOAD_CLASS.get(className, e.getMessage()), e); |
| | | } |
| | | if (AbstractManagedObjectDefinition.class.isAssignableFrom(theClass)) { |
| | | // We need to instantiate it using its getInstance() static method. |
| | |
| | | try { |
| | | method = theClass.getMethod("getInstance"); |
| | | } catch (Exception e) { |
| | | LocalizableMessage msg = ERR_CLASS_LOADER_CANNOT_FIND_GET_INSTANCE_METHOD.get( |
| | | className, String.valueOf(e.getMessage())); |
| | | throw new InitializationException(msg, e); |
| | | throw new InitializationException( |
| | | ERR_CLASS_LOADER_CANNOT_FIND_GET_INSTANCE_METHOD.get(className, e.getMessage()), e); |
| | | } |
| | | |
| | | // Get the definition instance. |
| | |
| | | try { |
| | | d = (AbstractManagedObjectDefinition<?, ?>) method.invoke(null); |
| | | } catch (Exception e) { |
| | | LocalizableMessage msg = ERR_CLASS_LOADER_CANNOT_INVOKE_GET_INSTANCE_METHOD.get( |
| | | className, String.valueOf(e.getMessage())); |
| | | throw new InitializationException(msg, e); |
| | | throw new InitializationException( |
| | | ERR_CLASS_LOADER_CANNOT_INVOKE_GET_INSTANCE_METHOD.get(className, e.getMessage()), e); |
| | | } |
| | | definitions.add(d); |
| | | } |
| | |
| | | try { |
| | | d.initialize(); |
| | | } catch (Exception e) { |
| | | LocalizableMessage msg = ERR_CLASS_LOADER_CANNOT_INITIALIZE_DEFN.get(d.getName(), |
| | | d.getClass().getName(), String.valueOf(e.getMessage())); |
| | | throw new InitializationException(msg, e); |
| | | throw new InitializationException( |
| | | ERR_CLASS_LOADER_CANNOT_INITIALIZE_DEFN.get( |
| | | d.getName(), d.getClass().getName(), e.getMessage()), e); |
| | | } |
| | | } |
| | | } |