org.apache.commons.rdf.api.Dataset.close()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(133)

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

Dataset.close介绍

[英]Close the dataset, relinquishing any underlying resources.

For example, this would close any open file and network streams and free database locks held by the dataset implementation.

The behaviour of the other dataset methods are undefined after closing the dataset.

Implementations might not need #close(), hence the default implementation does nothing.
[中]关闭数据集,放弃任何基础资源。
例如,这将关闭任何打开的文件和网络流,并释放数据集实现持有的数据库锁。
关闭数据集后,其他数据集方法的行为未定义。
实现可能不需要#close(),因此默认实现不执行任何操作。

代码示例

代码示例来源:origin: org.apache.commons/commons-rdf-simple

@Override
public void close() throws Exception {
  dataset.close();
}

代码示例来源:origin: trellis-ldp/trellis

@Override
public void close() {
  try {
    dataset.close();
  } catch (final Exception ex) {
    throw new RuntimeTrellisException("Error closing dataset", ex);
  }
}

代码示例来源:origin: trellis-ldp/trellis

@BeforeEach
public void setUp() throws Exception {
  initMocks(this);
  doThrow(new IOException()).when(mockDataset).close();
}

相关文章