Package org.impalaframework.exception

Examples of org.impalaframework.exception.InvalidStateException


        //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 = proxyTypes[0];
        if (proxyTypes.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


    }
   
    public static void ensureNotFrozen(Freezable freezable) {
        Assert.notNull(freezable);
        if (freezable.isFrozen()) {
            throw new InvalidStateException("Cannot change object '" + freezable + "' as this has been frozen");
        }
    }
View Full Code Here

            if (logger.isDebugEnabled()) {
                logger.debug("Module '" + moduleName + "' not found.");
                dump();
            }
           
            throw new InvalidStateException("No module '"
                    + moduleName + "' is registered with current instance of dependency manager.");
        }
        return parentVertex;
    }
View Full Code Here

        }
       
        if (!copy.isEmpty()) {
            //should not be possible, as all of the modules have already been converted into vertexes. Hence
            //would be the sign of an non-obvious programming error
            throw new InvalidStateException("Sortable list contains modules not known by the current instance of dependency registry: "
                    + GraphHelper.getModuleNamesFromCollection(copy));
        }
       
        return ordered;
    }
View Full Code Here

           
            final Vertex dependentVertex = vertexMap.get(dependent);
           
            if (dependentVertex == null) {
                if (!optional) {
                    throw new InvalidStateException("Unable to dependency named named '" + dependent
                            + "' for module definition '" + moduleDefinition.getName() + "'");
                }               
            } else {
                //register the vertex dependency
                populateVertexDependency(vertex, dependentVertex);
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 = proxyTypes[0];
        if (proxyTypes.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

        operation.execute(application, input);

        ConfigurableApplicationContext context = SpringModuleUtils.getRootSpringContext(application.getModuleStateHolder());

        if (context == null) {
            throw new InvalidStateException("Root application context is null");
        }
       
        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 (WebApplicationContext) context;
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

    ServiceRegistryReference serviceReference = services.get(beanName);

    if (serviceReference != null) {
      Object bean = serviceReference.getBean();
      if (!type.isAssignableFrom(bean.getClass())) {
        throw new InvalidStateException("Service reference bean "
            + bean + " is not assignable from type " + type);
      }
    }
    return serviceReference;
  }
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

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.