java.lang.Object
io.helidon.webserver.observe.info.InfoObserver
All Implemented Interfaces:
RuntimeType.Api<InfoObserverConfig>, NamedService, Observer

public class InfoObserver extends Object implements Observer, RuntimeType.Api<InfoObserverConfig>
Observer for application information.
  • Method Details

    • builder

      public static InfoObserverConfig.Builder builder()
      Create a new builder to configure Info observer.
      Returns:
      a new builder
    • create

      public static InfoObserver create(InfoObserverConfig config)
      Create a new Info observer using the provided configuration.
      Parameters:
      config - configuration
      Returns:
      a new observer
    • create

      public static InfoObserver create(Consumer<InfoObserverConfig.Builder> consumer)
      Create a new Info observer customizing its configuration.
      Parameters:
      consumer - configuration consumer
      Returns:
      a new observer
    • create

      public static InfoObserver create()
      Create a new Info observer with default configuration.
      Returns:
      a new observer
    • prototype

      public InfoObserverConfig prototype()
      Description copied from interface: Observer
      Configuration of this observer.
      Specified by:
      prototype in interface Observer
      Specified by:
      prototype in interface RuntimeType.Api<InfoObserverConfig>
      Returns:
      configuration of the observer
    • type

      public String type()
      Description copied from interface: Observer
      Type of this observer, to make sure we do not configure an observer both from ServiceLoader and using programmatic approach. If it is desired to have more than one observer of the same type, always use programmatic approach
      Specified by:
      type in interface NamedService
      Specified by:
      type in interface Observer
      Returns:
      type of this observer, should match ObserveProvider.type()
    • register

      public void register(ServerFeature.ServerFeatureContext featureContext, List<HttpRouting.Builder> observeEndpointRouting, UnaryOperator<String> endpointFunction)
      Description copied from interface: Observer
      Register the observer features, services, and/or filters. This is used by the observe feature. Do NOT use this method directly, kindly start with ObserveFeature and register it with the server builder.

      Implementations of observers should register all they need through an HttpFeature, to make sure the weight of the ObserveFeature is honored when routing is set up. If you do not use an HttpFeature, the registration will always happen later than the default (business) routing feature.

      Specified by:
      register in interface Observer
      Parameters:
      featureContext - access to all routing builders, for cases where this observer needs to register additional components to other sockets
      observeEndpointRouting - routing builders that expose observability endpoints, and this feature must use these to register any endpoints exposed for observability
      endpointFunction - function to obtain the final endpoint for observers that expose observe endpoints (such as /observe/health would be provider for health by default)