此内容没有您所选择的语言版本。
6.3. Transformations between Contracts
Composite Service Binding and Composite Service / Composite Reference and Composite Reference Binding
Contract differences are handled in the ServiceHandlers when composing and decomposing the SwitchYard message. Any difference in contracts is handled in the Message composer.
Composite Service and Component Service / Component Reference and Composite Reference
Contract differences are handled by transformers defined in the composite application, which are applied by the ExchangeHandler chain during the execution of the Exchange. The transformers usually map from an origin type to a destination type.
- In the IN phase, from is the argument’s type of the composite service and the to is the type in the component service.
- In the OUT phase, from is the return/exception type of the component service and the to is the return/exception type of the composite service.
- In the IN phase, from is the argument’s type of the component reference and the to is the type in the composite reference.
- In the OUT phase, from is the return/exception type of the composite reference and the to is the return/exception type of the component reference.
Component Service and Component Reference
Contract differences are handled in the component implementation, and has to be explicitly transformed.
- If a Composite Service does not declare a contract, it uses the contract defined by the promoted Component Service.
- Every Component can have one Service.
- Binding name can be null. In this case, a binding name is automatically generated with "ServiceName+BindingType+i".
- When the input parameter of a service contract is empty, the message does not change, it is in its original form (e.g. java.io.Reader for streaming bindings like http, File,…)