Turn JsonRpcEndpoint into a proper OvsdbRPC implementation 27/86127/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:46:48 +0000 (10:46 +0100)
commit1c80d0ab09d0841e433b39542198b020ce4c82cd
treebeab4bce092ad7e0ddbd98511e9e4a94ef7be401
parent1c01dbf483e7211bbff403397e89369978e1cf4a
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]