• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RoutedRpcRegistration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration的典型用法代码示例。如果您正苦于以下问题:Java RoutedRpcRegistration类的具体用法?Java RoutedRpcRegistration怎么用?Java RoutedRpcRegistration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RoutedRpcRegistration类属于org.opendaylight.controller.sal.binding.api.BindingAwareBroker包,在下文中一共展示了RoutedRpcRegistration类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: register

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; //导入依赖的package包/类
public void register(final EventSource eventSource){

        final NodeKey nodeKey = eventSource.getSourceNodeKey();
        final KeyedInstanceIdentifier<Node, NodeKey> sourcePath = EVENT_SOURCE_TOPOLOGY_PATH.child(Node.class, nodeKey);
        final RoutedRpcRegistration<EventSourceService> reg = rpcRegistry.addRoutedRpcImplementation(EventSourceService.class, eventSource);
        reg.registerPath(NodeContext.class, sourcePath);
        routedRpcRegistrations.put(nodeKey,reg);
        insert(sourcePath);

    }
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:11,代码来源:EventSourceTopology.java


示例2: unRegister

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; //导入依赖的package包/类
public void unRegister(final EventSource eventSource){
    final NodeKey nodeKey = eventSource.getSourceNodeKey();
    final KeyedInstanceIdentifier<Node, NodeKey> sourcePath = EVENT_SOURCE_TOPOLOGY_PATH.child(Node.class, nodeKey);
    final RoutedRpcRegistration<EventSourceService> removeRegistration = routedRpcRegistrations.remove(nodeKey);
    if(removeRegistration != null){
        removeRegistration.close();
    remove(sourcePath);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:10,代码来源:EventSourceTopology.java


示例3: startTest

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; //导入依赖的package包/类
@Override
public Future<RpcResult<StartTestOutput>> startTest(final StartTestInput input) {
    LOG.debug("startTest {}", input);

    final RTCClient client;
    final List<RoutedRpcRegistration<?>> rpcRegs = new ArrayList<>();

    switch (input.getOperation()) {
    case ROUTEDRTC:
        List<InstanceIdentifier<?>> routeIid = new ArrayList<>();
        for (int i = 0; i < input.getNumServers().intValue(); i++) {
            GlobalBindingRTCServer server = new GlobalBindingRTCServer();
            RoutedRpcRegistration<RpcbenchPayloadService> routedReg =
                    providerRegistry.addRoutedRpcImplementation(RpcbenchPayloadService.class, server);

            KeyedInstanceIdentifier<RpcRoute, RpcRouteKey> iid =
                    InstanceIdentifier
                        .create(RpcbenchRpcRoutes.class)
                        .child(RpcRoute.class, new RpcRouteKey(Integer.toString(i)));
            routeIid.add(iid);
            routedReg.registerPath(NodeContext.class, iid);
            rpcRegs.add(routedReg);
        }

        client = new RoutedBindingRTClient(providerRegistry, input.getPayloadSize().intValue(), routeIid);
        break;

    case GLOBALRTC:
        client = new GlobalBindingRTCClient(providerRegistry, input.getPayloadSize().intValue());
        break;

    default:
        LOG.error("Unsupported server/client type {}", input.getOperation());
        throw new IllegalArgumentException("Unsupported server/client type" + input.getOperation());
    }

    try {
        ExecutorService executor = Executors.newFixedThreadPool(input.getNumClients().intValue());

        final Runnable testRun = () -> client.runTest(input.getIterations().intValue());

        LOG.info("Test Started");
        long startTime = System.nanoTime();

        for (int i = 0; i < input.getNumClients().intValue(); i++ ) {
            executor.submit(testRun);
        }

        executor.shutdown();
        try {
            executor.awaitTermination(testTimeout, TimeUnit.MINUTES);
        } catch (final InterruptedException e) {
            LOG.error("Out of time: test did not finish within the {} min deadline ", testTimeout);
        }

        long endTime = System.nanoTime();
        LOG.info("Test Done");

        long elapsedTime = endTime - startTime;

        StartTestOutput output = new StartTestOutputBuilder()
                                        .setRate((long)0)
                                        .setGlobalRtcClientError(client.getRpcError())
                                        .setGlobalRtcClientOk(client.getRpcOk())
                                        .setExecTime(TimeUnit.NANOSECONDS.toMillis(elapsedTime))
                                        .setRate((client.getRpcOk() + client.getRpcError()) * 1000000000 / elapsedTime)
                                        .build();
        return RpcResultBuilder.success(output).buildFuture();
    } finally {
        for (RoutedRpcRegistration<?> routedRpcRegistration : rpcRegs) {
            routedRpcRegistration.close();
        }
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:75,代码来源:RpcbenchmarkProvider.java


示例4: canConvert

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; //导入依赖的package包/类
@Override
public boolean canConvert(final Object sourceObject, final ReifiedType targetType) {
    return sourceObject instanceof RoutedRpcRegistration
            && RoutedRpcRegistration.class.isAssignableFrom(targetType.getRawClass());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:6,代码来源:RoutedRpcRegistrationConverter.java


示例5: destroy

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; //导入依赖的package包/类
@Override
public void destroy(final Object instance) {
    LOG.debug("{}: In destroy: instance: {}", logName(), instance);

    ((RoutedRpcRegistration<?>)instance).close();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:RoutedRpcMetadata.java


示例6: addRoutedRpcImplementation

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; //导入依赖的package包/类
@Override
public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(final Class<T> type,
        final T implementation) throws IllegalStateException {
    return getRpcRegistryChecked().addRoutedRpcImplementation(type, implementation);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:6,代码来源:AbstractBindingSalProviderInstance.java


示例7: addRoutedRpcImplementation

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; //导入依赖的package包/类
@Override
public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type,
        T implementation) throws IllegalStateException {
    return getSALService(RpcProviderRegistry.class).addRoutedRpcImplementation(type, implementation);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:6,代码来源:BindingContextUtils.java


示例8: addRoutedRpcImplementation

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; //导入依赖的package包/类
@Override
public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(final Class<T> type, final T impl)
        throws IllegalStateException {
    return new CompositeRoutedRpcRegistration<>(type,impl,providerAdapter);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:6,代码来源:HeliumRpcProviderRegistry.java


示例9: addRoutedRpcImplementation

import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration; //导入依赖的package包/类
/**
 * Registers an implementation of the given routed RPC service interface.
 * <p>
 * See the {@link RpcProviderRegistry class} documentation for information and example on
 * how to use routed RPCs.
 *
 * @param serviceInterface the YANG-generated interface of the RPC Service for which to register.
 * @param implementation the implementation instance to register.
 * @return a RoutedRpcRegistration instance which can be used to register paths for the RPC
 *         implementation via invoking RoutedRpcRegistration#registerPath(Class, InstanceIdentifer).
 *         {@link RoutedRpcRegistration#close()} should be called to unregister the implementation
 *         and all previously registered paths when no longer needed.
 *
 * @throws IllegalStateException
 *            if the supplied RPC interface is not a routed RPC type.
 */
<T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> serviceInterface,
                                                                           T implementation)
        throws IllegalStateException;
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:20,代码来源:RpcProviderRegistry.java



注:本文中的org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HFileBlockDefaultEncodingContext类代码示例发布时间:2022-05-23
下一篇:
Java Rows类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap