当前位置: 首页>>代码示例>>Java>>正文


Java RpcRoutingStrategy类代码示例

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


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

示例1: decomposeRpcService

import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
static Collection<SchemaPath> decomposeRpcService(final Class<RpcService> service,
        final SchemaContext schemaContext, final Predicate<RpcRoutingStrategy> filter) {
    final QNameModule moduleName = BindingReflections.getQNameModule(service);
    final Module module = schemaContext.findModuleByNamespaceAndRevision(moduleName.getNamespace(),
            moduleName.getRevision());
    LOG.debug("Resolved service {} to module {}", service, module);

    final Collection<RpcDefinition> rpcs = module.getRpcs();
    final Collection<SchemaPath> ret = new ArrayList<>(rpcs.size());
    for (RpcDefinition rpc : rpcs) {
        final RpcRoutingStrategy strategy = RpcRoutingStrategy.from(rpc);
        if (filter.test(strategy)) {
            ret.add(rpc.getPath());
        }
    }

    return ret;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:19,代码来源:RpcUtil.java

示例2: createRpcEntry

import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
private static AbstractDOMRpcRoutingTableEntry createRpcEntry(final SchemaContext context, final SchemaPath key,
        final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> implementations) {
    final RpcDefinition rpcDef = findRpcDefinition(context, key);
    if (rpcDef == null) {
        return new UnknownDOMRpcRoutingTableEntry(key, implementations);
    }

    final RpcRoutingStrategy strategy = RpcRoutingStrategy.from(rpcDef);
    if (strategy.isContextBasedRouted()) {
        return new RoutedDOMRpcRoutingTableEntry(rpcDef, YangInstanceIdentifier.of(strategy.getLeaf()),
            implementations);

    }

    return new GlobalDOMRpcRoutingTableEntry(rpcDef, implementations);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:17,代码来源:DOMRpcRoutingTable.java

示例3: registerFallback

import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
private void registerFallback(final Class<RpcService> interfaceClass) {
    final Collection<SchemaPath> paths = RpcUtil.decomposeRpcService(interfaceClass,
        schemaService.getGlobalContext(), RpcRoutingStrategy::isContextBasedRouted);
    if (paths.isEmpty()) {
        LOG.warn("{}: interface {} has no actions defined", ACTION_PROVIDER, interfaceClass);
        return;
    }

    final Set<DOMRpcIdentifier> rpcs = ImmutableSet.copyOf(Collections2.transform(paths, DOMRpcIdentifier::create));
    reg = rpcProviderService.registerRpcImplementation((rpc, input) -> {
        return Futures.immediateFailedCheckedFuture(new DOMRpcImplementationNotAvailableException(
            "Action %s has no instance matching %s", rpc, input));
    }, rpcs);
    LOG.debug("Registered provider for {}", interfaceName);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:16,代码来源:ActionProviderBean.java

示例4: createStrategy

import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
private RpcInvocationStrategy createStrategy(final Method method, final RpcDefinition schema) {
    final RpcRoutingStrategy strategy = RpcRoutingStrategy.from(schema);
    if (strategy.isContextBasedRouted()) {
        return new RoutedStrategy(schema.getPath(), method, strategy.getLeaf());
    }
    return new NonRoutedStrategy(schema.getPath());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:8,代码来源:RpcServiceAdapter.java

示例5: rpcFilter

import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
@Override
Predicate<RpcRoutingStrategy> rpcFilter() {
    return s -> !s.isContextBasedRouted();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:RpcServiceMetadata.java

示例6: rpcFilter

import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
@Override
Predicate<RpcRoutingStrategy> rpcFilter() {
    return RpcRoutingStrategy::isContextBasedRouted;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:ActionServiceMetadata.java

示例7: rpcFilter

import org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy; //导入依赖的package包/类
abstract Predicate<RpcRoutingStrategy> rpcFilter(); 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:2,代码来源:AbstractInvokableServiceMetadata.java


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