java.lang.Object
io.helidon.inject.api.CallingContextFactory
Factory for creating
CallingContext
and builders for the calling context.
After a calling context builder is created, it should be amended with as much contextual information as possible, and then
optionally set globally using globalCallingContext(CallingContext, boolean)
.-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional
<io.helidon.inject.api.CallingContext> create
(boolean force) Creates a new calling context instance.static Optional
<io.helidon.inject.api.CallingContext.Builder> createBuilder
(boolean force) Creates a new calling context builder instance.static void
globalCallingContext
(io.helidon.inject.api.CallingContext callingContext, boolean throwIfAlreadySet) Sets the default global calling context.
-
Method Details
-
globalCallingContext
public static void globalCallingContext(io.helidon.inject.api.CallingContext callingContext, boolean throwIfAlreadySet) Sets the default global calling context.- Parameters:
callingContext
- the default global contextthrowIfAlreadySet
- should an exception be thrown if the global calling context was already set- Throws:
IllegalStateException
- if context was already set and the throwIfAlreadySet is active
-
create
Creates a new calling context instance. Normally this method will return a context optionally only when debug is enabled. This behavior can be overridden by passing theforce=true
flag.- Parameters:
force
- forces the creation of the calling context even when debug is disabled- Returns:
- a new calling context if there is an indication that debug mode is enabled, or if the force flag is set
- See Also:
-
createBuilder
Creates a new calling context builder instance. Normally this method will return a context builder optionally only when debug is enabled. This behavior can be overridden by passing theforce=true
flag.- Parameters:
force
- forces the creation of the calling context even when debug is disabled- Returns:
- a new calling context builder if there is an indication that debug mode is enabled, or if the force flag is set
- See Also:
-