Package de.odysseus.calyxo.base.conf

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


    name2 = name1.endsWith(".x") || name1.endsWith(".y") ? null : name1 + ".x";

    dispatch = config.getDispatchConfig(null);
    param = config.getParamConfig("target");
    if (param != null && dispatch != null) {
      throw new ConfigException("At most one of 'target' parameter or anonymous <dispatch> child must be given for filter '" + config.toInlineString() + "'");
    }
    if (dispatch == null) {
      String target = param == null ? "cancel" : 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


    while (tokens.hasMoreTokens()) {
      String token = tokens.nextToken().trim();
      URL url = null;
      url = context.getServletContext().getResource(token);
      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

      FilterConfig config = (FilterConfig)configs.next();
      Class clazz = null;
      if (config.getName() != null) {
        clazz = pluginContext.getFilterClass(config.getName());
        if (clazz == null) {
          throw new ConfigException("Unknown filter name in '" + config.toInlineString() + "'");
        }
      } else {
        clazz = context.getClassLoader().loadClass(config.getClassName());
      }
      Filter filter = (Filter)clazz.newInstance();
View Full Code Here

  /**
   * Set filter class for specified name
   */
  public void setFilterClass(String name, Class clazz) throws ConfigException {
    if (filters.containsKey(name)) {
      throw new ConfigException("Filter '" + name + "' already exists");
    }
    if (clazz.isInterface() || !Filter.class.isAssignableFrom(clazz)) {
      throw new ConfigException("Bad filter class '" + clazz.getName() + "'");
    }
    filters.put(name, clazz);
  }
View Full Code Here

  /**
   * Set dispatcher for specified name
   */
  public void setDispatcher(String name, Dispatcher value) throws ConfigException {
    if (dispatchers.containsKey(name)) {
      throw new ConfigException("Dispatcher '" + name + "' already exists");
    }
    dispatchers.put(name, value);
  }
View Full Code Here

  /**
   * Set the default dispatcher.
   */
  public void setDefaultDispatcher(Dispatcher dispatcher) throws ConfigException {
    if (this.dispatcher != defaultDispatcher) {
      throw new ConfigException("Default dispatcher already set");
    }
    this.dispatcher = dispatcher;
  }
View Full Code Here

  /**
   * Set the default action class
   */
  public void setDefaultActionClass(Class clazz) throws ConfigException {
    if (defaultActionClass != initialDefaultActionClass) {
      throw new ConfigException("Default action class already set");
    }
    if (clazz.isInterface() || !Action.class.isAssignableFrom(clazz)) {
      throw new ConfigException("Bad action class '" + clazz.getName() + "'");
    }
    defaultActionClass = clazz;
  }
View Full Code Here

    } else if (pattern.endsWith("/*")) {
      prefix = pattern.substring(0, pattern.length() - 2);
    } else if (pattern.equals("/")) {
      prefix = "";
    } else {
      throw new ConfigException("Bad url-pattern: " + pattern);
    }
  }
View Full Code Here

   * @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

  /**
   * Add parameter
   */
  public void add(ParamConfigImpl value) throws ConfigException {
    if (paramConfigs.containsKey(value.getName())) {
      throw new ConfigException("Duplicate param name '" + value.getName() + "' in " + toInlineString());
    }
    paramConfigs.put(value.getName(), value);
  }
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.