Turn JsonRpcEndpoint into a proper OvsdbRPC implementation 46/86046/8
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 28 Nov 2019 13:39:59 +0000 (14:39 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 28 Nov 2019 20:22:17 +0000 (21:22 +0100)
commitfc3bf4c16d4bd71512ca991fcfc95d804c73c05e
tree9998ef87fdef1e046b353e851b62da7049ec3562
parent4d598cffc88333c551be88e45cef27f932b800bf
Turn JsonRpcEndpoint into a proper OvsdbRPC implementation

The Netty wiring and invocation handling is quite arcane here, relying
mostly on reflection to perform dispatch.

There is only a single direct user JsonRpcEndpoint, which expects
a OvsdbRPC to be exposed from it. Furthermore it is obvious that
JsonRpcEndpoint has a 1:1 correspondence with JsonRpcServiceBinderHandler
and that the invocation context used to pass request processing relies
on Netty Channel instance -- to which the JsonRpcEndpoint is already
bound.

This integrates JsonRpcServiceBinderHandler into JsonRpcEndpoint,
thus making the fusion obvious, eliminating the need to pass Object
context between the two.

Furthermore we eliminate JsonRpcEndpoint.getClient() and opt to make
JsonRpcEndpoint implement OvsdbRPC, providing a very clear connection
between the two and completely eliminating use of reflection in the
process.

Change-Id: I1cfcf784330fdf6e30a55fcaff6f5bd716d987e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
library/impl/src/main/java/org/opendaylight/ovsdb/lib/impl/OvsdbConnectionService.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/JsonRpcEndpoint.java
library/impl/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/JsonRpcServiceBinderHandler.java [deleted file]