Package org.impalaframework.exception

Examples of org.impalaframework.exception.ExecutionException


        String description = resource.toString();
        try {
            inputStream = resource.openStream();
        }
        catch (IOException e) {
            throw new ExecutionException("Unable to load properties file from resource: " + description, e);
        }
        return loadProperties(inputStream, description);
    }
View Full Code Here


        String description = resource.getDescription();
        try {
            inputStream = resource.getInputStream();
        }
        catch (IOException e) {
            throw new ExecutionException("Unable to load properties file " + description, e);
        }

        return loadProperties(inputStream, description);
    }
View Full Code Here

        Properties props = new Properties();
        try {
            props.load(inputStream);
        }
        catch (IOException e) {
            throw new ExecutionException("Unable to load properties file " + description, e);
        }
        finally {
            if (inputStream != null) {
                try {
                    inputStream.close();
View Full Code Here

        Class<?> clazz = null;
        try {
            clazz = org.springframework.util.ClassUtils.forName(className, classLoader);
        }
        catch (ClassNotFoundException e) {
            throw new ExecutionException("Unable to find class of type '" + className + "'");
        }

        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();
            return o;
        }
        catch (InvalidStateException e) {
            throw e;
        }
        catch (ClassCastException e) {
            String message = "Created object '" + o + "' is an instance of " + o.getClass().getName();
            throw new ExecutionException(message, e);
        }
        catch (Exception e) {
            String message = "Error instantiating class of type '" + className + "': " + e.getMessage();
            throw new ExecutionException(message, e);
        }
    }
View Full Code Here

                logger.error("Failed to handle loading of application module: " + moduleName, e);
               
                if (e instanceof RuntimeException) {
                    throw (RuntimeException)e;
                } else {
                    throw new ExecutionException(e.getMessage(), e);
                }
            }

        }
        else {
View Full Code Here

               
                logger.error("Failed to handle unloading of application module " + moduleDefinition, e);
                if (e instanceof RuntimeException) {
                    throw (RuntimeException)e;
                } else {
                    throw new ExecutionException(e.getMessage(), e);
                }
            }
        }
        return success;
    }
View Full Code Here

           
            if (declaredField != null) {
                return getFieldValue(object, declaredField, clazz);
            }
            else {
                throw new ExecutionException(object.getClass().getName() + " does not appear to contain field '" + fieldName + "'");
            }
        }
        catch (ExecutionException e) {
            throw e;
        }
        catch (Exception e) {
            throw new ExecutionException(e.getMessage(), e);
        }
    }
View Full Code Here

        Object value = null;
        try {
            value = declaredField.get(object);
        }
        catch (Exception e) {
            throw new ExecutionException(e.getMessage(), e);
        }
        return ObjectUtils.cast(value, clazz);
    }
View Full Code Here

        }
        return null;
    }

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

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

    private static ExecutionException rethrowConstructorException(Exception e, Constructor<?> constructor, Object... args) {
        return new ExecutionException("Unable to instantiate object using constructor '" + constructor + "', args: " + Arrays.toString(args), e);
    }
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.