gpt4 book ai didi

com.zsmartsystems.zigbee.ZigBeeNetworkManager.executeTask()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 10:09:31 25 4
gpt4 key购买 nike

本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNetworkManager.executeTask()方法的一些代码示例,展示了ZigBeeNetworkManager.executeTask()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeNetworkManager.executeTask()方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.ZigBeeNetworkManager
类名称:ZigBeeNetworkManager
方法名:executeTask

ZigBeeNetworkManager.executeTask介绍

[英]Schedules a runnable task for execution. This uses a fixed size scheduler to limit thread execution.
[中]安排可运行任务的执行。它使用固定大小的调度程序来限制线程执行。

代码示例

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

networkManager.executeTask(runnable);

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

networkManager.executeTask(runnable);

代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee

@Before
public void setupTest() {
  networkManager = Mockito.mock(ZigBeeNetworkManager.class);
  nodeCapture = ArgumentCaptor.forClass(ZigBeeNode.class);
  Mockito.doAnswer(new Answer<Future<CommandResult>>() {
    @Override
    public Future<CommandResult> answer(InvocationOnMock invocation) {
      ZigBeeCommand command = (ZigBeeCommand) invocation.getArguments()[0];
      ZigBeeTransactionFuture commandFuture = new ZigBeeTransactionFuture();
      CommandResult result = new CommandResult(responses.get(command.getClusterId()));
      commandFuture.set(result);
      return commandFuture;
    }
  }).when(networkManager).sendTransaction(ArgumentMatchers.any(ZigBeeCommand.class),
      ArgumentMatchers.any(ZigBeeTransactionMatcher.class));
  Mockito.doAnswer(new Answer<Void>() {
    @Override
    public Void answer(InvocationOnMock invocation) {
      Runnable runnable = (Runnable) invocation.getArguments()[0];
      new Thread(runnable).start();
      return null;
    }
  }).when(networkManager).executeTask(ArgumentMatchers.any(Runnable.class));
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com