Class ManagedAnnotationUsage
java.lang.Object
org.j7m.middleware.examples.annotation.ManagedAnnotationUsage
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordFactory product with no middleware-specific interface.static interfaceOrdinary remote business contract; no specialized binding interface is required.static final classDemonstrates explicit optional availability rather than a null injected service. -
Constructor Summary
ConstructorsConstructorDescriptionManagedAnnotationUsage(ManagedUsageSettings settings, ManagedAnnotationUsage.Formatter formatter, ManagedAnnotationUsage.RemoteConsumer remote) Receives a validated configuration snapshot and an exactly qualified factory product. -
Method Summary
Modifier and TypeMethodDescriptionintattempts()Returns the typed configuration value captured for this activation.consumer(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.Produces a new immutable product for each prototype resolution without a factory receiver.Formats a greeting using injected configuration and the qualified product.greetOrFallback(String name) Uses an optional remote product without injecting null when discovery has no target.
-
Constructor Details
-
ManagedAnnotationUsage
public ManagedAnnotationUsage(ManagedUsageSettings settings, ManagedAnnotationUsage.Formatter formatter, ManagedAnnotationUsage.RemoteConsumer remote) Receives a validated configuration snapshot and an exactly qualified factory product.- Parameters:
settings- immutable application configurationformatter- product selected by the formal style qualifierremote- product backed by the host optional service policy- Throws:
NullPointerException- if a dependency is absent
-
-
Method Details
-
greet
-
attempts
public int attempts()Returns the typed configuration value captured for this activation.- Returns:
- configured positive attempt limit
-
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
-