Examples of ExceptionQueuedEvent


Examples of javax.faces.event.ExceptionQueuedEvent

    {
        //handle exceptions which occur in a phase-listener (beforePhase) for PhaseId.RENDER_RESPONSE
        //needed because #handle gets called too late in this case
        if (event instanceof ExceptionQueuedEvent)
        {
            ExceptionQueuedEvent exceptionQueuedEvent = (ExceptionQueuedEvent)event;
            FacesContext facesContext = exceptionQueuedEvent.getContext().getContext();

            if (facesContext.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE &&
                exceptionQueuedEvent.getContext().inBeforePhase())
            {
                Throwable exception = getRootCause(exceptionQueuedEvent.getContext().getException());

                ExceptionToCatchEvent exceptionToCatchEvent = new ExceptionToCatchEvent(exception);
                exceptionToCatchEvent.setOptional(true);

                this.beanManager.fireEvent(exceptionToCatchEvent);
View Full Code Here

Examples of javax.faces.event.ExceptionQueuedEvent

     */
    @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);
View Full Code Here

Examples of javax.faces.event.ExceptionQueuedEvent

     * @see javax.faces.context.ExceptionHandlerWrapper#handle()
     */
    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);
View Full Code Here

Examples of javax.faces.event.ExceptionQueuedEvent

     */
    @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);
View Full Code Here

Examples of javax.faces.event.ExceptionQueuedEvent

            do
            {
                // For each ExceptionEvent in the list
               
                // get the event to handle
                ExceptionQueuedEvent event = unhandled.peek();
                try
                {
                    // call its getContext() method
                    ExceptionQueuedEventContext context = event.getContext();
                   
                    // and call getException() on the returned result
                    Throwable exception = context.getException();
                   
                    // Upon encountering the first such Exception that is not an instance of
View Full Code Here

Examples of javax.faces.event.ExceptionQueuedEvent

            do
            {
                // For each ExceptionEvent in the list
               
                // get the event to handle
                ExceptionQueuedEvent event = unhandled.peek();
                try
                {
                    // call its getContext() method
                    ExceptionQueuedEventContext context = event.getContext();
                   
                    // and call getException() on the returned result
                    Throwable exception = context.getException();
                   
                    // Upon encountering the first such Exception that is not an instance of
View Full Code Here

Examples of javax.faces.event.ExceptionQueuedEvent

                do
                {
                    // For each ExceptionEvent in the list
                   
                    // get the event to handle
                    ExceptionQueuedEvent event = unhandled.peek();
                    try
                    {
                        // call its getContext() method
                        ExceptionQueuedEventContext context = event.getContext();
                       
                        // and call getException() on the returned result
                        Throwable exception = context.getException();
                       
                        if (errorHandlerClass != null)
View Full Code Here

Examples of javax.faces.event.ExceptionQueuedEvent

        }
       
        int i = 0;
        for (Iterator<ExceptionQueuedEvent> it = facesContext.getExceptionHandler().getUnhandledExceptionQueuedEvents().iterator(); it.hasNext();)
        {
            ExceptionQueuedEvent eqe = it.next();
            Throwable e = eqe.getContext().getException();
            if (e instanceof AbortProcessingException && e.getCause() == null)
            {
                //Expected
                i++;
            }
View Full Code Here

Examples of javax.faces.event.ExceptionQueuedEvent

        }
       
        int i = 0;
        for (Iterator<ExceptionQueuedEvent> it = facesContext.getExceptionHandler().getUnhandledExceptionQueuedEvents().iterator(); it.hasNext();)
        {
            ExceptionQueuedEvent eqe = it.next();
            Throwable e = eqe.getContext().getException();
            if (e instanceof AbortProcessingException && e.getCause() == null)
            {
                //Expected
                i++;
            }
View Full Code Here

Examples of javax.faces.event.ExceptionQueuedEvent

        //}
       
        int i = 0;
        for (Iterator<ExceptionQueuedEvent> it = facesContext.getExceptionHandler().getUnhandledExceptionQueuedEvents().iterator(); it.hasNext();)
        {
            ExceptionQueuedEvent eqe = it.next();
            Throwable e = eqe.getContext().getException();
            if (e instanceof AbortProcessingException)
            {
                Assert.fail("Unexpected exception queued", e);
            }
            else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.