Class FeatureRepositoryProvider
java.lang.Object
growthbook.sdk.java.multiusermode.internal.FeatureRepositoryProvider
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.
Provides the feature repository owned by GrowthBookClient.
This class hides lazy repository creation, initialization reuse, failed-initialization retry, and shutdown cleanup from the public client facade.
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureRepositoryProvider(Options options, Consumer<GBFeaturesRepository> configureRepository, Consumer<GBFeaturesRepository> onRepositoryReady) Creates a provider using the default GrowthBook repository factory. -
Method Summary
Modifier and TypeMethodDescriptionReturns the initialized repository when available.Initializes the repository if needed and returns the initialized repository.voidshutdown()Detaches and shuts down the current repository.
-
Constructor Details
-
FeatureRepositoryProvider
public FeatureRepositoryProvider(Options options, Consumer<GBFeaturesRepository> configureRepository, Consumer<GBFeaturesRepository> onRepositoryReady) Creates a provider using the default GrowthBook repository factory.- Parameters:
options- client options used to create the repositoryconfigureRepository- callback invoked before repository initializationonRepositoryReady- callback invoked after repository initialization succeeds
-
-
Method Details
-
initialize
Initializes the repository if needed and returns the initialized repository.- Returns:
- initialized repository, or null when initialization failed or was cancelled
-
lastInitializationError
- Returns:
- the cause of the most recent failed initialization, or
nullwhen the last initialization succeeded (or none has run). Used to surface repository init failures in client diagnostics, sinceinitialize()intentionally swallows them.
-
currentRepository
Returns the initialized repository when available.- Returns:
- initialized repository, or null when the client is not ready
-
shutdown
public void shutdown()Detaches and shuts down the current repository.
-