本文整理匯總了Java中org.apache.catalina.Host.addContainerListener方法的典型用法代碼示例。如果您正苦於以下問題:Java Host.addContainerListener方法的具體用法?Java Host.addContainerListener怎麽用?Java Host.addContainerListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.catalina.Host
的用法示例。
在下文中一共展示了Host.addContainerListener方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: registerHost
import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
* Register host.
*/
private void registerHost(ObjectName objectName)
throws Exception {
String name=objectName.getKeyProperty("host");
if( name != null ) {
Host host = (Host) ServerFactory.getServer().findService(
domain).getContainer().findChild(name);
String[] aliases = host.findAliases();
mapper.addHost(name, aliases, objectName);
host.addContainerListener(this);
if(log.isDebugEnabled())
log.debug(sm.getString
("mapperListener.registerHost", name, domain));
}
}
示例2: addHost
import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
* Add a new child Host to our associated Engine.
*
* @param host Child host to add
*/
private void addHost(Host host) {
if (debug >= 3)
engine.log("Adding host '" + host.getName() + "'");
host.addContainerListener(this);
// Register the host name
addAlias(host.getName(), host);
// Register all associated aliases
String aliases[] = host.findAliases();
for (int i = 0; i < aliases.length; i++)
addAlias(aliases[i], host);
}
示例3: registerListenersForEngine
import org.apache.catalina.Host; //導入方法依賴的package包/類
private void registerListenersForEngine(Engine engine) {
for (Container hostContainer : engine.findChildren()) {
Host host = (Host) hostContainer;
host.addContainerListener(this);
registerListenersForHost(host);
}
}
示例4: createMBeans
import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
* Create the MBeans for the specified Host and its nested components.
*
* @param host Host for which to create MBeans
*
* @exception Exception if an exception is thrown during MBean creation
*/
protected void createMBeans(Host host) throws Exception {
// Create the MBean for the Host itself
if (log.isDebugEnabled()) {
log.debug("Creating MBean for Host " + host);
}
//MBeanUtils.createMBean(host);
host.addContainerListener(this);
if (host instanceof StandardHost) {
((StandardHost) host).addPropertyChangeListener(this);
}
// Create 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("Creating MBean for Realm " + hRealm);
//MBeanUtils.createMBean(hRealm);
}
// Create the MBeans for each child Context
Container contexts[] = host.findChildren();
for (int k = 0; k < contexts.length; k++) {
createMBeans((Context) contexts[k]);
}
}
示例5: registerListenersForEngine
import org.apache.catalina.Host; //導入方法依賴的package包/類
private void registerListenersForEngine(Engine engine) {
for (Container hostContainer : engine.findChildren()) {
Host host = (Host) hostContainer;
host.addContainerListener(this);
registerListenersForHost(host);
}
}
示例6: createMBeans
import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
* Create the MBeans for the specified Host and its nested components.
*
* @param host Host for which to create MBeans
*
* @exception Exception if an exception is thrown during MBean creation
*/
protected void createMBeans(Host host) throws Exception {
// Create the MBean for the Host itself
if (debug >= 3) {
log("Creating MBean for Host " + host);
}
MBeanUtils.createMBean(host);
host.addContainerListener(this);
if (host instanceof StandardHost) {
((StandardHost) host).addPropertyChangeListener(this);
}
// Create the MBeans for the associated nested components
Logger eLogger = host.getParent().getLogger();
Logger hLogger = host.getLogger();
if ((hLogger != null) && (hLogger != eLogger)) {
if (debug >= 3)
log("Creating MBean for Logger " + hLogger);
MBeanUtils.createMBean(hLogger);
}
Realm eRealm = host.getParent().getRealm();
Realm hRealm = host.getRealm();
if ((hRealm != null) && (hRealm != eRealm)) {
if (debug >= 3)
log("Creating MBean for Realm " + hRealm);
MBeanUtils.createMBean(hRealm);
}
// Create 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("Creating MBean for Valve " + hValves[k]);
MBeanUtils.createMBean(hValves[k]);
}
}
// Create the MBeans for each child Context
Container contexts[] = host.findChildren();
for (int k = 0; k < contexts.length; k++) {
createMBeans((Context) contexts[k]);
}
// Create the MBeans for DefaultContext
DefaultContext dcontext = host.getDefaultContext();
if (dcontext != null) {
dcontext.setParent(host);
createMBeans(dcontext);
}
}