Examples of toResponse()


Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

    public static Response convertFaultToResponse(Throwable ex, Message inMessage) {
       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            Response excResponse = mapper.toResponse(ex);
            if (excResponse != null) {
                return excResponse;
            }
        } else if (ex instanceof WebApplicationException) {
            WebApplicationException wex = (WebApplicationException)ex;
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            try {
                return mapper.toResponse(ex);
            } catch (Exception mapperEx) {
                mapperEx.printStackTrace();
                return Response.serverError().build();
            }
        }
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            try {
                return mapper.toResponse(ex);
            } catch (Exception mapperEx) {
                mapperEx.printStackTrace();
                return Response.serverError().build();
            }
        }
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

            }
            if (errorResponse.getEntity() == null)
            {
               if (excmap != null)
               {
                  errorResponse = excmap.toResponse(e);
               }
               else
               {
                  if (e.getMessage() != null)
                  {
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

               if (LOG.isDebugEnabled())
               {
                  // Hide error message if exception mapper exists.
                  LOG.warn("Internal error occurs.", cause);
               }
               response.setResponse(excmap.toResponse(e.getCause()));
            }
            else
            {
               LOG.error("Internal error occurs.", cause);
               throw new UnhandledException(e.getCause());
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

            HttpResponseContext response) {
        ExceptionMapper em = exceptionFactory.find(e.getClass());
        if (em == null) return false;

        try {
            Response r = em.toResponse(e);
            if (r == null)
                r = Response.noContent().build();
            onException(e, r, response);
        } catch (RuntimeException ex) {
            LOGGER.severe("Exception mapper " + em +
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            try {
                return mapper.toResponse(ex);
            } catch (Exception mapperEx) {
                mapperEx.printStackTrace();
                return Response.serverError().build();
            }
        }
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            try {
                return mapper.toResponse(ex);
            } catch (Exception mapperEx) {
                mapperEx.printStackTrace();
                return Response.serverError().build();
            }
        }
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

                    ReflectionHelper.objectToString(e),
                    ReflectionHelper.objectToString(em)));
        }

        try {
            Response r = em.toResponse(e);
            if (r == null)
                r = Response.noContent().build();
            onException(e, r, true);
        } catch (MappableContainerException ex) {
            // If the exception mapper throws a MappableContainerException then
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

    public Response toResponse(EJBException exception) {
        final Exception cause = exception.getCausedByException();
        if (cause != null) {
            final ExceptionMapper mapper = providers.getExceptionMapper(cause.getClass());
            if (mapper != null) {
                return mapper.toResponse(cause);
            } else if (cause instanceof WebApplicationException) {
                return ((WebApplicationException)cause).getResponse();
            }
        }
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.