2 * Copyright (c) 2015 Cisco Systems and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package rpcbenchmark.impl;
10 import com.google.common.collect.ImmutableClassToInstanceMap;
11 import org.opendaylight.mdsal.binding.api.RpcProviderService;
12 import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.GlobalRpcBench;
13 import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.RoutedRpcBench;
14 import org.opendaylight.yangtools.concepts.Registration;
15 import org.opendaylight.yangtools.yang.binding.Rpc;
16 import org.osgi.service.component.annotations.Reference;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
20 final class GlobalBindingRTCServer extends AbstractRpcbenchPayloadService implements AutoCloseable {
21 private static final Logger LOG = LoggerFactory.getLogger(GlobalBindingRTCServer.class);
23 private final Registration reg;
25 GlobalBindingRTCServer(@Reference final RpcProviderService rpcProvider) {
26 reg = rpcProvider.registerRpcImplementations(ImmutableClassToInstanceMap.<Rpc<?, ?>>builder()
27 .put(GlobalRpcBench.class, this::globalRpcBench)
28 .put(RoutedRpcBench.class, this::routedRpcBench)
30 LOG.debug("GlobalBindingRTCServer started");
36 LOG.debug("GlobalBindingRTCServer stopped");