Package org.apache.avalon.framework.parameters

Examples of org.apache.avalon.framework.parameters.ParameterException


     */
    public void parameterize(Parameters parameters) throws ParameterException {
        this.preemptiveLoaderURI = parameters.getParameter("preemptive-loader-url", null);
        if ( null != this.preemptiveLoaderURI
             && this.preemptiveLoaderURI.indexOf("://") == -1) {
            throw new ParameterException("The preemptive-loader-url must be absolute: " + this.preemptiveLoaderURI);
        }
        final String storeRole = parameters.getParameter("use-store", Store.ROLE);
        try {
            this.store = (Store)this.manager.lookup(storeRole);
        } catch (ComponentException e) {
            throw new ParameterException("Unable to lookup store with role " + storeRole, e);
        }
        this.defaultCacheStorage = new StoreIncludeCacheStorageProxy(this.store, this.getLogger());
    }
View Full Code Here


     */
    public void parameterize(Parameters parameters) throws ParameterException {
        this.preemptiveLoaderURI = parameters.getParameter("preemptive-loader-url", null);
        if ( null != this.preemptiveLoaderURI
             && this.preemptiveLoaderURI.indexOf("://") == -1) {
            throw new ParameterException("The preemptive-loader-url must be absolute: " + this.preemptiveLoaderURI);
        }
        final String storeRole = parameters.getParameter("use-store", Store.ROLE);
        try {
            this.store = (Store)this.manager.lookup(storeRole);
        } catch (ServiceException e) {
            throw new ParameterException("Unable to lookup store with role " + storeRole, e);
        }
        this.defaultCacheStorage = new StoreIncludeCacheStorageProxy(this.store, this.getLogger());
    }
View Full Code Here

            }
            catch (Throwable t)
            {
                String msg = "Parameterizing the following service failed : " + this.getShorthand();
                this.getParentLogger().error(msg,t);
                throw new ParameterException(msg,t);
            }
        }
    }
View Full Code Here

     */
    public void parameterize(Parameters params) throws ParameterException {
        this.maxobjects = params.getParameterAsInteger("maxobjects", 100);
        this.persistent = params.getParameterAsBoolean("use-persistent-cache", false);
        if ((this.maxobjects < 1)) {
            throw new ParameterException("MRUMemoryStore maxobjects must be at least 1!");
        }

        this.cache = new Hashtable((int)(this.maxobjects * 1.2));
        this.mrulist = new LinkedList();
        this.storeJanitor.register(this);
View Full Code Here

                } catch (IOException e) {
                    // Legacy: Always was ignored
                }
            }
        } catch (IOException e) {
            throw new ParameterException("Unable to set directory", e);
        }
    }
View Full Code Here

                } catch (IOException e) {
                    // Ignored
                }
            }
        } catch (IOException e) {
            throw new ParameterException("Unable to set directory", e);
        }

        String databaseName = params.getParameter("datafile", "cocoon.dat");
        String indexName = params.getParameter("indexfile", "cocoon.idx");
        mOrder = params.getParameterAsInteger("order", 301);
View Full Code Here

        String compilerClass = params.getParameter("compiler");
        try {
            this.compilerClass = ClassUtils.loadClass(compilerClass);
        } catch (ClassNotFoundException e) {
            throw new ParameterException("Unable to load compiler: " + compilerClass, e);
        }
        this.deleteSources = params.getParameterAsBoolean("delete-sources", false);
    }
View Full Code Here

            if (className != null) {
                this.codeFormatter = ClassUtils.loadClass(className);
            }
        } catch (Exception e) {
            getLogger().error("Error with \"code-formatter\" parameter", e);
            throw new ParameterException("Unable to load code formatter: " + className, e);
        }
    }
View Full Code Here

    // lookup parameter 'host'
    try {
      host = parameters.getParameter("host");
      // test if host is not the empty string
      if (host == "") {
        throw new ParameterException("The parameter 'host' may not be the empty string");
      }
    } catch (ParameterException pe) {
      // rethrow as a ProcessingException
      throw new ProcessingException("Parameter 'host' not specified",pe);
    }
   
    String bindname;
   
    // lookup parameter 'bindname'
    try {
      bindname = parameters.getParameter("bindname");
      // test if bindname is not the empty string
      if (bindname == "") {
        throw new ParameterException("The parameter 'bindname' may not be the empty string");
      }
    } catch (ParameterException pe) {
      // rethrow as a ProcessingException
      throw new ProcessingException("Parameter 'bindname' not specified",pe);
    }
View Full Code Here

            // Will use specific class
            getLogger().debug("Using factory " + factoryName);
            try {
                this.tfactoryClass = ClassUtils.loadClass(factoryName);
            } catch(ClassNotFoundException cnfe) {
                throw new ParameterException("Cannot load TransformerFactory class", cnfe);
            }

            if (! TransformerFactory.class.isAssignableFrom(tfactoryClass)) {
                throw new ParameterException("Class " + factoryName + " isn't a TransformerFactory");
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.framework.parameters.ParameterException

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.