Package org.apache.savan

Examples of org.apache.savan.SavanException


                content = new String((byte[]) resource.getContent());
                processFilters(AXIOMUtil.stringToOM(content));
            }

        } catch (Exception e) {
            throw new SavanException(e);
        }
    }
View Full Code Here


        } catch (Exception e) {
            try {
            systemRegistry.rollbackTransaction();
            } catch (RegistryException ex) {
                throw new SavanException(ex);   
            }
            throw new SavanException(e);
        }
    }
View Full Code Here

        protocol = new Protocol();
        nameElement = element.getFirstChildWithName(new QName(NAME));

        if (nameElement == null) {
            throw new SavanException("Protocol must have a 'Name' subelement");
        }

        name = nameElement.getText();
        protocol.setName(name);
        utilFactoryNameElement = element.getFirstChildWithName(new QName(UTIL_FACTORY));

        if (utilFactoryNameElement == null) {
            throw new SavanException("Protocol must have a 'UtilFactory' subelement");
        }

        utilFactoryName = utilFactoryNameElement.getText();
        utilFactory = getObject(utilFactoryName);

        if (!(utilFactory instanceof UtilFactory)) {
            throw new SavanException("UtilFactory element" + utilFactoryName
                    + "is not a subtype of the UtilFactory class");
        }

        protocol.setUtilFactory((UtilFactory) utilFactory);
        mappingRulesElement = element.getFirstChildWithName(new QName(MAPPING_RULES));

        if (mappingRulesElement == null) {
            throw new SavanException("Protocol must have a 'mappingRules' sub-element");
        }

        processMappingRules(mappingRulesElement, protocol);
        defaultSubscriberElement = element.getFirstChildWithName(new QName(DEFAULT_SUBSCRIBER));

        if (defaultSubscriberElement == null) {
            throw new SavanException("Protocols must have a 'defaultSubscriber' sub-element");
        }

        defaultSubscriber = defaultSubscriberElement.getText();
        protocol.setDefaultSubscriber(defaultSubscriber);
        defaultFilterElement = element.getFirstChildWithName(new QName(DEFAULT_FILTER));

        if (defaultFilterElement == null) {
            throw new SavanException("Protocols must have a 'defaultFilter' sub-element");
        }

        defaultFilter = defaultFilterElement.getText();
        protocol.setDefaultFilter(defaultFilter);
        protocolMap.put(protocol.getName(), protocol);
View Full Code Here

        String clazz = null;
        Object subscriberStore = null;

        keyElement = element.getFirstChildWithName(new QName(KEY));
        if (keyElement == null) {
            throw new SavanException("SubscriberStore must have a 'key' subelement");
        }

        key = keyElement.getText();
        classElement = element.getFirstChildWithName(new QName(CLASS));

        if (classElement == null) {
            throw new SavanException("SubscriberStore must have a 'Clazz' subelement'");
        }

        clazz = classElement.getText();
        // initialize the class to check weather it is value
        subscriberStore = getObject(clazz);

        if (!(subscriberStore instanceof SubscriberStore)) {
            String message = "Class " + clazz
                    + " does not implement the  SubscriberStore interface.";
            throw new SavanException(message);
        }

        subscriberStoreNamesMap.put(key, clazz);
    }
View Full Code Here

        try {
            clazz = Class.forName(className);
            obj = clazz.newInstance();
        } catch (Exception e) {
            String message = "Can't instantiate the class:" + className;
            throw new SavanException(message, e);
        }
        return obj;
    }
View Full Code Here

        nameElement = element.getFirstChildWithName(new QName(NAME));
        identifierElement = element.getFirstChildWithName(new QName(IDENTIFIER));
        classElement = element.getFirstChildWithName(new QName(CLASS));

        if (nameElement == null) {
            throw new SavanException("Name element is not present within the Filter");
        }
        if (identifierElement == null) {
            throw new SavanException("Identifier element is not present within the Filter");
        }
        if (classElement == null) {
            throw new SavanException("Class element is not present within the Filter");
        }

        name = nameElement.getText();
        identifier = identifierElement.getText();
        clazz = classElement.getText();

        // initialize the class to check weather it is value
        filter = getObject(clazz);

        if (!(filter instanceof Filter)) {
            String message = "Class " + clazz + " does not implement the  Filter interface.";
            throw new SavanException(message);
        }

        bean = new FilterBean();
        bean.setName(name);
        bean.setIdentifier(identifier);
View Full Code Here

        nameElement = element.getFirstChildWithName(new QName(NAME));
        urlAppenderElement = element.getFirstChildWithName(new QName(URL_APPENDER));
        classElement = element.getFirstChildWithName(new QName(CLASS));

        if (nameElement == null) {
            throw new SavanException("Name element is not present within the AbstractSubscriber");
        }
        if (classElement == null) {
            throw new SavanException("Class element is not present within the Filter");
        }

        name = nameElement.getText();
        clazz = classElement.getText();

        // initialize the class to check weather it is valid
        subscriber = getObject(clazz);

        if (!(subscriber instanceof Subscriber)) {
            String message = "Class " + clazz + " does not implement the  Subscriber interface.";
            throw new SavanException(message);
        }

        bean = new SubscriberBean();
        bean.setName(name);
        bean.setClazz(clazz);
View Full Code Here

TOP

Related Classes of org.apache.savan.SavanException

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.