File tree Expand file tree Collapse file tree
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright The OpenTelemetry Authors
3+ * SPDX-License-Identifier: Apache-2.0
4+ */
5+
6+ package io .opentelemetry .contrib .dynamic .policy ;
7+
8+ import io .opentelemetry .sdk .autoconfigure .spi .AutoConfigurationCustomizer ;
9+ import javax .annotation .Nonnull ;
10+
11+ /**
12+ * NOTE PolicyInit not yet added - remove this note when it is added
13+ *
14+ * <p>Initializes one policy type and returns the implementer that applies that type at runtime.
15+ *
16+ * <p>This is used by {@code
17+ * io.opentelemetry.contrib.dynamic.policy.registry.PolicyInit.registerPolicyType(...)} and is
18+ * typically provided as a method reference, for example:
19+ *
20+ * <pre>{@code
21+ * io.opentelemetry.contrib.dynamic.policy.registry.PolicyInit.registerPolicyType(
22+ * TraceSamplingRatePolicy.POLICY_TYPE,
23+ * TraceSamplingRatePolicy.class,
24+ * TraceSamplingRatePolicy::initialize);
25+ * }</pre>
26+ */
27+ @ FunctionalInterface
28+ public interface PolicyTypeInitializer {
29+ /**
30+ * Initializes policy runtime wiring for one policy type.
31+ *
32+ * @param autoConfiguration OpenTelemetry auto-configuration customizer
33+ * @return non-null implementer for the policy type
34+ */
35+ @ Nonnull
36+ PolicyImplementer initialize (AutoConfigurationCustomizer autoConfiguration );
37+ }
You can’t perform that action at this time.
0 commit comments