* @param originalException exception thrown by an authorizer
* @return the original exception if the default behavior was changed and the exception is unhandled
*/
protected RuntimeException handleAccessDeniedException(AccessDeniedException originalException)
{
ExceptionToCatchEvent exceptionToCatchEvent = new ExceptionToCatchEvent(originalException);
this.beanManager.fireEvent(exceptionToCatchEvent);
//the next step won't happen per default since ExceptionHandlerBroadcaster will throw the exception,
//because BeforeAccessDeniedExceptionHandler calls #throwOriginal
//but allows to suppress it via deactivating BeforeAccessDeniedExceptionHandler
//(or a 2nd @BeforeHandles method which overrules the default behavior
//(if needed)
if (!exceptionToCatchEvent.isHandled())
{
throw originalException;
}
return null;