本文整理汇总了Java中org.apache.catalina.Host.removeContainerListener方法的典型用法代码示例。如果您正苦于以下问题:Java Host.removeContainerListener方法的具体用法?Java Host.removeContainerListener怎么用?Java Host.removeContainerListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.Host
的用法示例。
在下文中一共展示了Host.removeContainerListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeHost
import org.apache.catalina.Host; //导入方法依赖的package包/类
/**
* Remove an existing child Host from our associated Engine.
*
* @param host Host to be removed
*/
private void removeHost(Host host) {
if (debug >= 3)
engine.log("Removing host '" + host.getName() + "'");
host.removeContainerListener(this);
// Identify all names mapped to this host
ArrayList removes = new ArrayList();
Iterator keys = cache.keySet().iterator();
while (keys.hasNext()) {
String key = (String) keys.next();
if (host.equals((Host) cache.get(key)))
removes.add(key);
}
// Remove the associated names
keys = removes.iterator();
while (keys.hasNext()) {
removeAlias((String) keys.next());
}
}
示例2: destroyMBeans
import org.apache.catalina.Host; //导入方法依赖的package包/类
/**
* Deregister the MBeans for the specified Host and its nested components.
*
* @param host Host for which to destroy MBeans
*
* @exception Exception if an exception is thrown during MBean destruction
*/
protected void destroyMBeans(Host host) throws Exception {
// Deregister ourselves as a ContainerListener
host.removeContainerListener(this);
// Deregister the MBeans for each child Context
Container contexts[] = host.findChildren();
for (int k = 0; k < contexts.length; k++) {
destroyMBeans((Context) contexts[k]);
}
// Deregister the MBeans for the associated nested components
Realm eRealm = host.getParent().getRealm();
Realm hRealm = host.getRealm();
if ((hRealm != null) && (hRealm != eRealm)) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Realm " + hRealm);
//MBeanUtils.destroyMBean(hRealm);
}
// Deregister the MBean for the Host itself
if (log.isDebugEnabled()) {
log.debug("Destroying MBean for Host " + host);
}
//MBeanUtils.destroyMBean(host);
}
示例3: destroyMBeans
import org.apache.catalina.Host; //导入方法依赖的package包/类
/**
* Deregister the MBeans for the specified Host and its nested components.
*
* @param host Host for which to destroy MBeans
*
* @exception Exception if an exception is thrown during MBean destruction
*/
protected void destroyMBeans(Host host) throws Exception {
// Deregister ourselves as a ContainerListener
host.removeContainerListener(this);
// Deregister the MBeans for each child Context
Container contexts[] = host.findChildren();
for (int k = 0; k < contexts.length; k++) {
destroyMBeans((Context) contexts[k]);
}
// Deregister the MBeans for the associated Valves
if (host instanceof StandardHost) {
Valve hValves[] = ((StandardHost)host).getValves();
for (int k = 0; k < hValves.length; k++) {
if (debug >= 3)
log("Destroying MBean for Valve " + hValves[k]);
MBeanUtils.destroyMBean(hValves[k], host);
}
}
// Deregister the MBeans for the associated nested components
Realm eRealm = host.getParent().getRealm();
Realm hRealm = host.getRealm();
if ((hRealm != null) && (hRealm != eRealm)) {
if (debug >= 3)
log("Destroying MBean for Realm " + hRealm);
MBeanUtils.destroyMBean(hRealm);
}
Logger eLogger = host.getParent().getLogger();
Logger hLogger = host.getLogger();
if ((hLogger != null) && (hLogger != eLogger)) {
if (debug >= 3)
log("Destroying MBean for Logger " + hLogger);
MBeanUtils.destroyMBean(hLogger);
}
// Deregister the MBean for the Host itself
if (debug >= 3) {
log("Destroying MBean for Host " + host);
}
MBeanUtils.destroyMBean(host);
}