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


    if (logger.isDebugEnabled()) {
      logger.debug("Capturing root module definition from " + o);
    }
   
    if (!(o instanceof Serializable)) {
      throw new InvalidStateException("Attempting to inject non-serializable module definition class '" + o.getClass().getName() + "'");
    }

    final Object clone = clone(o);
    try {     
      rootModuleDefinition = ObjectUtils.cast(clone, RootModuleDefinition.class);
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, contextPath, servletPath));
        List<String> list = this.contributions.get(moduleName);
        if (list == null) {
View Full Code Here

        if (logger.isDebugEnabled()) {
            logger.debug("Capturing root module definition from " + o);
        }
       
        if (!(o instanceof Serializable)) {
            throw new InvalidStateException("Attempting to inject non-serializable module definition class '" + o.getClass().getName() + "'");
        }

        final Object clone = clone(o);
        try {          
            rootModuleDefinition = ObjectUtils.cast(clone, RootModuleDefinition.class);
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 (logger.isDebugEnabled()) {
      logger.debug("Capturing root module definition from " + o);
    }
   
    if (!(o instanceof Serializable)) {
      throw new InvalidStateException("Attempting to inject non-serializable module definition class '" + o.getClass().getName() + "'");
    }

    final Object clone = clone(o);
    try {     
      rootModuleDefinition = ObjectUtils.cast(clone, RootModuleDefinition.class);
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

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

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

        if (beanFactory instanceof BeanDefinitionExposing) {
            BeanDefinition beanDefinition = ((BeanDefinitionExposing) beanFactory).getBeanDefinition(beanName);
            return beanDefinition;
        }
        //FIXME test
        throw new InvalidStateException("Cannot get bean definition as bean factory ["
                + beanFactory.getClass().getName()
                + "] does not implement [" + BeanDefinitionRegistry.class
                + "] or " + BeanDefinitionExposing.class.getName() + "]");
    }
View Full Code Here

        //if we have just a single interface and this is a concrete class, then we can use this
        //as the return value for getTargetClass
        Class<?> firstClass = interfaces[0];
        if (interfaces.length == 1 && !firstClass.isInterface()) {
            if (Modifier.isFinal(firstClass.getModifiers())) {
                throw new InvalidStateException("Cannot create proxy for " + firstClass + " as it is a final class");
            }
            this.concreteClass = firstClass;
        }
        else {
            this.concreteClass = null;
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.