* it will throw a SimpleException ...
*/
public class CheckedExceptionPreProcInterceptor implements ExecutionPreProcessor {
@Override
public InterceptorResult invoke(ExecutionContext ctx, OperationKey key, Object[] args) {
InterceptorResult result;
if (key.getOperationName().equals("interceptorCheckedExceptionOperation") &&
((PreOrPostInterceptorException)args[0]) == PreOrPostInterceptorException.PRE) {
result = new InterceptorResult(InterceptorState.FORCE_ON_EXCEPTION,
new SimpleException(ResponseCode.BadRequest,
SimpleExceptionErrorCodeEnum.GENERIC,
"An anticipated pre-execution BSIDL defined checked exception"));
} else {
result = new InterceptorResult(InterceptorState.CONTINUE);
}
return result;
}