Spring BlazeDS Integration

org.springframework.flex.core
Class ExceptionTranslationAdvice

java.lang.Object
  extended by org.springframework.flex.core.ExceptionTranslationAdvice
All Implemented Interfaces:
org.aopalliance.aop.Advice, AfterAdvice, ThrowsAdvice

public class ExceptionTranslationAdvice
extends Object
implements ThrowsAdvice

Catches Throwable objects and looks for a registered ExceptionTranslator that knows how to translate them to more specific BlazeDS MessageExceptions to be re-thrown so that a proper AMF error will be sent back to the client.

If the caught object is an instance of MessageException with the generic "Server.Processing" fault code, a translator will be looked up for the root cause exception type rather than the generic wrapper MessageException.

Author:
Jeremy Grelle

Constructor Summary
ExceptionTranslationAdvice()
           
 
Method Summary
 void afterThrowing(Throwable original)
          Apply translation to the thrown exception.
 ExceptionLogger getExceptionLogger()
           
 Set<ExceptionTranslator> getExceptionTranslators()
          Returns the set of provided exception translators
 void setExceptionLogger(ExceptionLogger exceptionLogger)
           
 void setExceptionTranslators(Set<ExceptionTranslator> translators)
          Sets the provided exception translators
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionTranslationAdvice

public ExceptionTranslationAdvice()
Method Detail

afterThrowing

public void afterThrowing(Throwable original)
                   throws Throwable
Apply translation to the thrown exception.

Parameters:
original - the thrown exception
Throws:
Throwable - the translated exception

getExceptionLogger

public ExceptionLogger getExceptionLogger()

setExceptionLogger

public void setExceptionLogger(ExceptionLogger exceptionLogger)

getExceptionTranslators

public Set<ExceptionTranslator> getExceptionTranslators()
Returns the set of provided exception translators

Returns:
the exception translators

setExceptionTranslators

public void setExceptionTranslators(Set<ExceptionTranslator> translators)
Sets the provided exception translators

Parameters:
translators - the exception translators to set

Spring BlazeDS Integration

Copyright © 2011. All Rights Reserved.