org.apache.tuscany.sca.monitor.Monitor.analyzeProblems()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(129)

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

Monitor.analyzeProblems介绍

[英]Checks the Monitor for any Problems with s severity of ERROR and if one is found then throw a ValidationException. This will also call reset() on this Monitor.
[中]检查监视器是否存在严重错误,如果发现问题,则抛出ValidationException。这也将在此监视器上调用reset()。

代码示例

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

public Object loadXMLDocument(Reader document) throws XMLStreamException, ContributionReadException, ValidationException {
  Monitor monitor = createMonitor();
  Object model = loadXMLDocument(document, monitor);
  monitor.analyzeProblems();
  return model;
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

return deployer.getDependencies(contributionMetaDatas, contributionURI, monitor);
} finally {
  monitor.analyzeProblems();

代码示例来源:origin: org.apache.tuscany.sca/tuscany-domain-node

return deployer.getDependencies(contributionMetaDatas, contributionURI, monitor);
} finally {
  monitor.analyzeProblems();

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

protected void mergeContributionMetaData(String metaDataURL, Contribution contribution) throws ValidationException {
  ContributionMetadata metaData;
  Monitor monitor = deployer.createMonitor();
  try {
    metaData = deployer.loadXMLDocument(IOHelper.getLocationAsURL(metaDataURL), monitor);
  } catch (Exception e) {
    throw new ValidationException(e);
  }
  monitor.analyzeProblems();
  contribution.mergeMetaData(metaData);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-domain-node

protected void mergeContributionMetaData(String metaDataURL, Contribution contribution) throws ValidationException {
  ContributionMetadata metaData;
  Monitor monitor = deployer.createMonitor();
  try {
    metaData = deployer.loadXMLDocument(IOHelper.getLocationAsURL(metaDataURL), monitor);
  } catch (Exception e) {
    throw new ValidationException(e);
  }
  monitor.analyzeProblems();
  contribution.mergeMetaData(metaData);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

public void validateContribution(String contributionURI) throws ContributionReadException, ValidationException {
  ContributionDescription cd = getInstalledContribution(contributionURI);
  Contribution contribution = loadContribution(cd);
  Monitor monitor = deployer.createMonitor();
  try {
    ArrayList<Contribution> cs = new ArrayList<Contribution>();
    cs.add(contribution);
    cs.addAll(calculateDependentContributions(cd));
    deployer.resolve(cs, null, monitor);
  } catch (Exception e) {
    loadedContributions.remove(cd.getURI());
    throw new RuntimeException(e);
  }
  try {
    monitor.analyzeProblems();
  } catch (ValidationException e) {
    loadedContributions.remove(cd.getURI());
    throw e;
  }
  if (contribution.getClassLoader() == null && contribution.getModelResolver() instanceof ExtensibleModelResolver) {
    ModelResolver o = ((ExtensibleModelResolver)contribution.getModelResolver()).getModelResolverInstance(ClassReference.class);
    if (o instanceof ClassLoader) {
      contribution.setClassLoader((ClassLoader)o);        
    }
  }
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

monitor.analyzeProblems();

代码示例来源:origin: org.apache.tuscany.sca/tuscany-domain-node

public void validateContribution(String contributionURI) throws ContributionReadException, ValidationException {
  ContributionDescription cd = getInstalledContribution(contributionURI);
  Contribution contribution = loadContribution(cd);
  Monitor monitor = deployer.createMonitor();
  try {
    ArrayList<Contribution> cs = new ArrayList<Contribution>();
    cs.add(contribution);
    cs.addAll(calculateDependentContributions(cd));
    deployer.resolve(cs, null, monitor);
  } catch (Exception e) {
    loadedContributions.remove(cd.getURI());
    throw new RuntimeException(e);
  }
  try {
    monitor.analyzeProblems();
  } catch (ValidationException e) {
    loadedContributions.remove(cd.getURI());
    throw e;
  }
  if (contribution.getClassLoader() == null && contribution.getModelResolver() instanceof ExtensibleModelResolver) {
    ModelResolver o = ((ExtensibleModelResolver)contribution.getModelResolver()).getModelResolverInstance(ClassReference.class);
    if (o instanceof ClassLoader) {
      contribution.setClassLoader((ClassLoader)o);        
    }
  }
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-domain-node

monitor.analyzeProblems();

相关文章