Package org.impalaframework.exception

Examples of org.impalaframework.exception.InvalidStateException


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

  private K castKeyName(Object keyName) {
    K contributionKeyName = null;
    try {
      contributionKeyName = (K) keyName;
    } catch (RuntimeException e) {
      throw new InvalidStateException("key " + contributionKeyName + " could not be cast to the correct type", e);
    }
    return contributionKeyName;
  }
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);
      moduleDefinition.setParentDefinition(newParent);
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

    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

  private V castBean(Object beanObject) {
    V bean = null;
    try {
      bean = (V) beanObject;
    } catch (ClassCastException e) {
      throw new InvalidStateException("bean " + beanObject + " coudld not be cast to the correct type", e);
    }
    return bean;
  }
View Full Code Here

    }

    protected void checkResources(List<Resource> resources, String moduleName,
            String moduleVersion, String rootDirectoryPath, String resourceType) {
        if (resources == null || resources.isEmpty()) {
            throw new InvalidStateException("Unable to find any " + resourceType + " resources in workspace root directory '"
                    + PathUtils.getAbsolutePath(rootDirectoryPath)
                    + "' for module named '" + moduleName
                    + "' with version '" + moduleVersion + "'");
        }
    }
View Full Code Here

        if (beanFactory instanceof BeanDefinitionExposing) {
            BeanDefinition beanDefinition = ((BeanDefinitionExposing) beanFactory).getBeanDefinition(beanName);
            return beanDefinition;
        }
       
        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

        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

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.