Package javax.faces.event

Examples of javax.faces.event.ExceptionQueuedEventContext


    @SuppressWarnings({"ThrowableInstanceNeverThrown"})
    public void handle() throws FacesException {

        for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext(); ) {
            ExceptionQueuedEvent event = i.next();
            ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();
            try {
                Throwable t = context.getException();
                if (isRethrown(t)) {
                    handled = event;
                    Throwable unwrapped = getRootCause(t);
                    if (unwrapped != null) {
                        throwIt(context.getContext(),
                                new FacesException(unwrapped.getMessage(), unwrapped));
                    } else {
                        if (t instanceof FacesException) {
                            throwIt(context.getContext(), (FacesException) t);
                        } else {
                            throwIt(context.getContext(),
                                    new FacesException(t.getMessage(), t));
                        }
                    }
                } else {
                    log(context);
View Full Code Here


            // look for and invoke any listeners not specific to the source class
            invokeListenersFor(systemEventClass, event, source, null, false);
        } catch (AbortProcessingException ape) {
            context.getApplication().publishEvent(context,
                                                  ExceptionQueuedEvent.class,
                                                  new ExceptionQueuedEventContext(context, ape));
        }

    }
View Full Code Here

     */
    public void handle() throws FacesException {

        for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext(); ) {
            ExceptionQueuedEvent event = i.next();
            ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();
            try {
                Throwable t = context.getException();
                if (isRethrown(t)) {
                    handled = event;
                    Throwable unwrapped = getRootCause(t);

                    if (unwrapped != null) {
                        handlePartialResponseError(context.getContext(), unwrapped);
                    } else {
                        if (t instanceof FacesException) {
                            handlePartialResponseError(context.getContext(), t);
                        } else {
                            handlePartialResponseError(context.getContext(),
                                    new FacesException(t.getMessage(), t));
                        }
                    }
                } else {
                    log(context);
View Full Code Here

    @SuppressWarnings({"ThrowableInstanceNeverThrown"})
    public void handle() throws FacesException {

        for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext(); ) {
            ExceptionQueuedEvent event = i.next();
            ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();
            try {
                Throwable t = context.getException();
                if (isRethrown(t)) {
                    handled = event;
                    Throwable unwrapped = getRootCause(t);
                    if (unwrapped != null) {
                        throwIt(context.getContext(),
                                new FacesException(unwrapped.getMessage(), unwrapped));
                    } else {
                        if (t instanceof FacesException) {
                            throwIt(context.getContext(), (FacesException) t);
                        } else {
                            throwIt(context.getContext(),
                                    new FacesException(t.getMessage(), t));
                        }
                    }
                    if (LOGGER.isLoggable(INCIDENT_ERROR)) {
                        log(context);
View Full Code Here

            if (config.isOptionEnabled(WebConfiguration.BooleanWebContextInitParameter.EnableAgressiveSessionDirtying)) {
                syncSessionScopedBeans(request);
            }
        } catch (Throwable t) {
            FacesContext context = new InitFacesContext(event.getServletContext());
            ExceptionQueuedEventContext eventContext =
                    new ExceptionQueuedEventContext(context, t);
            context.getApplication().publishEvent(context,
                    ExceptionQueuedEvent.class, eventContext);
            context.getExceptionHandler().handle();
        }
        finally {
View Full Code Here

            // create an UpdateModelException and enqueue it since
            // we are not allowed to throw it directly here
            // spec javadoc: The exception must not be re-thrown. This enables tree traversal to
            // continue for this lifecycle phase, as in all the other lifecycle phases.
            UpdateModelException updateModelException = new UpdateModelException(facesMessage, e);
            ExceptionQueuedEventContext exceptionQueuedContext
                    = new ExceptionQueuedEventContext (context, updateModelException, this, PhaseId.UPDATE_MODEL_VALUES);
           
            // spec javadoc says we should call context.getExceptionHandler().processEvent(exceptionQueuedContext),
            // which is not just syntactically wrong, but also stupid!!
            context.getApplication().publishEvent(context, ExceptionQueuedEvent.class, exceptionQueuedContext);
           
View Full Code Here

                source.broadcast(event);
            }
            catch (AbortProcessingException e)
            {
                // publish the Exception to be handled by the ExceptionHandler
                ExceptionQueuedEventContext exceptionContext
                        = new ExceptionQueuedEventContext(context, e, source, context.getCurrentPhaseId());
                context.getApplication().publishEvent(context, ExceptionQueuedEvent.class, exceptionContext);
               
                // Abortion
                return false;
            }
View Full Code Here

                            delegate.unread((int) value.charAt(i));
                        }
                    }
                    catch(ELException e)
                    {
                        ExceptionQueuedEventContext equecontext = new ExceptionQueuedEventContext (context, e, null);
                        context.getApplication().publishEvent (context, ExceptionQueuedEvent.class, equecontext);
                       
                        Logger log = Logger.getLogger(ResourceImpl.class.getName());
                        if (log.isLoggable(Level.SEVERE))
                            log.severe("Cannot evaluate EL expression "+convertToExpression(expressionList)+ " in resource " + (libraryName == null ? "" : libraryName)+":"+resourceName);
View Full Code Here

            // create an UpdateModelException and enqueue it since
            // we are not allowed to throw it directly here
            // spec javadoc: The exception must not be re-thrown. This enables tree traversal to
            // continue for this lifecycle phase, as in all the other lifecycle phases.
            UpdateModelException updateModelException = new UpdateModelException(facesMessage, e);
            ExceptionQueuedEventContext exceptionQueuedContext
                    = new ExceptionQueuedEventContext (context, updateModelException, this, PhaseId.UPDATE_MODEL_VALUES);
           
            // spec javadoc says we should call context.getExceptionHandler().processEvent(exceptionQueuedContext),
            // which is not just syntactically wrong, but also stupid!!
            context.getApplication().publishEvent(context, ExceptionQueuedEvent.class, exceptionQueuedContext);
           
View Full Code Here

            @BeforePhase(INVOKE_APPLICATION)
            public void publishException() {
                FacesContext context = FacesContext.getCurrentInstance();

                context.getApplication().publishEvent(context, ExceptionQueuedEvent.class,
                        new ExceptionQueuedEventContext(context, new IllegalStateException("this should be handled by JSF")));
            }
        });

        Document doc = PartialResponseTestingHelper.getDocument(browser);
View Full Code Here

TOP

Related Classes of javax.faces.event.ExceptionQueuedEventContext

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.