@Override public void onEvent(RequestEvent event) { switch (event.getType()) { case ON_EXCEPTION: Throwable t = event.getException(); logger.log(Level.SEVERE, "Found exception for requestType: " + event.getType(), t); } }
@Override public void onEvent(RequestEvent event) { if (event.getType() == RequestEvent.Type.RESOURCE_METHOD_START) { UnitOfWork unitOfWork = methodMap.get( event.getUriInfo().getMatchedResourceMethod().getInvocable().getDefinitionMethod()); unitOfWorkAspect.beforeStart(unitOfWork); } else if (event.getType() == RequestEvent.Type.RESP_FILTERS_START) { try { unitOfWorkAspect.afterEnd(); } catch (Exception e) { throw new MappableException(e); } } else if (event.getType() == RequestEvent.Type.ON_EXCEPTION) { unitOfWorkAspect.onError(); } }