Class ChenilePolymorphInitializer

java.lang.Object
org.chenile.core.init.ChenilePolymorphInitializer
All Implemented Interfaces:
SmartInitializingSingleton

public class ChenilePolymorphInitializer extends Object implements SmartInitializingSingleton
Resolves the published contract of every operation once, at startup:
  • the contract name (explicit, else <serviceId>_<operationName>) and the description (explicit, else the service's description, else generated text);
  • for a polymorphic operation, its provider and variants. The provider is the bean named by @ChenilePolymorph (or JSON "polymorph"), otherwise the operation's body type selector if it implements ChenilePolymorphProvider.
Variants are validated: each needs a unique name, and no two may have the same selecting values. A variant without a description gets the operation's description.

initialize() may be called early by a consumer that needs the contract during startup (MCP does); operations registered later are resolved when all singletons have been created.