org.apache.brooklyn.core.entity.Entities.destroyAllCatching()方法的使用及代码示例

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

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

Entities.destroyAllCatching介绍

[英]Same as #destroyAll(ManagementContext) but catching all errors
[中]与#destroyAll(管理上下文)相同,但捕获所有错误

代码示例

代码示例来源:origin: org.apache.brooklyn/brooklyn-core

@AfterMethod(alwaysRun=true)
private void tearDown() {
  if (mgmt != null) {
    Entities.destroyAllCatching(mgmt);
    mgmt = null;
  }
}

代码示例来源:origin: org.apache.brooklyn/brooklyn-locations-jclouds

@AfterMethod(alwaysRun=true)
public void tearDown() {
  List<Exception> exceptions = Lists.newArrayList();
  for (SshMachineLocation machine : machines) {
    try {
      loc.release(machine);
    } catch (Exception e) {
      LOG.warn("Error releasing {}: {}; continuing...", machine, e.getMessage());
      exceptions.add(e);
    }
  }
  if (!exceptions.isEmpty()) {
    LOG.info("Exception during tearDown: {}", Exceptions.collapseText(exceptions.get(0)));
  }
  machines.clear();
  
  if (ctx != null) {
    Entities.destroyAllCatching(ctx);
    ctx = null;
  }
}

相关文章