public interface RequestContextAccessor
RequestContext
objects. It's preferred to use it via RequestContext.getCurrent(CdsRuntime)
.
The implementation of the factory is loaded via Java's ServiceLoader
and is therefore pluggable.Modifier and Type | Field and Description |
---|---|
static RequestContextAccessor |
INSTANCE
The instance loaded via Java's
ServiceLoader , used by RequestContext.getCurrent(CdsRuntime) |
Modifier and Type | Method and Description |
---|---|
RequestContext |
getCurrent(CdsRuntime runtime)
Gives access to either the current
RequestContext ,
or if this does not exist to a helper RequestContext that itself ensures that there is always a RequestContext opened. |
boolean |
isActive() |
static final RequestContextAccessor INSTANCE
ServiceLoader
, used by RequestContext.getCurrent(CdsRuntime)
boolean isActive()
RequestContext
is currently activeRequestContext getCurrent(CdsRuntime runtime)
RequestContext
,
or if this does not exist to a helper RequestContext
that itself ensures that there is always a RequestContext
opened.
This method will throw a NullPointerException
, if the passed CdsRuntime
was null, but guarantees that it will never return null
runtime
- A reference to the underlying CdsRuntime
instance.RequestContext
or a helper RequestContext
Copyright © 2020. All rights reserved.