Examples of ExceptionToCatchEvent


Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

                    iterator.remove();
                    continue;
                }
                else
                {
                    ExceptionToCatchEvent event = new ExceptionToCatchEvent(rootCause, exceptionQualifier);
                    event.setOptional(true);

                    beanManager.fireEvent(event);

                    if (event.isHandled())
                    {
                        iterator.remove();
                    }
                }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

                {
                    processAccessDeniedException(exception);
                }
                else
                {
                    ExceptionToCatchEvent exceptionToCatchEvent = new ExceptionToCatchEvent(exception);
                    exceptionToCatchEvent.setOptional(true);

                    this.beanManager.fireEvent(exceptionToCatchEvent);

                    if (exceptionToCatchEvent.isHandled())
                    {
                        return;
                    }
                }
            }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    @Inject
    private BeanManager beanManager;

    public Throwable broadcastAccessDeniedException(AccessDeniedException accessDeniedException)
    {
        ExceptionToCatchEvent exceptionToCatchEvent = new ExceptionToCatchEvent(accessDeniedException);

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

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

     * @param originalException exception thrown by an authorizer
     * @return the original exception if the default behavior was changed and the exception is unhandled
     */
    protected RuntimeException handleAccessDeniedException(AccessDeniedException originalException)
    {
        ExceptionToCatchEvent exceptionToCatchEvent = new ExceptionToCatchEvent(originalException);
        this.beanManager.fireEvent(exceptionToCatchEvent);
        return originalException;
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

   *
   * @param t
   *            The throwable to handle
   */
  protected void handleThrowable(Throwable t) {
    catchEvent.fire(new ExceptionToCatchEvent(t));
  }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    private Event<ExceptionToCatchEvent> exceptionEvent;

    public void validOS(final String os) {
        if (os.toLowerCase().contains("win")) {
            final Exception ex = new OSRuntimeException(); // can be a caugh exceptino
            exceptionEvent.fire(new ExceptionToCatchEvent(ex));
        }
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

                while (iterator.hasNext())
                {
                    Throwable throwable = iterator.next().getContext().getException();
                    Throwable rootCause = getRootCause(throwable);

                    ExceptionToCatchEvent event = new ExceptionToCatchEvent(rootCause, exceptionQualifier);

                    beanManager.fireEvent(event);

                    if (event.isHandled())
                    {
                        iterator.remove();
                    }

                    // a handle method might redirect and set responseComplete
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    private int qualiferCalledCount = 0;

    @Test
    public void assertEventIsCreatedCorrectly()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new NullPointerException()));
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    }

    @Test
    public void assertEventWithQualifiersIsCreatedCorrectly()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new NullPointerException(), new EventQualifierLiteral()));
    }
View Full Code Here

Examples of org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent

    private BeanManager bm;

    @Test(expected = NullPointerException.class)
    public void assertOutboundRethrow()
    {
        bm.fireEvent(new ExceptionToCatchEvent(new NullPointerException()));
    }
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.