Added the RequestContext for the scope.

The RequestContext attempts to make data that is normally RequestScoped
available in a non-RequestScoped context. Request scoping of the
RequestContext is facilitated by the ThreadLocalRequestContext, using
a ThreadLocal to setup the context, similar to the normal way
request scopes work. However, if there is no RequestContext set, the
a default FallbackRequestContext is used, instead of throwing an
OutOfScope exception.

The motivation for this change was prompted by the new GroupBackend
system needing to know the current user in a Singleton context, without
passing the current user through the method.

Change-Id: Ifd7745bec0d4b22dfc98b9a0d18cfd7138bc3375
3 files changed