/** * <p> Remove the specified exception configuration instance. </p> * * @param config ExceptionConfig instance to be removed * @throws IllegalStateException if this module configuration has been * frozen */ public void removeExceptionConfig(ExceptionConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } exceptions.remove(config.getType()); }
/** * Remove the specified exception configuration instance. * * @param config ActionConfig instance to be removed * * @exception IllegalStateException if this module configuration * has been frozen */ public void removeExceptionConfig(ExceptionConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } exceptions.remove(config.getType()); }
/** * Remove the specified exception configuration instance. * * @param config ExceptionConfig instance to be removed * * @exception IllegalStateException if this module configuration * has been frozen */ public void removeExceptionConfig(ExceptionConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } exceptions.remove(config.getType()); }
/** * Add a new <code>ExceptionConfig</code> instance to the set associated * with this action. * * @param config The new configuration instance to be added * * @exception IllegalStateException if this module configuration * has been frozen */ public void addExceptionConfig(ExceptionConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } exceptions.put(config.getType(), config); }
/** * Add a new <code>ExceptionConfig</code> instance to the set associated * with this module. * * @param config The new configuration instance to be added * * @exception java.lang.IllegalStateException if this module configuration * has been frozen */ public void addExceptionConfig(ExceptionConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } exceptions.put(config.getType(), config); }
/** * <p> Add a new <code>ExceptionConfig</code> instance to the set * associated with this action. </p> * * @param config The new configuration instance to be added * @throws IllegalStateException if this module configuration has been * frozen */ public void addExceptionConfig(ExceptionConfig config) { if (configured) { throw new IllegalStateException("Configuration is frozen"); } exceptions.put(config.getType(), config); }
/** * <p> Remove the specified exception configuration instance. </p> * * @param config ActionConfig instance to be removed * @throws IllegalStateException if this module configuration has been * frozen */ public void removeExceptionConfig(ExceptionConfig config) { throwIfConfigured(); exceptions.remove(config.getType()); }
/** * <p> Add a new <code>ExceptionConfig</code> instance to the set * associated with this module. </p> * * @param config The new configuration instance to be added * @throws IllegalStateException if this module configuration has been * frozen */ public void addExceptionConfig(ExceptionConfig config) { throwIfConfigured(); String key = config.getType(); if (exceptions.containsKey(key)) { log.warn("Overriding ExceptionConfig of type " + key); } exceptions.put(key, config); }
public DefaultExceptionHandlerConfig(ExceptionConfig exceptionConfig) { this.exceptionConfig = exceptionConfig; try { Class handlerClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getHandler()); exceptionHandler = (ExceptionHandler)handlerClass.newInstance(); exceptionClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getType()); } catch(Exception exc) { throw new NestedApplicationException(exc); } }
public DefaultExceptionHandlerConfig(ExceptionConfig exceptionConfig) { this.exceptionConfig = exceptionConfig; try { Class handlerClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getHandler()); exceptionHandler = (ExceptionHandler)handlerClass.newInstance(); exceptionClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getType()); } catch(Exception exc) { throw new NestedApplicationException(exc); } }
public DefaultExceptionHandlerConfig(ExceptionConfig exceptionConfig) { this.exceptionConfig = exceptionConfig; try { Class handlerClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getHandler()); exceptionHandler = (ExceptionHandler)handlerClass.newInstance(); exceptionClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getType()); } catch(Exception exc) { throw new NestedApplicationException(exc); } }
public DefaultExceptionHandlerConfig(ExceptionHandler exceptionHandler, ExceptionConfig exceptionConfig) { this.exceptionHandler = exceptionHandler; this.exceptionConfig = exceptionConfig; this.exceptionConfig.setHandler(exceptionHandler.getClass().getName()); try { exceptionClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getType()); } catch(Exception exc) { throw new NestedApplicationException(exc); } }
public DefaultExceptionHandlerConfig(ExceptionHandler exceptionHandler, ExceptionConfig exceptionConfig) { this.exceptionHandler = exceptionHandler; this.exceptionConfig = exceptionConfig; this.exceptionConfig.setHandler(exceptionHandler.getClass().getName()); try { exceptionClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getType()); } catch(Exception exc) { throw new NestedApplicationException(exc); } }
/** * Add XWork ExceptionConfigs (from XWork ExceptionMappingConfigs) */ private void initExceptionConfigs() { if (exceptions == null) { exceptions = new HashMap(); List exceptionMappings = delegate.getExceptionMappings(); for (Iterator i = exceptionMappings.iterator(); i.hasNext();) { ExceptionConfig wrapper = strutsFactory.createExceptionConfig((ExceptionMappingConfig) i.next()); exceptions.put(wrapper.getType(), wrapper); } } }
public DefaultExceptionHandlerConfig(ExceptionHandler exceptionHandler, ExceptionConfig exceptionConfig) { this.exceptionHandler = exceptionHandler; this.exceptionConfig = exceptionConfig; this.exceptionConfig.setHandler(exceptionHandler.getClass().getName()); try { exceptionClass = exceptionConfig.getClass().getClassLoader().loadClass(exceptionConfig.getType()); } catch(Exception exc) { throw new NestedApplicationException(exc); } }
/** * <p>Initialize the exception handlers for the specified module.</p> * * @param config ModuleConfig information for this module * @throws ServletException if initialization cannot be performed * @since Struts 1.3 */ protected void initModuleExceptionConfigs(ModuleConfig config) throws ServletException { if (log.isDebugEnabled()) { log.debug("Initializing module path '" + config.getPrefix() + "' forwards"); } // Process exception config extensions. ExceptionConfig[] exceptions = config.findExceptionConfigs(); for (int i = 0; i < exceptions.length; i++) { ExceptionConfig exception = exceptions[i]; processExceptionExtension(exception, config, null); } for (int i = 0; i < exceptions.length; i++) { ExceptionConfig exception = exceptions[i]; // Verify that required fields are all present for the config if (exception.getKey() == null) { handleValueRequiredException("key", exception.getType(), "global exception config"); } } }
/** * <p> * Extend the exception's configuration as necessary. * </p> * * @param exceptionConfig * the configuration to process. * @param moduleConfig * the module configuration for this module. * @throws ServletException * if initialization cannot be performed. */ protected void processExceptionExtension(ExceptionConfig exceptionConfig, ModuleConfig moduleConfig) throws ServletException { try { if (!exceptionConfig.isExtensionProcessed()) { if (log.isDebugEnabled()) { log.debug("Processing extensions for '" + exceptionConfig.getType() + "'"); } exceptionConfig = processExceptionConfigClass(exceptionConfig, moduleConfig); exceptionConfig.processExtends(moduleConfig, null); } } catch (ServletException e) { throw e; } catch (Exception e) { handleGeneralExtensionException("Exception", exceptionConfig.getType(), e); } }
this.findExceptionConfig(baseHandler.getType());
/** * <p> * Initialize the exception handlers for the specified module. * </p> * * @param config * ModuleConfig information for this module * @throws ServletException * if initialization cannot be performed * @since Struts 1.3 */ protected void initModuleExceptionConfigs(ModuleConfig config) throws ServletException { if (log.isDebugEnabled()) { log.debug("Initializing module path '" + config.getPrefix() + "' forwards"); } // Process exception config extensions. ExceptionConfig[] exceptions = config.findExceptionConfigs(); for (int i = 0; i < exceptions.length; i++) { ExceptionConfig exception = exceptions[i]; processExceptionExtension(exception, config); } for (int i = 0; i < exceptions.length; i++) { ExceptionConfig exception = exceptions[i]; // Verify that required fields are all present for the config if (exception.getKey() == null) { handleValueRequiredException("key", exception.getType(), "global exception config"); } } }