Package org.impalaframework.exception

Examples of org.impalaframework.exception.InvalidStateException


      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

        if (!ArrayUtils.isNullOrEmpty(proxyTypes)) {
            ProxyFactorySourceUtils.addInterfaces(proxyFactory, proxyTypes);
        } else {
            boolean isFinal = Modifier.isFinal(reference.getServiceBeanReference().getService().getClass().getModifiers());
            if (isFinal) {
                throw new InvalidStateException("Cannot create proxy for service reference " + reference + " as no interfaces have been " +
                        "specified and the bean class is final, therefore cannot be proxied");
            }
        }

        afterInit(proxyFactory, targetSource);
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

            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.addChildModuleDefinition(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

        Object o = null;
        try {
           
            Constructor<?> constructor = ReflectionUtils.findConstructor(clazz, new Class[0]);
            if (constructor == null) {
                throw new InvalidStateException("Cannot instantiate class '" + clazz + "' as it has no no-args constructor");
            }
           
            ReflectionUtils.makeAccessible(constructor);
           
            o = constructor.newInstance();
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

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.