org.cruxframework.crux.core.server.rest.core.dispatch
Class RestErrorHandler

java.lang.Object
  extended by org.cruxframework.crux.core.server.rest.core.dispatch.RestErrorHandler
Direct Known Subclasses:
RestErrorHandlerImpl

public abstract class RestErrorHandler
extends Object

Author:
Thiago da Rosa de Bustamante

Field Summary
protected  Method method
           
 
Constructor Summary
RestErrorHandler()
           
 
Method Summary
protected  Class<?>[] getRestExceptionTypes(Method method)
           
abstract  Object handleError(InvocationTargetException error)
          When an error occurs during a REST service invocation, a RestErrorHandler is called to handle this error.
protected  boolean isCheckedException(Throwable throwable)
           
protected  void setMethod(Method method)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

method

protected Method method
Constructor Detail

RestErrorHandler

public RestErrorHandler()
Method Detail

setMethod

protected void setMethod(Method method)

handleError

public abstract Object handleError(InvocationTargetException error)
                            throws RestFailure
When an error occurs during a REST service invocation, a RestErrorHandler is called to handle this error. This method must take the exception and throw a RestFailure to wrap the error or return an object that will be serialized as response given from the service to the caller.

Parameters:
error -
method -
Returns:
Throws:
RestFailure

getRestExceptionTypes

protected Class<?>[] getRestExceptionTypes(Method method)

isCheckedException

protected boolean isCheckedException(Throwable throwable)


Copyright © 2014. All rights reserved.