Interface ChenilePolymorphProvider
- All Known Implementing Classes:
QueryPolymorph, StmBodyTypeSelector, SubclassBodyTypeSelector
public interface ChenilePolymorphProvider
Lists the
ChenilePolymorphVariants of an operation. It is implemented either by an explicit provider
(named with ChenilePolymorph) or by a body type selector that knows the types it can produce, so that
the runtime typing and the published contract come from the same bean.
Variants are computed once at startup by ChenilePolymorphInitializer and stored
on the OperationDefinition. By then the operation's contract name has been resolved, so
variantName(OperationDefinition, String) can be used to build variant names.
-
Method Summary
Modifier and TypeMethodDescriptiongetVariants(ChenileServiceDefinition serviceDefinition, OperationDefinition operationDefinition) default ChenilePolymorphVariantresolveVariant(ChenileExchange exchange, OperationDefinition operationDefinition) Resolves the variant of one request when that depends on more than the variants' fixed parameter values and body discriminators (for example tenant-specific definitions).default StringvariantName(OperationDefinition operationDefinition, String suffix) The default variant name:<operation contract name>_<suffix>.
-
Method Details
-
getVariants
List<ChenilePolymorphVariant> getVariants(ChenileServiceDefinition serviceDefinition, OperationDefinition operationDefinition) -
variantName
The default variant name:<operation contract name>_<suffix>. The contract name defaults to<serviceId>_<operationName>, giving<serviceId>_<operationName>_<suffix>. Providers may return any other name. -
resolveVariant
default ChenilePolymorphVariant resolveVariant(ChenileExchange exchange, OperationDefinition operationDefinition) Resolves the variant of one request when that depends on more than the variants' fixed parameter values and body discriminators (for example tenant-specific definitions). Return null to let the chenile-highway match the request against the variants computed at startup.
-
CHENILE