Package org.jboss.seam.exception.control

Examples of org.jboss.seam.exception.control.ExceptionToCatch


            chain.doFilter(request, response);
        } else {
            try {
                chain.doFilter(request, response);
            } catch (Exception e) {
                ExceptionToCatch catchEvent;
                if (request instanceof HttpServletRequest) {
                    catchEvent = new ExceptionToCatch(e, WebRequestLiteral.INSTANCE);
                    // new PathLiteral(HttpServletRequest.class.cast(request).getServletPath()));
                } else {
                    catchEvent = new ExceptionToCatch(e, WebRequestLiteral.INSTANCE);
                }
                getBeanManager().fireEvent(catchEvent);
                // QUESTION should catch handle rethrowing?
                if (!catchEvent.isHandled()) {
                    if (e instanceof ServletException) {
                        throw (ServletException) e;
                    } else if (e instanceof IOException) {
                        throw (IOException) e;
                    } else {
View Full Code Here


        for (Iterator<ExceptionQueuedEvent> it = getUnhandledExceptionQueuedEvents().iterator(); it.hasNext();) {
            Throwable t = it.next().getContext().getException();
            log.trace(MessageFormat.format("Handling Exception {0}", t.getClass().getName()));
            if (!(t instanceof AbortProcessingException)) // Why is this needed
            {
                ExceptionToCatch catchEvent = new ExceptionToCatch(t, FacesLiteral.INSTANCE);
                try {
                    if (log.isTraceEnabled()) {
                        log.trace("Firing event");
                    }
                    beanManager.fireEvent(catchEvent);
                } catch (Exception e) {
                    if (!e.equals(t)) {
                        log.debug("Throwing exception thrown from within Seam Catch");
                        throw new RuntimeException(e);
                    }
                    continue; // exception will be handled by getWrapped().handle() below
                }
                if (catchEvent.isHandled()) {
                    log.debug(MessageFormat.format("Exception handled {0}", t.getClass().getName()));
                    it.remove();
                }
            }
        }
View Full Code Here

    private static final Logger log = Logger.getLogger(CatchExceptionMapper.class);

    @Override
    public Response toResponse(Throwable exception) {
        ExceptionToCatch payload = new ExceptionToCatch(exception, RestRequest.RestRequestLiteral.INSTANCE);

        // The call returns if the exception is handled. The exception is rethrown by catch otherwise.
        bridgeEvent.fire(payload);

        return response.get();
View Full Code Here

TOP

Related Classes of org.jboss.seam.exception.control.ExceptionToCatch

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.