Class GlobalContextManager

java.lang.Object
growthbook.sdk.java.multiusermode.internal.GlobalContextManager

public final class GlobalContextManager extends Object
INTERNAL: not part of the supported API. Public only because GrowthBookClient lives in the parent package — treat its signatures as free to change without a major version bump. Internal coordinator for the client-level GlobalContext. Keeps feature state updates and evaluation context creation outside the public facade.
  • Constructor Details

    • GlobalContextManager

      public GlobalContextManager(Options options)
      Creates a manager bound to the client options instance.
      Parameters:
      options - client options used to build evaluation contexts
  • Method Details

    • initialize

      public void initialize(GBFeaturesRepository repository)
      Replaces the managed context with feature data from the initialized repository.
      Parameters:
      repository - initialized feature repository
    • refresh

      public void refresh(GBFeaturesRepository repository)
      Updates feature and saved-group data after a repository refresh.
      Parameters:
      repository - repository containing the latest parsed feature data
    • createEvaluationContext

      public EvaluationContext createEvaluationContext(UserContext userContext)
      Creates an evaluation context for a specific user by overlaying user attributes on global attributes.
      Parameters:
      userContext - per-user evaluation context
      Returns:
      evaluation context used by feature and experiment evaluators
    • featureCount

      public int featureCount()
      Returns:
      number of features in the current global context (0 when uninitialized).