本文整理了Java中org.jvnet.hk2.config.Dom.element()
方法的一些代码示例,展示了Dom.element()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dom.element()
方法的具体详情如下:
包路径:org.jvnet.hk2.config.Dom
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!