Allow instantiation of more efficient RpcServiceInvokers 20/21220/4
authorRobert Varga <rovarga@cisco.com>
Wed, 27 May 2015 10:54:03 +0000 (12:54 +0200)
committerRobert Varga <rovarga@cisco.com>
Wed, 27 May 2015 15:33:24 +0000 (17:33 +0200)
commitaab5a09be514bc7622416bf2a6d4d6a7465f9d7c
tree26d67bd005363c80faa8aa447194e276e944e7fe
parent96639b4fd02beb3590f62fdfc096936e71ad4a32
Allow instantiation of more efficient RpcServiceInvokers

Current invoker derived from binding class has the downside of
performing localName->methodName conversion on each invocation, which
costs us in the lookup path, as deriving the binding method name is a
costly operation.

Add a new static factory method for creating a RpcServiceInvoker
instance base on a QName->Method map. Provide two additional
implementations: a generic one, which performs a direct lookup in the
map and a specialized one, which performs lookup only on the localName
part of the qname. The latter is used after we have made sure all QNames
come from the same QNameModule.

Change-Id: I6a4b33f0487838b3ae6c15470823e4bc01114aa5
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/util/AbstractMappedRpcInvoker.java [new file with mode: 0644]
yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/util/ClassBasedRpcServiceInvoker.java [new file with mode: 0644]
yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/util/LocalNameRpcServiceInvoker.java [new file with mode: 0644]
yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/util/QNameRpcServiceInvoker.java [new file with mode: 0644]
yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcMethodInvoker.java
yang/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/util/RpcServiceInvoker.java