class HttpRequestWrapper extends HttpServletRequestWrapper implements RequestWithSession {

  @Override
  public RepositoryBackedHttpSession getRepositoryBackedSession(boolean create) {
    if (committed) {
      throw new IllegalStateException("Session was already committed.");
    }
    boolean wasNotCreated = session == null;
    retrieveSessionIfNeeded(create);
    // Only propagate session if this is the "outer" session, i.e. the one that
    // created the session closest to the client
    if (wasNotCreated && propagateOnCreate) {
      doPropagateAndStoreIfFirstWrapper();
    }
    return session;
  }

  public  HttpRequestWrapper(HttpServletRequest req, ServletContext servletContext);

}