本文整理汇总了Java中org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy.from方法的典型用法代码示例。如果您正苦于以下问题:Java RpcRoutingStrategy.from方法的具体用法?Java RpcRoutingStrategy.from怎么用?Java RpcRoutingStrategy.from使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.controller.md.sal.dom.broker.spi.rpc.RpcRoutingStrategy
的用法示例。
在下文中一共展示了RpcRoutingStrategy.from方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
示例3: 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());
}