Package org.apache.slide.util.conf

Examples of org.apache.slide.util.conf.ConfigurationException


            String property = instruction.getAttribute("property");
            String namespace = instruction.getAttribute("namespace", "DAV:");
            XPath xPath = XPath.newInstance(instruction.getAttribute("xpath"));
            return new Instruction(xPath, new PropertyName(property, namespace));
        } catch (JDOMException e) {
            throw new ConfigurationException("Could not create xPath from given attribute", instruction);
        }
    }
View Full Code Here


                      ((Configurable)eventListener).configure(conf);
                   }
                }
                addEventListener(eventListener);
            } catch (ClassCastException e) {
                throw new ConfigurationException("Event listener '"+classname+"' is not of type EventListener", config);
            } catch (Exception e) {
                throw new ConfigurationException("Event listener '"+classname+"' could not be loaded", config);
            }
        }
        Enumeration enableConfigs = config.getConfigurations("event");
        while (enableConfigs.hasMoreElements()) {
            Configuration enableConfig = (Configuration)enableConfigs.nextElement();
            String classname = enableConfig.getAttribute("classname");
            String method = enableConfig.getAttribute("method", null);
            boolean enable = enableConfig.getAttributeAsBoolean("enable", true);
            try {
                Class eventClass = Class.forName(classname);
                Field methodsField = eventClass.getField("methods");
                AbstractEventMethod[] methods = (AbstractEventMethod [])methodsField.get(null);
                for ( int i = 0; i < methods.length; i++ ) {
                    if ( method == null || methods[i].getName().equals(method) ) {
                        methods[i].setEnabled(enable);
                    }
                }
            } catch (NoSuchFieldException e) {
                throw new ConfigurationException("Event '"+classname+"' does not provide the required static member 'methods'", config);
            } catch (Exception e) {
                throw new ConfigurationException("Event '"+classname+"' could not be loaded", config);
            }
        }
    }
View Full Code Here

                if ( extractor instanceof Configurable ) {
                    ((Configurable)extractor).configure(extractorConfig.getConfiguration("configuration"));
                }
                addExtractor(extractor);
            } catch (ClassCastException e) {
                throw new ConfigurationException("Extractor '"+classname+"' is not of type Extractor", config);
            } catch (ConfigurationException e) {
                throw e;
            } catch (Exception e) {
                throw new ConfigurationException("Extractor '"+classname+"' could not be loaded", config);
            }
        }
    }
View Full Code Here

      throws ConfigurationException {

        try {
            return this.configuration.getAttribute(paramName);
        } catch (org.apache.avalon.framework.configuration.ConfigurationException ce) {
            throw new ConfigurationException(ce.getMessage(), this);
        }
    }
View Full Code Here

      throws ConfigurationException {

        try {
            return this.configuration.getAttributeAsInteger(paramName);
        } catch (org.apache.avalon.framework.configuration.ConfigurationException ce) {
            throw new ConfigurationException(ce.getMessage(), this);
        }
    }
View Full Code Here

      throws ConfigurationException {

        try {
            return this.configuration.getAttributeAsLong(name);
        } catch (org.apache.avalon.framework.configuration.ConfigurationException ce) {
            throw new ConfigurationException(ce.getMessage(), this);
        }
    }
View Full Code Here

      throws ConfigurationException {

        try {
            return this.configuration.getAttributeAsFloat(paramName);
        } catch (org.apache.avalon.framework.configuration.ConfigurationException ce) {
            throw new ConfigurationException(ce.getMessage(), this);
        }
    }
View Full Code Here

      throws ConfigurationException {

        try {
            return this.configuration.getAttributeAsBoolean(paramName);
        } catch (org.apache.avalon.framework.configuration.ConfigurationException ce) {
            throw new ConfigurationException(ce.getMessage(), this);
        }
    }
View Full Code Here

    public int getValueAsInt() throws ConfigurationException {

        try {
            return this.configuration.getValueAsInteger();
        } catch (org.apache.avalon.framework.configuration.ConfigurationException ce) {
            throw new ConfigurationException(ce.getMessage(), this);
        }
    }
View Full Code Here

    public float getValueAsFloat() throws ConfigurationException {

        try {
            return this.configuration.getValueAsFloat();
        } catch (org.apache.avalon.framework.configuration.ConfigurationException ce) {
            throw new ConfigurationException(ce.getMessage(), this);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.slide.util.conf.ConfigurationException

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.