Now that we have the SchemaPath->Method mapping available and
RpcServiceInvoker can instantiate efficient invokers based on the
QName->Method mapping, switch over to them by creating an intermediate
map.
Change-Id: If5e17924d9deb494045965578cfcec6d321d04d2
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit
0aedb207da64e63900e2dbc85ba2a030ea7800e4)
import com.google.common.util.concurrent.JdkFutureAdapters;
import com.google.common.util.concurrent.ListenableFuture;
import java.lang.reflect.Method;
import com.google.common.util.concurrent.JdkFutureAdapters;
import com.google.common.util.concurrent.ListenableFuture;
import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map.Entry;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
this.invoker = SERVICE_INVOKERS.get(type, new Callable<RpcServiceInvoker>() {
@Override
public RpcServiceInvoker call() {
this.invoker = SERVICE_INVOKERS.get(type, new Callable<RpcServiceInvoker>() {
@Override
public RpcServiceInvoker call() {
- return RpcServiceInvoker.from(type);
+ final Map<QName, Method> map = new HashMap<>();
+ for (Entry<SchemaPath, Method> e : localNameToMethod.entrySet()) {
+ map.put(e.getKey().getLastComponent(), e.getValue());
+ }
+
+ return RpcServiceInvoker.from(map);
}
});
} catch (ExecutionException e) {
}
});
} catch (ExecutionException e) {