-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathStateManagingProvider.java
More file actions
28 lines (26 loc) · 1.12 KB
/
StateManagingProvider.java
File metadata and controls
28 lines (26 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package dev.openfeature.sdk;
/**
* A provider that manages its own state. The SDK reads state from the provider
* rather than maintaining shadow state. Implementations MUST ensure that
* {@link #getState()} is safe for concurrent access and that state transitions
* and associated event emissions are atomic from the perspective of external observers.
*
* <p>Legacy providers that do not implement this interface continue to have their state
* managed by the SDK (deprecated behavior, to be removed in the next major version).</p>
*
* @see FeatureProvider
* @see EventProvider
*/
public interface StateManagingProvider extends FeatureProvider {
/**
* Returns the current state of this provider. Must reflect {@link ProviderState#NOT_READY}
* before {@link #initialize(EvaluationContext)} is called and after {@link #shutdown()} completes.
* Must reflect {@link ProviderState#READY} if {@link #initialize(EvaluationContext)} returns normally.
*
* <p>This method must be safe for concurrent access.</p>
*
* @return the current provider state
*/
@Override
ProviderState getState();
}