Class ManagedAnnotationUsage.RemoteConsumer

java.lang.Object
org.j7m.middleware.examples.annotation.ManagedAnnotationUsage.RemoteConsumer
Enclosing class:
ManagedAnnotationUsage

public static final class ManagedAnnotationUsage.RemoteConsumer extends Object
Demonstrates explicit optional availability rather than a null injected service.
  • Constructor Details

    • RemoteConsumer

      public RemoteConsumer(org.j7m.middleware.application.api.ManagedProvider<Optional<ManagedAnnotationUsage.RemoteApi>> remote)
      Receives a host-authorized optional binding; the annotation installs no policy itself.
      Parameters:
      remote - typed optional service provider using the host's optional policy
      Throws:
      NullPointerException - if the provider is absent
  • Method Details

    • greetOrFallback

      public String greetOrFallback(String name)
      Calls an available service or reports explicit absence.
      Parameters:
      name - display text
      Returns:
      remote greeting, or an application-owned fallback