org.jboss.seam.rest.exceptions.integration
Class CatchExceptionMapper

java.lang.Object
  extended by org.jboss.seam.rest.exceptions.SeamExceptionMapper
      extended by org.jboss.seam.rest.exceptions.integration.CatchExceptionMapper
All Implemented Interfaces:
ExceptionMapper<Throwable>

@ApplicationScoped
@HandlesExceptions
@Specializes
public class CatchExceptionMapper
extends SeamExceptionMapper
implements ExceptionMapper<Throwable>

A JAX-RS ExceptionMapper implementation that maps all exceptions (i.e., Throwable) raised during a JAX-RS request to the Seam Catch exception handling bus.

Exceptions are send to Seam Catch by firing an event of type ExceptionToCatch to the CDI event bus. The event payload contains the exception and the qualifier @RestRequest. The qualifier allows handlers that deal specifically with REST requests to be selected.

Author:
Dan Allen, Jozef Hartinger

Constructor Summary
CatchExceptionMapper()
           
 
Method Summary
 void handleException(CaughtException<Throwable> event, Response.ResponseBuilder builder)
           
 Response toResponse(Throwable exception)
           
 
Methods inherited from class org.jboss.seam.rest.exceptions.SeamExceptionMapper
addExceptionMapping, createEntityBody, createMessage, getMappings, init, init, produceResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatchExceptionMapper

public CatchExceptionMapper()
Method Detail

toResponse

public Response toResponse(Throwable exception)
Specified by:
toResponse in interface ExceptionMapper<Throwable>
Overrides:
toResponse in class SeamExceptionMapper

handleException

public void handleException(@Handles(precedence=-100,during=DEPTH_FIRST)
                            CaughtException<Throwable> event,
                            @RestResource
                            Response.ResponseBuilder builder)


Copyright © 2011 Seam Framework. All Rights Reserved.