WebSessionCache: Make response parameter optional
Since I255661a62 WebSession was replaced with DynamicItem<WebSession>
in HttpRequestContext to enable plugins to provider alternative
implementations of cached web session functionality.
One side efect of it is, that now code that is using RequestScopePropagator
(with the only available implementation of GuiceRequestScopePropagator)
unable to get H2CacheBasedWebSession injected, because it relies on
ServletScopes.continueRequest() which doesn't expose HTTP response in the
continued request scope:
return new Callable<T>() {
public T call() throws Exception {
checkScopingState(null == GuiceFilter.localContext.get(),
"Cannot continue request in the same thread as a HTTP request!");
return new GuiceFilter.Context(continuingRequest, continuingRequest,
null)
.call(callable);
}
};
Given that request scope propagation feature is primarly targeting
background tasks, make response parameter in CacheBasedWebSession
optional and adjust the code to handle this case properly.
Change-Id: Iaa5dc15f294a07b83a2411e9f29872df3a82b324
2 files changed