Package org.impalaframework.exception

Examples of org.impalaframework.exception.ExecutionException


      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = null;
    try {
      docBuilder = factory.newDocumentBuilder();
    } catch (ParserConfigurationException e) {
      throw new ExecutionException(e);
    }
    Document doc = docBuilder.newDocument();
    return doc;
  }
View Full Code Here


    for (int i = 0; i < files.length; i++) {
      try {
        files[i] = resources[i].getFile();
      }
      catch (IOException e) {
        throw new ExecutionException("Unable to convert " + resources[i].getDescription() + " into a File");
      }
    }
    return files;
  }
View Full Code Here

 
   @SuppressWarnings("unchecked")
  public static <T extends Object> T cast(final Object o, Class<T> clazz) {
    if (o == null) return null;
    if (!(clazz.isAssignableFrom(o.getClass()))) {
      throw new ExecutionException("Object [" + o + "] of type " + o.getClass().getName() + " is not an instance of "
          + clazz.getSimpleName());
    }
    return (T)o;
  }
View Full Code Here

    ContextLoader contextLoader = null;
    try {
      contextLoader = contextLoaderClass.newInstance();
    }
    catch (Exception e) {
      throw new ExecutionException("Error instantiating context loader class " + contextLoaderClassName + ": " + e.getMessage(), e);
    }
   
    return contextLoader;
  }
View Full Code Here

    }
    return null;
  }

  private static ExecutionException rethrow(Exception e, String methodName, Object... args) {
    return new ExecutionException("Unable to execute method: " + methodName + ", args: " + Arrays.toString(args), e);
  }
View Full Code Here

     * interface
     */
    static BeanFactory getRootBeanFactory(BeanFactory beanFactory) {

        if (!(beanFactory instanceof HierarchicalBeanFactory)) {
            throw new ExecutionException(BeanFactory.class.getSimpleName()
                    + " " + beanFactory + " is of type "
                    + beanFactory.getClass().getName()
                    + ", which is not an instance of "
                    + HierarchicalBeanFactory.class.getName());
        }
View Full Code Here

        return endPoint;
    }

    BeanDefinitionRegistry getBeanDefinitionRegistry(BeanFactory rootBeanFactory) {
        if (!(rootBeanFactory instanceof BeanDefinitionRegistry)) {
            throw new ExecutionException("Cannot use " + this.getClass().getName() + " with bean factory which does not implement " + BeanDefinitionRegistry.class.getName());
        }
        BeanDefinitionRegistry registry = (BeanDefinitionRegistry) rootBeanFactory;
        return registry;
    }
View Full Code Here

        List<Class> interfaceClasses = new ArrayList<Class>();
        for (String interfaceClass : interfaces) {
            Class resolvedClassName = ClassUtils.resolveClassName(interfaceClass.trim(), getBeanClassLoader());

            if (!resolvedClassName.isAssignableFrom(bean.getClass())) {
                throw new ExecutionException("Bean '" + beanName + "' is not instance of type " + resolvedClassName.getName() + ", declared in type list '" + typeList + "'");
            }

            interfaceClasses.add(resolvedClassName);
        }
    }
View Full Code Here

        return parentClassLoader;
    }

    public static BeanDefinitionRegistry castToBeanDefinitionRegistry(final ConfigurableListableBeanFactory beanFactory) {
        if (!(beanFactory instanceof BeanDefinitionRegistry)) {
            throw new ExecutionException(beanFactory.getClass().getName() + " is not an instance of "
                    + BeanDefinitionRegistry.class.getSimpleName());
        }
   
        BeanDefinitionRegistry beanDefinitionRegistry = (BeanDefinitionRegistry) beanFactory;
        return beanDefinitionRegistry;
View Full Code Here

        for (int i = 0; i < files.length; i++) {
            try {
                files[i] = resources[i].getFile();
            }
            catch (IOException e) {
                throw new ExecutionException("Unable to convert " + resources[i].getDescription() + " into a File", e);
            }
        }
        return files;
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.exception.ExecutionException

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.