org.eclipse.osgi.service.resolver.State.getDisabledBundles()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(116)

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

State.getDisabledBundles介绍

[英]Returns an array of BundleDescriptions for the bundles that are disabled in the system. Use #getDisabledInfos(BundleDescription) to interrogate the reason that each bundle is disabled.
[中]返回系统中禁用的捆绑包的BundleDescription数组。使用#GetDisabledInfo(BundleDescription)询问每个捆绑包被禁用的原因。

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.osgi

public int getStatus() {
  if (0 != systemState.getDisabledBundles().length) {
    return AuthorizationStatus.ERROR;
  }
  return AuthorizationStatus.OK;
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi

public int getStatus() {
  if (0 != systemState.getDisabledBundles().length) {
    return AuthorizationStatus.ERROR;
  }
  return AuthorizationStatus.OK;
}

代码示例来源:origin: org.eclipse/org.eclipse.osgi

public BundleDescription[] getDisabledBundles() {
  return target.getDisabledBundles();
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi

public BundleDescription[] getDisabledBundles() {
  return target.getDisabledBundles();
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.osgi.compatibility.state

public BundleDescription[] getDisabledBundles() {
  return platformAdmin.getSystemState().getDisabledBundles();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.osgi.compatibility.state

public BundleDescription[] getDisabledBundles() {
  return platformAdmin.getSystemState().getDisabledBundles();
}

代码示例来源:origin: org.eclipse.equinox/console

@Descriptor(ConsoleMsg.CONSOLE_HELP_LD_COMMAND_DESCRIPTION)
public void disabledBundles() throws Exception {
  
  PlatformAdmin platformAdmin = activator.getPlatformAdmin();
  if (platformAdmin == null) {
    System.out.println(ConsoleMsg.CONSOLE_CANNOT_LIST_DISABLED_NO_PLATFORM_ADMIN_MESSAGE);
    return;
  }
  State systemState = platformAdmin.getState(false);
  BundleDescription[] disabledBundles = systemState.getDisabledBundles();
  System.out.println(NLS.bind(ConsoleMsg.CONSOLE_DISABLED_COUNT_MESSAGE, String.valueOf(disabledBundles.length)));
  if (disabledBundles.length > 0) {
    System.out.println();
  }
  for (int i = 0; i < disabledBundles.length; i++) {
    DisabledInfo[] disabledInfos = systemState.getDisabledInfos(disabledBundles[i]);
    System.out.println(NLS.bind(ConsoleMsg.CONSOLE_DISABLED_BUNDLE_HEADER, formatBundleName(disabledBundles[i]), String.valueOf(disabledBundles[i].getBundleId())));
    System.out.print(NLS.bind(ConsoleMsg.CONSOLE_DISABLED_BUNDLE_REASON, disabledInfos[0].getMessage(), disabledInfos[0].getPolicyName()));
    for (int j = 1; j < disabledInfos.length; j++) {
      System.out.print(NLS.bind(ConsoleMsg.CONSOLE_DISABLED_BUNDLE_REASON, disabledInfos[j].getMessage(), String.valueOf(disabledInfos[j].getPolicyName())));
    }
    System.out.println();
  }
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi

public void _disabledBundles(CommandInterpreter ci) throws Exception {
  try {
    State systemState = getPlatformAdmin(ci).getState(false);
    BundleDescription[] disabledBundles = systemState.getDisabledBundles();
    ci.println(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONSOLE_DISABLED_COUNT_MESSAGE, String.valueOf(disabledBundles.length)));
    if (disabledBundles.length > 0) {
      ci.println();
    }
    for (int i = 0; i < disabledBundles.length; i++) {
      DisabledInfo[] disabledInfos = systemState.getDisabledInfos(disabledBundles[i]);
      ci.println(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONSOLE_DISABLED_BUNDLE_HEADER, formatBundleName(disabledBundles[i]), String.valueOf(disabledBundles[i].getBundleId())));
      ci.print(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONSOLE_DISABLED_BUNDLE_REASON1, disabledInfos[0].getMessage(), disabledInfos[0].getPolicyName()));
      for (int j = 1; j < disabledInfos.length; j++) {
        ci.print(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONSOLE_DISABLED_BUNDLE_REASON1, disabledInfos[j].getMessage(), String.valueOf(disabledInfos[j].getPolicyName())));
      }
      ci.println();
    }
  } finally {
    ungetPlatformAdmin();
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.osgi

public void _disabledBundles(CommandInterpreter ci) throws Exception {
  try {
    State systemState = getPlatformAdmin(ci).getState(false);
    BundleDescription[] disabledBundles = systemState.getDisabledBundles();
    ci.println(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONSOLE_DISABLED_COUNT_MESSAGE, String.valueOf(disabledBundles.length)));
    if (disabledBundles.length > 0) {
      ci.println();
    }
    for (int i = 0; i < disabledBundles.length; i++) {
      DisabledInfo[] disabledInfos = systemState.getDisabledInfos(disabledBundles[i]);
      ci.println(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONSOLE_DISABLED_BUNDLE_HEADER, formatBundleName(disabledBundles[i]), String.valueOf(disabledBundles[i].getBundleId())));
      ci.print(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONSOLE_DISABLED_BUNDLE_REASON1, disabledInfos[0].getMessage(), disabledInfos[0].getPolicyName()));
      for (int j = 1; j < disabledInfos.length; j++) {
        ci.print(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONSOLE_DISABLED_BUNDLE_REASON1, disabledInfos[j].getMessage(), String.valueOf(disabledInfos[j].getPolicyName())));
      }
      ci.println();
    }
  } finally {
    ungetPlatformAdmin();
  }
}

相关文章