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

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

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

State.getDisabledInfo介绍

[英]Returns the disabled info for the specified bundle with the specified policy name. If no disabled info exists then null is returned.
[中]返回具有指定策略名称的指定绑定的禁用信息。如果不存在禁用的信息,则返回null

代码示例

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

public DisabledInfo getDisabledInfo(BundleDescription bundle, String policyName) {
  return target.getDisabledInfo(bundle, policyName);
}

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

public DisabledInfo getDisabledInfo(BundleDescription bundle, String policyName) {
  return target.getDisabledInfo(bundle, policyName);
}

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

public DisabledInfo getDisabledInfo(BundleDescription bundle, String policyName) {
  return platformAdmin.getSystemState().getDisabledInfo(bundle, policyName);
}

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

public DisabledInfo getDisabledInfo(BundleDescription bundle, String policyName) {
  return platformAdmin.getSystemState().getDisabledInfo(bundle, policyName);
}

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

static void setDisabled(boolean disable, BundleDescription bundle) {
  State state = bundle.getContainingState();
  if (disable) {
    state.addDisabledInfo(new DisabledInfo(COMPOSITE_POLICY, "Composite companion bundle is not resolved.", bundle)); //$NON-NLS-1$
  } else {
    DisabledInfo toRemove = state.getDisabledInfo(bundle, COMPOSITE_POLICY);
    if (toRemove != null)
      state.removeDisabledInfo(toRemove);
  }
}

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

static void setDisabled(boolean disable, BundleDescription bundle) {
  State state = bundle.getContainingState();
  if (disable) {
    state.addDisabledInfo(new DisabledInfo(COMPOSITE_POLICY, "Composite companion bundle is not resolved.", bundle)); //$NON-NLS-1$
  } else {
    DisabledInfo toRemove = state.getDisabledInfo(bundle, COMPOSITE_POLICY);
    if (toRemove != null)
      state.removeDisabledInfo(toRemove);
  }
}

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

protected AuthorizationEvent doAuthorize(SignedContent content, Object context) {
  boolean enabled = isEnabled(content, context);
  AuthorizationEvent event = null;
  if (context instanceof Bundle) {
    BundleDescription desc = systemState.getBundle(((Bundle) context).getBundleId());
    if (!enabled) {
      DisabledInfo info = new DisabledInfo(POLICY_NAME, null, desc); // TODO add an error message
      systemState.addDisabledInfo(info);
      event = new AuthorizationEvent(AuthorizationEvent.DENIED, content, context, 0); // TODO severity??
    } else {
      DisabledInfo info = systemState.getDisabledInfo(desc, POLICY_NAME);
      if (info != null) {
        systemState.removeDisabledInfo(info);
      }
      event = new AuthorizationEvent(AuthorizationEvent.ALLOWED, content, context, 0);
    }
  }
  return event;
}

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

protected AuthorizationEvent doAuthorize(SignedContent content, Object context) {
  boolean enabled = isEnabled(content, context);
  AuthorizationEvent event = null;
  if (context instanceof Bundle) {
    BundleDescription desc = systemState.getBundle(((Bundle) context).getBundleId());
    if (!enabled) {
      DisabledInfo info = new DisabledInfo(POLICY_NAME, null, desc); // TODO add an error message
      systemState.addDisabledInfo(info);
      event = new AuthorizationEvent(AuthorizationEvent.DENIED, content, context, 0); // TODO severity??
    } else {
      DisabledInfo info = systemState.getDisabledInfo(desc, POLICY_NAME);
      if (info != null) {
        systemState.removeDisabledInfo(info);
      }
      event = new AuthorizationEvent(AuthorizationEvent.ALLOWED, content, context, 0);
    }
  }
  return event;
}

相关文章