Package org.impalaframework.exception

Examples of org.impalaframework.exception.InvalidStateException


        //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

    public static byte[] getBytes(File file) throws IOException {
        if (file == null)
            throw new IllegalArgumentException("File is null");

        if (!file.exists())
            throw new InvalidStateException("File " + file + " does not exist");

        return FileCopyUtils.copyToByteArray(file);
    }
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

        for (String dependent : dependentModuleNames) {
           
            final Vertex dependentVertex = vertexMap.get(dependent);
           
            if (dependentVertex == null) {
                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

 
  public void addClassLoader(String moduleName, GraphClassLoader graphClassLoader) {
    synchronized (graphClassLoaders) {
      if (graphClassLoaders.containsKey(moduleName)) {
       
        throw new InvalidStateException("Class loader registry already contains class loader for module '" + moduleName + "'");
      }
      graphClassLoaders.put(moduleName, graphClassLoader);
    }
  }
View Full Code Here

      else {
        String parentName = parent.getName();
        newParent = newRootDefinition.findChildDefinition(parentName, true);

        if (newParent == null) {
          throw new InvalidStateException("Unable to find parent module '" + parentName + "' in " + newRootDefinition);
        }
      }

      newParent.add(moduleDefinition);
     
View Full Code Here

          TransitionSet transitions = calculator.getTransitions(oldRootDefinition, newRootDefinition);
          moduleStateHolder.processTransitions(transitions);
          return true;
        }
        else {
          throw new InvalidStateException("Module to remove does not have a parent module. "
              + "This is unexpected state and may indicate a bug");
        }
      }
    }
    return false;
View Full Code Here

    operation.execute(input);

    ConfigurableApplicationContext context = facade.getModuleStateHolder().getRootModuleContext();

    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

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.