DecisionServiceRegistry

@ApiStatus.Experimental
class DecisionServiceRegistry

Registered decision and classification services with their family defaults and role bindings.

The registry is an immutable snapshot taken when Builder.build runs. In Spring that happens when the registry bean is created. A service created after that point is not visible to lookups; pass it to ServiceSelector.using instead. Instances are safe to share between threads.

Each service registers under a registration name. The decision family holds the registered DecisionService instances. The classification family holds every registered service, because a decision service also classifies. Roles and defaults are scoped to one family.

A family default is resolved in this order: the explicit default, then the single DefaultCandidate eligible for the family, then the single service eligible for the family. Otherwise ServiceSelector.defaultService throws ServiceSelectionException.

Types

Link copied to clipboard
@ApiStatus.Experimental
class Builder

Collects registrations, defaults, roles and candidates, and validates them in build. Instances are not thread-safe.

Link copied to clipboard
object Companion
Link copied to clipboard
@ApiStatus.Experimental
class DefaultCandidate(val name: String)

Names a registered service that provider configuration offers as a family default. A candidate applies to a family only when no explicit default is set and it is the single candidate eligible for that family.

Properties

Link copied to clipboard
@get:ApiStatus.Internal
val observationRegistry: <Error class: unknown class>

The observation registry the registered services observe with. Operation bindings open observation scopes on it.

Functions

Link copied to clipboard

Returns the selector for the classification family, which includes decision services.

Link copied to clipboard

Returns the selector for the decision family.

Link copied to clipboard

Returns one metadata snapshot per registered service, in registration order. Each snapshot keeps the service's family. It serves listings such as an admin view, and reads no service.

Link copied to clipboard

Returns the registration names in registration order.