本文整理了Java中org.apache.catalina.Container.findContainerListeners()
方法的一些代码示例,展示了Container.findContainerListeners()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Container.findContainerListeners()
方法的具体详情如下:
包路径:org.apache.catalina.Container
类名称:Container
方法名:findContainerListeners
[英]Return the set of container listeners associated with this Container. If this Container has no registered container listeners, a zero-length array is returned.
[中]返回与此容器关联的容器侦听器集。如果此容器没有注册的容器侦听器,则返回零长度数组。
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* List the class name of each of the container listeners added to this
* container.
* @return the container listeners class names
* @throws MBeanException propagated from the managed resource access
*/
public String[] findContainerListenerNames() throws MBeanException {
Container container = doGetManagedResource();
List<String> result = new ArrayList<>();
ContainerListener[] listeners = container.findContainerListeners();
for(ContainerListener listener: listeners){
result.add(listener.getClass().getName());
}
return result.toArray(new String[result.size()]);
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
/**
* List the class name of each of the container listeners added to this
* container.
* @return the container listeners class names
* @throws MBeanException propagated from the managed resource access
*/
public String[] findContainerListenerNames() throws MBeanException {
Container container = doGetManagedResource();
List<String> result = new ArrayList<>();
ContainerListener[] listeners = container.findContainerListeners();
for(ContainerListener listener: listeners){
result.add(listener.getClass().getName());
}
return result.toArray(new String[result.size()]);
}
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* List the class name of each of the container listeners added to this
* container.
*/
public String[] findContainerListenerNames() throws MBeanException {
Container container = null;
List<String> result = new ArrayList<>();
try {
container = (Container) getManagedResource();
} catch (InstanceNotFoundException e) {
throw new MBeanException(e);
} catch (RuntimeOperationsException e) {
throw new MBeanException(e);
} catch (InvalidTargetObjectTypeException e) {
throw new MBeanException(e);
}
ContainerListener[] listeners = container.findContainerListeners();
for(ContainerListener listener: listeners){
result.add(listener.getClass().getName());
}
return result.toArray(new String[result.size()]);
}
}
内容来源于网络,如有侵权,请联系作者删除!