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

x33g5p2x  于2022-01-20 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(99)

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

Graph.close介绍

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

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

The behaviour of the other Graph methods are undefined after closing the graph.

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

代码示例

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

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

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

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

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

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

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

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

相关文章

微信公众号

最新文章

更多