[MDSAL-854] Improve RpcProviderService.registerRpcImplementations() Created: 05/Feb/24 Updated: 05/Feb/24 |
|
| Status: | In Review |
| Project: | mdsal |
| Component/s: | Binding API, Binding runtime |
| Affects Version/s: | None |
| Fix Version/s: | 11.0.16, 12.0.5, 13.0.1 |
| Type: | Improvement | Priority: | Medium |
| Reporter: | Robert Varga | Assignee: | Robert Varga |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
We requires a ClassToInstanceMap here, mirror the API from mdsal-dom-api. While this is required in mdsal-dom-api, as we cannot determine the RPC type, with binding we can do better:
default @NonNull Registration registerRpcImplementations(final Collection<Rpc<?, ?>> implementations) {
final var map = MutableClassToInstanceMap.<Rpc<?, ?>> create();
for (var impl : implementations) {
map.put(impl.implementedInterface(), impl);
}
return registerRpcImplementations(map);
}
i.e. determine the implemented interface and index passed in implementations. This allows downstreams to use varargs. |