Package de.odysseus.calyxo.base.conf

Examples of de.odysseus.calyxo.base.conf.ConfigException


   * @param loader
   * @throws ConfigException
   */
  public void setClassLoader(ClassLoader loader) throws ConfigException {
    if (this.loader != null) {
      throw new ConfigException("Module class loader must not be set more than once!");
    }
    this.loader = loader;
  }
View Full Code Here


      String token = tokens.nextToken().trim();
      URL url = null;
      try {
        url = context.getServletContext().getResource(token);
      } catch (MalformedURLException e) {
        throw new ConfigException(e);
      }
      if (url == null) {
        throw new ConfigException("Could not find resource " + token);
      } else {
        list.add(url);
      }
    }
    URL[] urls = (URL[])list.toArray(new URL[list.size()]);
View Full Code Here

      String token = tokens.nextToken().trim();
      URL url = null;
      try {
        url = context.getServletContext().getResource(token);
      } catch (MalformedURLException e) {
        throw new ConfigException(e);
      }
      if (url == null) {
        throw new ConfigException("Could not find resource " + token);
      } else {
        list.add(url);
      }
    }
    URL[] inputs = (URL[])list.toArray(new URL[list.size()]);
View Full Code Here

  /**
   * Add dispatch element.
   */
  public void add(DispatchConfigImpl value) throws ConfigException {
    if (dispatches.containsKey(value.getName())) {
      throw new ConfigException("Duplicate dispatch name '" + value.getName() + "' in " + toInlineString());
    }
    dispatches.put(value.getName(), value);
  }
View Full Code Here

    if (when != null) {
      try {
        expression = context.getExpressionEvaluator().parseExpression("${" + when + "}", Boolean.class, this);
      } catch (ELException e) {
        throw new ConfigException("Failed to parse 'when' condition in filter '" + toInlineString() + "'");
      }
    }
  }
View Full Code Here

  protected void _init() throws ConfigException {
    super._init();

    // check that name xor class is specified
    if ((name == null) == (className == null)) {
      throw new ConfigException("Exactly one of name and class must be specified in filter '" + toInlineString() + "'");
    }
  }
View Full Code Here

      VariableResolver resolver = new CalyxoVariableResolver(request);
      try {
        Boolean result = (Boolean)expression.evaluate(resolver);
        return result == null ? false : result.booleanValue();
      } catch (ELException e) {
        throw new ConfigException("Could not evaluate 'when' condition '" + when + "' in filter '" + toInlineString() + "'", e);
      }
    }
  }
View Full Code Here

  /**
   * Add dispatch element.
   */
  public void add(DispatchConfigImpl value) throws ConfigException {
    if (dispatches.containsKey(value.getName())) {
      throw new ConfigException("Duplicate dispatch name '" + value.getName() + "' in " + toInlineString());
    }
    dispatches.put(value.getName(), value);
  }
View Full Code Here

   */
  public void init(FilterConfig config, ModuleContext module) throws ConfigException {
    dispatch = config.getDispatchConfig(null);
    ParamConfig param = config.getParamConfig("target");
    if ((param == null) == (dispatch == null)) {
      throw new ConfigException("One of 'target' parameter or anonymous <dispatch> child must be given for filter '" + config.toInlineString() + "'");
    }
    if (param != null) {
      String target = param.getValue();
      dispatch = config.getActionConfig().findDispatchConfig(target);
      if (dispatch == null) {
        throw new ConfigException("Cannot find dispatch '" + target + "' for filter '" + config.toInlineString() + "'");
      }
    }
  }
View Full Code Here

  public void init(ExceptionHandlerConfig config, ModuleContext module) throws ConfigException {
    ParamConfig param = null;
   
    param = config.getParamConfig("bundle");
    if (param == null) {
      throw new ConfigException("Missing parameter 'bundle'!");
    }
    bundle = param.getValue();
 
    param = config.getParamConfig("key");
    if (param == null) {
      throw new ConfigException("Missing parameter 'key'!");
    }
    key = param.getValue();

    dispatch = config.getDispatchConfig(null);
    param = config.getParamConfig("target");
    if ((param == null) == (dispatch == null)) {
      throw new ConfigException("One of 'target' parameter or anonymous <dispatch> child must be given for filter '" + config.toInlineString() + "'");
    }
    if (param != null) {
      target = param.getValue();
    }
   
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.base.conf.ConfigException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.