Package org.impalaframework.exception

Examples of org.impalaframework.exception.InvalidStateException


        try {
            Map<String, Object> toReturn = (Map<String, Object>) object;
            return toReturn;
        }
        catch (ClassCastException e) {
            throw new InvalidStateException("Attribute with name '" + attributeName + "', and value '"
                    + object + "' is not a valid map");
        }
    }
View Full Code Here


        //check that classes are valid
        for (Class<?> clz : classes) {
            try {
                final Class<?> loaded = Class.forName(clz.getName(), false, classLoader);
                if (loaded != clz) {
                    throw new InvalidStateException("Class entry '" + clz.getName() + "'"
                            + " contributed from module '" + reference.getContributingModule() + "'"
                            + " with bean name '" + reference.getBeanName() + "'"
                            + " is incompatible with class loader " + classLoader);
                }
            } catch (ClassNotFoundException e) {
                throw new InvalidStateException("Class entry '" + clz.getName() + "'"
                        + " contributed from module '" + reference.getContributingModule() + "'"
                        + " with bean name '" + reference.getBeanName() + "'"
                        + " could not be found using class loader " + classLoader);
            }
        }
View Full Code Here

        //check that classes are valid
        for (Class<?> clz : classes) {
            Class<?> serviceClass = service.getClass();
           
            if (!clz.isAssignableFrom(serviceClass)) {
                throw new InvalidStateException("Service class '" + serviceClass.getName()
                        + " contributed from module '" + reference.getContributingModule() + "'"
                        + " with bean name '" + reference.getBeanName() + "'"
                        + " is not assignable declared export type " + clz.getName());
            }          
        }
View Full Code Here

        //TODO introduce constants for bean names
        ModuleManagementFacade facade = ObjectUtils.cast(applicationContext.getBean("moduleManagementFacade"),
                ModuleManagementFacade.class);
       
        if (facade == null) {
            throw new InvalidStateException("Application context '" + applicationContext.getDisplayName()
                    + "' does not contain bean named 'moduleManagementFacade'");
        }
       
        setNewOperationsFacade(facade);
        bundleContext.registerService(OperationsFacade.class.getName(), operations, null);
View Full Code Here

        //find bundle with name
        Bundle bundle = findBundle(currentDefinition);

        if (bundleLocations == null || bundleLocations.length == 0) {
            throw new InvalidStateException("Module loader '" + moduleLoader.getClass().getName()
                    + "' returned " + (bundleLocations != null ? "empty": "null") +
                    " bundle class locations. Cannot install bundle for module '"
                    + currentDefinition.getName() + "'");
        }
View Full Code Here

        Assert.notNull(moduleName, "moduleName cannot be null");
        Assert.notNull(key, "key cannot be null");
       
        if (this.trie.contains(key)) {
            ModuleNameWithPath value = trie.findContainedValue(key);
            throw new InvalidStateException("Module '" + moduleName + "' cannot use key '" + key + "', as it is already being used by module '" + value.getModuleName() + "'");
        }

        this.trie.insert(key, new ModuleNameWithPath(moduleName, servletPath));
        List<String> list = this.contributions.get(moduleName);
        if (list == null) {
View Full Code Here

        if (context == null) {
            logger.warn("Root module context is null: no modules loaded");
        }
        else if (!(context instanceof WebApplicationContext)) {
            throw new InvalidStateException("Application context " + context + " has class "
                    + context.getClass().getName() + " which is not an instance of "
                    + WebApplicationContext.class.getName());
        }
       
        return context;
View Full Code Here

        try {
            Long intValue = Long.parseLong(toString);
            return intValue;
        }
        catch (NumberFormatException e) {
            throw new InvalidStateException("Attribute with name '" + attributeName + "', and value '"
                    + object + "' is not a valid Long value");
        }
    }
View Full Code Here

        try {
            Integer intValue = Integer.parseInt(toString);
            return intValue;
        }
        catch (NumberFormatException e) {
            throw new InvalidStateException("Attribute with name '" + attributeName + "', and value '"
                    + object + "' is not an integer");
        }
    }
View Full Code Here

       
        try {
            return Double.parseDouble(toString);
        }
        catch (NumberFormatException e) {
            throw new InvalidStateException("Attribute with name '" + attributeName + "', and value '"
                    + object + "' is not a double");
        }
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.exception.InvalidStateException

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.