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

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

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

State.removeDisabledInfo介绍

[英]Removes the disabled info from the state.
[中]从状态中删除禁用的信息。

代码示例

代码示例来源: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;
}

相关文章