Package org.jboss.weld.exceptions

Examples of org.jboss.weld.exceptions.DeploymentException


    private static <T> List<Metadata<T>> checkForDuplicates(List<Metadata<T>> list, LogMessageCallback messageCallback) {
        Map<T, Metadata<T>> map = new HashMap<T, Metadata<T>>();
        for (Metadata<T> item : list) {
            Metadata<T> previousOccurrence = map.put(item.getValue(), item);
            if (previousOccurrence != null) {
                throw new DeploymentException(messageCallback.invoke(item.getValue(), item, previousOccurrence));
            }
        }
        return list;
    }
View Full Code Here


        createRunner("unparseable.xml").runAndExpect(XmlLogger.LOG.parsingError(null, null));
    }

    @Test
    public void testCannotLoadClass() {
        createRunner("unloadable.xml").runAndExpect(new DeploymentException(new Exception()));
    }
View Full Code Here

* @author Stuart Douglas
*/
public class WeldExceptionTransformer implements DeploymentExceptionTransformer {
    public Throwable transform(final Throwable throwable) {
        if(throwable == null) {
            return new DeploymentException(new Exception());
        }
        return throwable;
    }
View Full Code Here

    @Override
    public void fire() {
        super.fire();
        if (!getErrors().isEmpty()) {
            throw new DeploymentException(getErrors());
        }
    }
View Full Code Here

         * injection points.
         */
        if (normalScoped && bean.getName() != null && !Beans.isBeanProxyable(bean, beanManager)) {
            UnproxyableResolutionException ue = Proxies.getUnproxyableTypesException(bean, beanManager.getServices());
            if (ue != null) {
                throw new DeploymentException(ue);
            }
        }

        // Validate all pseudo-scoped beans, except for built-in beans and session beans which are proxied by the EJB container
        if (!normalScoped && !(bean instanceof AbstractBuiltInBean) && !(bean instanceof SessionBean)) {
View Full Code Here

        }
        if (!problems.isEmpty()) {
            if (problems.size() == 1) {
                throw problems.get(0);
            } else {
                throw new DeploymentException(problems);
            }
        }
    }
View Full Code Here

        if (interceptionModel.getAllInterceptors().size() > 0 || hasSerializationOrInvocationInterceptorMethods) {
            if (annotatedType.isFinal()) {
                throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(annotatedType.getJavaClass());
            }
            if (Reflections.isPrivate(constructor.getJavaMember())) {
                throw new DeploymentException(ValidatorLogger.LOG.notProxyablePrivateConstructor(annotatedType.getJavaClass(), constructor, annotatedType.getJavaClass()));
            }
            manager.getInterceptorModelRegistry().put(annotatedType.slim(), interceptionModel);
        }
    }
View Full Code Here

        }

        Class<?>[] methodDeclaredInterceptors = interceptorsApi.extractInterceptorClasses(method);
        if (methodDeclaredInterceptors != null && methodDeclaredInterceptors.length > 0) {
            if (Reflections.isFinal(method.getJavaMember())) {
                throw new DeploymentException(BeanLogger.LOG.finalInterceptedBeanMethodNotAllowed(method, methodDeclaredInterceptors[0].getName()));
            }

            InterceptionType interceptionType = isTimeoutAnnotationPresentOn(method)
                    ? InterceptionType.AROUND_TIMEOUT
                    : InterceptionType.AROUND_INVOKE;
View Full Code Here

    public <T> List<Future<T>> invokeAllAndCheckForExceptions(Collection<? extends Callable<T>> tasks) {
        try {
            return checkForExceptions(getTaskExecutor().invokeAll(tasks));
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new DeploymentException(e);
        }
    }
View Full Code Here

        for (Future<T> result : futures) {
            try {
                result.get();
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                throw new DeploymentException(e);
            } catch (ExecutionException e) {
                Throwable cause = e.getCause();
                if (cause instanceof RuntimeException) {
                    throw RuntimeException.class.cast(cause);
                } else {
                    throw new DeploymentException(cause);
                }
            }
        }
        return futures;
    }
View Full Code Here

TOP

Related Classes of org.jboss.weld.exceptions.DeploymentException

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.