public void destroyRequest(@Observes After event, WeldManager manager) {
    BoundRequestContext requestContext = manager.instance().select(BoundRequestContext.class).get();

    CDIRequestMap map = requestMap.get();
    if (map != null) {
      try {
        requestContext.invalidate();
        requestContext.deactivate();
      } finally {
        requestContext.dissociate(map);
        map.clear();
      }
    }
  }
  @Override
  public void requestDestroyed(final ServletRequestEvent evt) {
    final ServletRequest req = evt.getServletRequest();

    @SuppressWarnings("unchecked")
    final Map<String, Object> instanceMap =
        (Map<String, Object>) req.getAttribute(CDI_INSTANCE_MAP);
    final BoundRequestContext ctx = (BoundRequestContext) req.getAttribute(CDI_CONTEXT);

    ctx.invalidate();
    ctx.deactivate();
    ctx.dissociate(instanceMap);

    req.removeAttribute(CDI_CONTEXT);
    req.removeAttribute(CDI_INSTANCE_MAP);
  }