org.jvnet.hk2.config.Dom.element()方法的使用及代码示例

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

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

Dom.element介绍

[英]Returns the child element by name
[中]按名称返回子元素

代码示例

代码示例来源:origin: com.sun.grizzly/grizzly-config

static public List<NetworkListener> findNetworkListeners(ThreadPool threadpool) {
  NetworkConfig config = threadpool.getParent().getParent(NetworkConfig.class);
  if (!Dom.unwrap(config).getProxyType().equals(NetworkConfig.class)) {
    config = Dom.unwrap(config).element("network-config").createProxy();
  }
  List<NetworkListener> listeners = config.getNetworkListeners().getNetworkListener();
  List<NetworkListener> refs = new ArrayList<NetworkListener>();
  for (NetworkListener listener : listeners) {
    if (listener.getThreadPool().equals(threadpool.getName())) {
      refs.add(listener);
    }
  }
  return refs;
}

代码示例来源:origin: com.sun.grizzly/grizzly-config

public static ThreadPool findThreadPool(NetworkListener listener) {
  final NetworkListeners listeners = listener.getParent();
  List<ThreadPool> list = listeners.getThreadPool();
  if (list == null || list.isEmpty()) {
    final ConfigBeanProxy parent = listener.getParent().getParent().getParent();
    final Dom proxy = Dom.unwrap(parent).element("thread-pools");
    final List<Dom> domList = proxy.nodeElements("thread-pool");
    list = new ArrayList<ThreadPool>(domList.size());
    for (Dom dom : domList) {
      list.add(dom.<ThreadPool>createProxy());
    }
  }
  for (ThreadPool pool : list) {
    if (listener.getThreadPool().equals(pool.getName())) {
      return pool;
    }
  }
  return null;
}

代码示例来源:origin: eclipse-ee4j/glassfish

static public List<NetworkListener> findNetworkListeners(ThreadPool threadpool) {
  NetworkConfig config = threadpool.getParent().getParent(NetworkConfig.class);
  if (!Dom.unwrap(config).getProxyType().equals(NetworkConfig.class)) {
    config = Dom.unwrap(config).element("network-config").createProxy();
  }
  List<NetworkListener> listeners = config.getNetworkListeners().getNetworkListener();
  List<NetworkListener> refs = new ArrayList<NetworkListener>();
  for (NetworkListener listener : listeners) {
    if (listener.getThreadPool().equals(threadpool.getName())) {
      refs.add(listener);
    }
  }
  return refs;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-config

static public List<NetworkListener> findNetworkListeners(ThreadPool threadpool) {
  NetworkConfig config = threadpool.getParent().getParent(NetworkConfig.class);
  if (!Dom.unwrap(config).getProxyType().equals(NetworkConfig.class)) {
    config = Dom.unwrap(config).element("network-config").createProxy();
  }
  List<NetworkListener> listeners = config.getNetworkListeners().getNetworkListener();
  List<NetworkListener> refs = new ArrayList<NetworkListener>();
  for (NetworkListener listener : listeners) {
    if (listener.getThreadPool().equals(threadpool.getName())) {
      refs.add(listener);
    }
  }
  return refs;
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-config

public static ThreadPool findThreadPool(NetworkListener listener) {
  final NetworkListeners listeners = listener.getParent();
  List<ThreadPool> list = listeners.getThreadPool();
  if (list == null || list.isEmpty()) {
    final ConfigBeanProxy parent = listener.getParent().getParent().getParent();
    final Dom proxy = Dom.unwrap(parent).element("thread-pools");
    final List<Dom> domList = proxy.nodeElements("thread-pool");
    list = new ArrayList<ThreadPool>(domList.size());
    for (Dom dom : domList) {
      list.add(dom.<ThreadPool>createProxy());
    }
  }
  for (ThreadPool pool : list) {
    if (listener.getThreadPool().equals(pool.getName())) {
      return pool;
    }
  }
  return null;
}

代码示例来源:origin: eclipse-ee4j/glassfish

public static ThreadPool findThreadPool(NetworkListener listener) {
  final NetworkListeners listeners = listener.getParent();
  List<ThreadPool> list = listeners.getThreadPool();
  if (list == null || list.isEmpty()) {
    final ConfigBeanProxy parent = listener.getParent().getParent().getParent();
    final Dom proxy = Dom.unwrap(parent).element("thread-pools");
    final List<Dom> domList = proxy.nodeElements("thread-pool");
    list = new ArrayList<ThreadPool>(domList.size());
    for (Dom dom : domList) {
      list.add(dom.<ThreadPool>createProxy());
    }
  }
  for (ThreadPool pool : list) {
    if (listener.getThreadPool().equals(pool.getName())) {
      return pool;
    }
  }
  return null;
}

相关文章