Package org.apache.tapestry5

Examples of org.apache.tapestry5.ExceptionHandlerAssistant


            if (entry.getValue() instanceof Class && ExceptionHandlerAssistant.class.isAssignableFrom((Class) entry.getValue()))
            {
                @SuppressWarnings("unchecked")
                Class<ExceptionHandlerAssistant> handlerType = (Class<ExceptionHandlerAssistant>) entry.getValue();
                ExceptionHandlerAssistant assistant = handlerAssistants.get(handlerType);
                if (assistant == null)
                {
                    assistant = (ExceptionHandlerAssistant) serviceResources.autobuild(handlerType);
                    handlerAssistants.put(handlerType, assistant);
                }
View Full Code Here


        }

        Object[] exceptionContext = formExceptionContext(cause);
        Object value = configuration.get(causeClass);
        Object page = null;
        ExceptionHandlerAssistant assistant = null;
        if (value instanceof ExceptionHandlerAssistant)
        {
            assistant = (ExceptionHandlerAssistant) value;
            // in case the assistant changes the context
            List context = Arrays.asList(exceptionContext);
            page = assistant.handleRequestException(exception, context);
            exceptionContext = context.toArray();
        } else if (!(value instanceof Class))
        {
            renderException(exception);
            return;
View Full Code Here

        response = mockResponse();
        componentClassResolver = mockComponentClassResolver();
        linkSource = mockLinkSource();
        serviceResources = mockServiceResources();
        mockConfiguration.put(AccessControlException.class, MyPage.class);
        mockConfiguration.put(MyContextAwareException.class, new ExceptionHandlerAssistant()
        {
            public Object handleRequestException(Throwable exception, List<Object> exceptionContext)
                    throws IOException
            {
                return null;
View Full Code Here

    }

    @Test
    public void handleRequestExceptionWithConfiguredAssistant() throws IOException
    {
        ExceptionHandlerAssistant assistant = new ExceptionHandlerAssistant()
        {
            public Object handleRequestException(Throwable exception, List<Object> exceptionContext)
                    throws IOException
            {
                return null;
View Full Code Here

            if (entry.getValue() instanceof Class && ExceptionHandlerAssistant.class.isAssignableFrom((Class) entry.getValue()))
            {
                @SuppressWarnings("unchecked")
                Class<ExceptionHandlerAssistant> handlerType = (Class<ExceptionHandlerAssistant>) entry.getValue();
                ExceptionHandlerAssistant assistant = handlerAssistants.get(handlerType);
                if (assistant == null)
                {
                    assistant = (ExceptionHandlerAssistant) serviceResources.autobuild(handlerType);
                    handlerAssistants.put(handlerType, assistant);
                }
View Full Code Here

        }

        Object[] exceptionContext = formExceptionContext(cause);
        Object value = configuration.get(causeClass);
        Object page = null;
        ExceptionHandlerAssistant assistant = null;
        if (value instanceof ExceptionHandlerAssistant)
        {
            assistant = (ExceptionHandlerAssistant) value;
            // in case the assistant changes the context
            List context = Arrays.asList(exceptionContext);
            page = assistant.handleRequestException(exception, context);
            exceptionContext = context.toArray();
        } else if (!(value instanceof Class))
        {
            renderException(exception);
            return;
View Full Code Here

        response = mockResponse();
        componentClassResolver = mockComponentClassResolver();
        linkSource = mockLinkSource();
        serviceResources = mockServiceResources();
        mockConfiguration.put(AccessControlException.class, MyPage.class);
        mockConfiguration.put(MyContextAwareException.class, new ExceptionHandlerAssistant()
        {
            public Object handleRequestException(Throwable exception, List<Object> exceptionContext)
                    throws IOException
            {
                return null;
View Full Code Here

    }

    @Test
    public void handleRequestExceptionWithConfiguredAssistant() throws IOException
    {
        ExceptionHandlerAssistant assistant = new ExceptionHandlerAssistant()
        {
            public Object handleRequestException(Throwable exception, List<Object> exceptionContext)
                    throws IOException
            {
                return null;
View Full Code Here

        response = mockResponse();
        componentClassResolver = mockComponentClassResolver();
        linkSource = mockLinkSource();
        serviceResources = mockServiceResources();
          mockConfiguration.put(AccessControlException.class, MyPage.class);
        mockConfiguration.put(MyContextAwareException.class, new ExceptionHandlerAssistant() {
                      public Object handleRequestException(Throwable exception, List<Object> exceptionContext)
                          throws IOException {
                      return null;
                  }
              });
View Full Code Here

        exceptionHandler.handleRequestException(new AccessControlException("No permission"));
    }
   
    @Test
    public void handleRequestExceptionWithConfiguredAssistant() throws IOException {
        ExceptionHandlerAssistant assistant = new ExceptionHandlerAssistant() {
            public Object handleRequestException(Throwable exception, List<Object> exceptionContext)
                    throws IOException
            {
                return null;
            }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.ExceptionHandlerAssistant

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.