本文整理了Java中com.zsmartsystems.zigbee.transaction.ZigBeeTransactionFuture.cancel()
方法的一些代码示例,展示了ZigBeeTransactionFuture.cancel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZigBeeTransactionFuture.cancel()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.transaction.ZigBeeTransactionFuture
类名称:ZigBeeTransactionFuture
方法名:cancel
暂无
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
private void cancelTransaction() {
if (timeoutTask != null) {
timeoutTask.cancel(false);
}
logger.debug("Transaction cancelled: {}", command);
if (transactionFuture != null) {
synchronized (transactionFuture) {
transactionFuture.cancel(false);
transactionFuture.notify();
}
}
if (responseMatcher != null) {
transactionManager.removeTransactionListener(this);
}
state = TransactionState.FAILED;
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testCancel() {
ZigBeeTransactionFuture future = new ZigBeeTransactionFuture();
assertFalse(future.isCancelled());
assertTrue(future.cancel(true));
assertFalse(future.cancel(true));
assertTrue(future.isCancelled());
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testTimeout() throws InterruptedException, ExecutionException, TimeoutException {
ZigBeeTransactionFuture future = new ZigBeeTransactionFuture();
assertFalse(future.isDone());
assertNotNull(future.get(0, TimeUnit.MICROSECONDS));
assertTrue(future.isDone());
CommandResult result = future.get();
assertNull(result.getResponse());
assertFalse(future.cancel(true));
}
内容来源于网络,如有侵权,请联系作者删除!