Package javax.faces.event

Examples of javax.faces.event.ExceptionQueuedEventContext


                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


                            MessageUtil.getLabel(context, this));
                }
                if (caught != null) {
                    assert (message != null);
                    UpdateModelException toQueue = new UpdateModelException(message, caught);
                    ExceptionQueuedEventContext eventContext = new ExceptionQueuedEventContext(context, toQueue, this,
                            PhaseId.UPDATE_MODEL_VALUES);
                    context.getApplication().publishEvent(context, ExceptionQueuedEvent.class, eventContext);
                }
            } else {
                treeNodeComponent.setExpanded(newExpandedValue);
View Full Code Here

        }
    }
   
    private void publishException (Throwable e, PhaseId phaseId, FacesContext facesContext)
    {
        ExceptionQueuedEventContext context = new ExceptionQueuedEventContext (facesContext, e, null, phaseId);
       
        facesContext.getApplication().publishEvent (facesContext, ExceptionQueuedEvent.class, context);
    }
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))
View Full Code Here

    }
   
    private void publishException (Throwable e, PhaseId phaseId, String key)
    {
        ExceptionQueuedEventContext context = new ExceptionQueuedEventContext (facesContext, e, null, phaseId);
       
        context.getAttributes().put (key, Boolean.TRUE);
       
        facesContext.getApplication().publishEvent (facesContext, ExceptionQueuedEvent.class, context);
    }
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
                eventsAborted.add(event);
            }
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

        lazyInit();
        Iterator<ExceptionQueuedEvent> exceptionQueuedEventIterator = getUnhandledExceptionQueuedEvents().iterator();

        while (exceptionQueuedEventIterator.hasNext())
        {
            ExceptionQueuedEventContext exceptionQueuedEventContext =
                    (ExceptionQueuedEventContext) exceptionQueuedEventIterator.next().getSource();

            @SuppressWarnings({ "ThrowableResultOfMethodCallIgnored" })
            Throwable throwable = exceptionQueuedEventContext.getException();

            String viewId = null;

            if (!isExceptionToHandle(throwable))
            {
                continue;
            }

            FacesContext facesContext = exceptionQueuedEventContext.getContext();
            Flash flash = facesContext.getExternalContext().getFlash();

            if (throwable instanceof ViewExpiredException)
            {
                viewId = ((ViewExpiredException) throwable).getViewId();
View Full Code Here

                        }
                    });
        } catch (AbortProcessingException e) {
            facesContext.getApplication().publishEvent(facesContext,
                    ExceptionQueuedEvent.class,
                    new ExceptionQueuedEventContext(facesContext,
                    e,
                    null,
                    PhaseId.RESTORE_VIEW));
        } finally {
            // PENDING: This is included for those component frameworks that don't utilize the
View Full Code Here

  public static void handleExceptions(FacesContext facesContext) {
    facesContext.getExceptionHandler().handle();
  }

  public static void publishException(Throwable e, PhaseId phaseId, FacesContext facesContext) {
    ExceptionQueuedEventContext context = new ExceptionQueuedEventContext(facesContext, e, null, phaseId);
    facesContext.getApplication().publishEvent(facesContext, ExceptionQueuedEvent.class, context);
  }
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.