Class CallingContextFactory

java.lang.Object
io.helidon.inject.api.CallingContextFactory

public class CallingContextFactory extends Object
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 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 context
      throwIfAlreadySet - 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

      public static Optional<io.helidon.inject.api.CallingContext> create(boolean force)
      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 the force=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:
      • InjectionServicesConfigBlueprint.debug()
    • createBuilder

      public static Optional<io.helidon.inject.api.CallingContext.Builder> createBuilder(boolean force)
      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 the force=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:
      • InjectionServicesConfigBlueprint.debug()