Class ManagedAnnotationUsage

java.lang.Object
org.j7m.middleware.examples.annotation.ManagedAnnotationUsage

@J7mComponent @Scope(ACTIVATION) public final class ManagedAnnotationUsage extends Object
Ordinary application objects consumed by the optional managed annotation processor/container. This API-only reference declares metadata; it does not implement a container, discovery or codec. A host supplies configuration and the explicitly registered optional service-binding policy.
  • Constructor Details

  • Method Details

    • greet

      public String greet(String name)
      Formats a greeting using injected configuration and the qualified product.
      Parameters:
      name - caller-supplied display text
      Returns:
      greeting containing the configured region
    • attempts

      public int attempts()
      Returns the typed configuration value captured for this activation.
      Returns:
      configured positive attempt limit
    • formatter

      @Produces @Scope(PROTOTYPE) public static ManagedAnnotationUsage.Formatter formatter()
      Produces a new immutable product for each prototype resolution without a factory receiver.
      Returns:
      formal formatter owned by the resolving managed scope
    • consumer

      @Produces public static ManagedAnnotationUsage.RemoteConsumer consumer(@ServiceRef(name="//annotation/remote",contractId="examples.annotation.remote",policy="optional") org.j7m.middleware.application.api.ManagedProvider<Optional<ManagedAnnotationUsage.RemoteApi>> remote)
      Produces a consumer whose provider is prepared by the host's explicit optional binding policy. The static factory avoids a dependency cycle through its declaring component.
      Parameters:
      remote - host-authorized optional service provider
      Returns:
      activation-owned consumer product
      Throws:
      NullPointerException - if the provider is absent
    • greetOrFallback

      public String greetOrFallback(String name)
      Uses an optional remote product without injecting null when discovery has no target.
      Parameters:
      name - display text
      Returns:
      remote greeting or explicit fallback