Turn JsonRpcEndpoint into a proper OvsdbRPC implementation 17/86117/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 28 Nov 2019 13:39:59 +0000 (14:39 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 3 Dec 2019 09:44:56 +0000 (10:44 +0100)
commit16ff45fde3c2a1e24380016db770f32b67611863
tree5bfa6ba0937a89dbac46cff42fc066a8cd11fe18
parente8adc86390c8f04add2f93b37670fb335765339a
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>
(cherry picked from commit fc3bf4c16d4bd71512ca991fcfc95d804c73c05e)
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]