com.vmware.xenon.common.Utils.validateServiceOption()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(114)

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

Utils.validateServiceOption介绍

[英]Infrastructure use only
[中]仅限基础设施使用

代码示例

代码示例来源:origin: vmware/xenon

private void checkOptions(EnumSet<Service.ServiceOption> options, boolean isFailureExpected) {
  String error;
  for (Service.ServiceOption o : options) {
    error = Utils.validateServiceOption(options, o);
    if (error != null && !isFailureExpected) {
      throw new IllegalArgumentException(error);
    }
  }
}

代码示例来源:origin: com.vmware.xenon/xenon-common

private void checkOptions(EnumSet<Service.ServiceOption> options, boolean isFailureExpected) {
  String error;
  for (Service.ServiceOption o : options) {
    error = Utils.validateServiceOption(options, o);
    if (error != null && !isFailureExpected) {
      throw new IllegalArgumentException(error);
    }
  }
}

代码示例来源:origin: vmware/xenon

/**
 * Infrastructure use only
 */
static boolean validateServiceOptions(ServiceHost host, Service service, Operation post) {
  for (ServiceOption o : service.getOptions()) {
    String error = Utils.validateServiceOption(service.getOptions(), o);
    if (error != null) {
      host.log(Level.WARNING, "%s", error);
      post.fail(new IllegalArgumentException(error));
      return false;
    }
  }
  if (service.getMaintenanceIntervalMicros() > 0 &&
      service.getMaintenanceIntervalMicros() < host.getMaintenanceCheckIntervalMicros()) {
    host.setMaintenanceCheckIntervalMicros(service.getMaintenanceIntervalMicros());
  }
  return true;
}

相关文章