Exemplo n.º 1
0
  /** @param orgIn */
  private void publishUpdateErrataCacheEvent(Org orgIn) {
    StopWatch sw = new StopWatch();
    if (log.isDebugEnabled()) {
      log.debug("Updating errata cache");
      sw.start();
    }

    UpdateErrataCacheEvent uece = new UpdateErrataCacheEvent(UpdateErrataCacheEvent.TYPE_ORG);
    uece.setOrgId(orgIn.getId());
    MessageQueue.publish(uece);

    if (log.isDebugEnabled()) {
      sw.stop();
      log.debug("Finished Updating errata cache. Took [" + sw.getTime() + "]");
    }
  }
  /** Custom Handler for HibernateLookupExceptions {@inheritDoc} */
  public ActionForward execute(
      Exception ex,
      ExceptionConfig exConfig,
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws ServletException {
    response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
    request.setAttribute("error", ex);
    Logger log = Logger.getLogger(PermissionExceptionHandler.class);
    log.error("Permission Error", ex);

    TraceBackEvent evt = new TraceBackEvent();
    RequestContext requestContext = new RequestContext(request);
    User usr = requestContext.getLoggedInUser();
    evt.setUser(usr);
    evt.setRequest(request);
    evt.setException(ex);
    MessageQueue.publish(evt);

    return super.execute(ex, exConfig, mapping, form, request, response);
  }