Package org.apache.avalon.framework.parameters

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


                } catch (IOException e) {
                    // Ignored
                }
            }
        } catch (ContextException ce) {
            throw new ParameterException("Unable to get directory information from context.", ce);
        } catch (IOException e) {
            throw new ParameterException("Unable to set directory", e);
        }

        // get store configuration
        final String databaseName = params.getParameter("datafile", "cocoon.dat");
        final String indexName = params.getParameter("m_indexFile", "cocoon.idx");
View Full Code Here


        }
       
        try {
            this.cache = (Cache)this.manager.lookup(this.cacheRole);
        } catch (ServiceException se) {
            throw new ParameterException("Unable to lookup cache: " + this.cacheRole, se);
        }

        this.async = parameters.getParameterAsBoolean("async", false);
    }
View Full Code Here

        int writeInterval = parameters.getParameterAsInteger("write-interval", 0);
        if ( writeInterval > 0) {
            try {
                this.writeSource = this.resolver.resolveURI(parameters.getParameter("write-source"));
            } catch (IOException ioe) {
                throw new ParameterException("Error getting write-source.", ioe);
            }
            if (!(this.writeSource instanceof ModifiableSource)) {
                throw new ParameterException("Write-source is not modifiable.");
            }
            SAXConfigurationHandler b = new SAXConfigurationHandler();
            try {
                SourceUtil.toSAX(this.manager, this.writeSource, this.writeSource.getMimeType(), b);
            } catch (Exception ignore) {
View Full Code Here

        String classLoaderClass = params.getParameter("class-loader",null);
        if (classLoaderClass != null) {
            try {
                this.classLoaderManager = (ClassLoaderManager) ClassUtils.newInstance(classLoaderClass);
            } catch (Exception e) {
                throw new ParameterException("Unable to load class loader: " + classLoaderClass, e);
            }
        }
    }
View Full Code Here

        pc.xsltRole = configuration.getParameter("xslt-processor-role", XSLTProcessor.ROLE);
        String stylesheet = configuration.getParameter("style");
        try {
            pc.stylesheet = this.variableFactory.lookup( stylesheet );
        } catch (PatternException pe) {
            throw new ParameterException("Unknown pattern for stylesheet " + stylesheet, pe);
        }
        this.variables.add(pc.stylesheet);
        return pc;
    }
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);
    }
View Full Code Here

            } else if ( MODEDEF_REQUEST_ATTR.equals(modeDef) ) {
                this.mode = MODE_REQUEST_ATTR;
            } else if ( MODEDEF_SESSION_ATTR.equals(modeDef) ) {
                this.mode = MODE_SESSION_ATTR;
            } else {
                throw new ParameterException("Unknown mode: " + this.mode);
            }
        }
    }
View Full Code Here

        }

        try {
            this.cache = (Cache) this.manager.lookup(cacheRole);
        } catch (ServiceException ce) {
            throw new ParameterException("Unable to lookup cache: " + cacheRole, ce);
        }
    }
View Full Code Here

            // release the store, if we don't need it anymore
            m_manager.release(m_store);
            m_store = null;
        } else if (null == m_store) {
            final String message = "XSLTProcessor: use-store is set to true, " + "but unable to aquire the Store.";
            throw new ParameterException(message);
        }
    }
View Full Code Here

            // Will use specific class
            try {
                Class factoryClass = ClassUtils.loadClass(className);
                factory = (SAXParserFactory)factoryClass.newInstance();
            } catch(Exception e) {
                throw new ParameterException("Cannot load SAXParserFactory class " + className, e);
            }
        }
        // FIXME(VG): This always prints "SAXParserFactory: null"
        // getLogger().debug("SAXParserFactory: " + ClassUtils.which(factory.getClass()));
        factory.setNamespaceAware(true);
        factory.setValidating(validate);

        // Get the DocumentFactory
        className = params.getParameter("document-builder-factory", null);
        if (className == null) {
            this.docFactory = DocumentBuilderFactory.newInstance();
        } else {
            // Will use specific class
            try {
                Class factoryClass = ClassUtils.loadClass(className);
                this.docFactory = (DocumentBuilderFactory)factoryClass.newInstance();
            } catch(Exception e) {
                throw new ParameterException("Cannot load DocumentBuilderFactory class " + className, e);
            }
        }
        // FIXME(VG): This always prints "DocumentBuilderFactory: null"
        // getLogger().debug("DocumentBuilderFactory: " + ClassUtils.which(docFactory.getClass()));
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.