Skip to content

Commit

Permalink
a new batch addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
trentjeff committed Mar 29, 2023
1 parent 33f3a76 commit 834d733
Show file tree
Hide file tree
Showing 50 changed files with 937 additions and 895 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,27 @@
import io.helidon.common.LazyValue;

/**
* Provides access to the active {@link io.helidon.builder.config.spi.BasicConfigBeanRegistry} instance.
* Provides access to the active {@link HelidonConfigBeanRegistry} instance.
*
* @see BasicConfigBeanRegistry
* @see HelidonConfigBeanRegistry
*/
public class ConfigBeanRegistryHolder {
private static final LazyValue<Optional<BasicConfigBeanRegistry>> INSTANCE = LazyValue.create(ConfigBeanRegistryHolder::load);
private static final LazyValue<Optional<HelidonConfigBeanRegistry>> INSTANCE
= LazyValue.create(ConfigBeanRegistryHolder::load);

private ConfigBeanRegistryHolder() {
}

/**
* Provides the global service-loader instance of {@link BasicConfigBeanRegistry}.
* Provides the global service-loader instance of {@link HelidonConfigBeanRegistry}.
*
* @return the config bean registry
*/
public static Optional<BasicConfigBeanRegistry> configBeanRegistry() {
public static Optional<HelidonConfigBeanRegistry> configBeanRegistry() {
return INSTANCE.get();
}

private static Optional<BasicConfigBeanRegistry> load() {
private static Optional<HelidonConfigBeanRegistry> load() {
return HelidonServiceLoader
.create(ServiceLoader.load(ConfigBeanRegistryProvider.class, ConfigBeanRegistryProvider.class.getClassLoader()))
.asList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
package io.helidon.builder.config.spi;

/**
* Java {@link java.util.ServiceLoader} provider interface for delivering the {@link BasicConfigBeanRegistry} instance.
* Java {@link java.util.ServiceLoader} provider interface for delivering the {@link HelidonConfigBeanRegistry} instance.
*
* @see ConfigBeanMapperHolder
*/
@FunctionalInterface
public interface ConfigBeanRegistryProvider {

/**
* The service-loaded global {@link BasicConfigBeanRegistry} instance.
* The service-loaded global {@link HelidonConfigBeanRegistry} instance.
*
* @return the global config bean registry instance
*/
BasicConfigBeanRegistry configBeanRegistry();
HelidonConfigBeanRegistry configBeanRegistry();

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* The highest weighted service-loaded instance of this contract will be responsible for managing the active
* {@link io.helidon.builder.config.ConfigBean} instances running in the JVM.
*/
public interface BasicConfigBeanRegistry {
public interface HelidonConfigBeanRegistry {

/**
* Returns all config beans indexed by its config key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@Singleton
@Weight(Weighted.DEFAULT_WEIGHT - 1) // allow all other creators to take precedence over us...
@SuppressWarnings({"unchecked", "rawtypes"})
public class BasicConfigResolver implements ConfigResolver, ConfigResolverProvider {
public class HelidonConfigResolver implements ConfigResolver, ConfigResolverProvider {

/**
* Tag that represents meta information about the attribute. Used in the maps for various methods herein.
Expand All @@ -60,7 +60,7 @@ public class BasicConfigResolver implements ConfigResolver, ConfigResolverProvid
* @deprecated needed for Java service loader
*/
@Deprecated
public BasicConfigResolver() {
public HelidonConfigResolver() {
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion builder/builder-config/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
exports io.helidon.builder.config.spi;

provides io.helidon.builder.config.spi.ConfigResolverProvider
with io.helidon.builder.config.spi.BasicConfigResolver;
with io.helidon.builder.config.spi.HelidonConfigResolver;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1830,10 +1830,7 @@ private String quotedTupleOf(TypeName valType,
boolean isEnumLikeType = isEnumLikeType(valType, key, val);
if (isEnumLikeType) {
val = valType + "." + val;
} else if (key.equals("value") && val.startsWith(ConfiguredOption.class.getName())) {
// NOP; process this as-is
assert (true); // for setting breakpoints in debug
} else {
} else if (!key.equals("value") || !val.startsWith(ConfiguredOption.class.getName())) {
val = quotedValueOf(val);
}
return quotedValueOf(key) + ", " + val;
Expand Down
4 changes: 2 additions & 2 deletions pico/api/src/main/java/io/helidon/pico/ActivationResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.concurrent.Future;

import io.helidon.builder.Builder;
import io.helidon.pico.spi.BasicInjectionPlan;
import io.helidon.pico.spi.InjectionPlan;

/**
* Represents the result of a service activation or deactivation.
Expand Down Expand Up @@ -81,7 +81,7 @@ public interface ActivationResult {
*
* @return the resolved injection plan map
*/
Map<String, ? extends BasicInjectionPlan> injectionPlans();
Map<String, ? extends InjectionPlan> injectionPlans();

/**
* The dependencies that were resolved or loaded, key'ed by each element's {@link ServiceProvider#id()}.
Expand Down
4 changes: 2 additions & 2 deletions pico/api/src/main/java/io/helidon/pico/Injector.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ enum Strategy {
* {@link Phase#ACTIVE}.
*
* @param serviceOrServiceProvider the target instance or service provider being activated and injected
* @param opts the injector options, or use {@link InjectorOptions#DEFAULT}
* @param opts the injector options
* @param <T> the managed service type
* @return the result of the activation
* @throws io.helidon.pico.PicoServiceProviderException if an injection or activation problem occurs
Expand All @@ -69,7 +69,7 @@ <T> ActivationResult activateInject(T serviceOrServiceProvider,
* this lifecycle event.
*
* @param serviceOrServiceProvider the service provider or instance registered and being managed
* @param opts the injector options, or use {@link InjectorOptions#DEFAULT}
* @param opts the injector options
* @param <T> the managed service type
* @return the result of the deactivation
* @throws io.helidon.pico.PicoServiceProviderException if a problem occurs
Expand Down
15 changes: 6 additions & 9 deletions pico/api/src/main/java/io/helidon/pico/InjectorOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import io.helidon.builder.Builder;
import io.helidon.builder.BuilderInterceptor;
import io.helidon.common.LazyValue;
import io.helidon.config.metadata.ConfiguredOption;

/**
Expand All @@ -27,33 +26,31 @@
* @see Injector
*/
@Builder(interceptor = InjectorOptions.Interceptor.class)
public interface InjectorOptions {
public abstract class InjectorOptions {

/**
* Default options.
*/
LazyValue<InjectorOptions> DEFAULT = LazyValue.create(() -> DefaultInjectorOptions.builder().build());
InjectorOptions() {
}

/**
* The strategy the injector should apply. The default is {@link Injector.Strategy#ANY}.
*
* @return the injector strategy to use
*/
@ConfiguredOption("ANY")
Injector.Strategy strategy();
public abstract Injector.Strategy strategy();

/**
* Optionally, customized activator options to use for the {@link io.helidon.pico.Activator}.
*
* @return activator options, or leave blank to use defaults
*/
ActivationRequest activationRequest();
public abstract ActivationRequest activationRequest();


/**
* This will ensure that the activation request is populated.
*/
class Interceptor implements BuilderInterceptor<DefaultInjectorOptions.Builder> {
static class Interceptor implements BuilderInterceptor<DefaultInjectorOptions.Builder> {
Interceptor() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.util.List;
import java.util.Map;
import java.util.Optional;

import io.helidon.builder.Builder;
import io.helidon.common.types.AnnotationAndValue;
Expand Down Expand Up @@ -65,7 +66,7 @@ public interface InvocationContext {
*
* @return the method/element argument info
*/
TypedElementName[] elementArgInfo();
Optional<TypedElementName[]> elementArgInfo();

/**
* The interceptor chain.
Expand Down
4 changes: 2 additions & 2 deletions pico/api/src/main/java/io/helidon/pico/Metrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
public interface Metrics {

/**
* The total services in the registry.
* The total service count in the registry.
*
* @return total service count
*/
Optional<Integer> services();
Optional<Integer> serviceCount();

/**
* The total number of {@code Services::lookup()} calls since jvm start, or since last reset.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Represents the injection plan targeting a given {@link io.helidon.pico.ServiceProvider}.
*/
@Builder
public interface BasicInjectionPlan {
public interface InjectionPlan {

/**
* The service provider this plan pertains to.
Expand Down
Loading

0 comments on commit 834d733

Please sign in to comment.