当前位置: 首页>>代码示例>>Java>>正文


Java Engine.findChildren方法代码示例

本文整理汇总了Java中org.apache.catalina.Engine.findChildren方法的典型用法代码示例。如果您正苦于以下问题:Java Engine.findChildren方法的具体用法?Java Engine.findChildren怎么用?Java Engine.findChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.catalina.Engine的用法示例。


在下文中一共展示了Engine.findChildren方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startInternal

import org.apache.catalina.Engine; //导入方法依赖的package包/类
@Override
public void startInternal() throws LifecycleException {

    setState(LifecycleState.STARTING);

    // Find any components that have already been initialized since the
    // MBean listener won't be notified as those components will have
    // already registered their MBeans
    findDefaultHost();

    Engine engine = (Engine) connector.getService().getContainer();
    addListeners(engine);

    Container[] conHosts = engine.findChildren();
    for (Container conHost : conHosts) {
        Host host = (Host) conHost;
        if (!LifecycleState.NEW.equals(host.getState())) {
            // Registering the host will register the context and wrappers
            registerHost(host);
        }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:23,代码来源:MapperListener.java

示例2: reset

import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
 * Reset configuration for a particular proxy following an error.
 */
protected void reset(int pos) {
   
    Service[] services = ServerFactory.getServer().findServices();
    for (int i = 0; i < services.length; i++) {
        Engine engine = (Engine) services[i].getContainer();
        removeAll((Engine) services[i].getContainer(), pos);
        config(engine, pos);
        Container[] children = engine.findChildren();
        for (int j = 0; j < children.length; j++) {
            Container[] children2 = children[j].findChildren();
            for (int k = 0; k < children2.length; k++) {
                addContext((Context) children2[k], pos);
            }
        }
    }
    
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:ClusterListener.java

示例3: startInternal

import org.apache.catalina.Engine; //导入方法依赖的package包/类
@Override
public void startInternal() throws LifecycleException {

    setState(LifecycleState.STARTING);

    // Find any components that have already been initialized since the
    // MBean listener won't be notified as those components will have
    // already registered their MBeans
    findDefaultHost();

    Engine engine = (Engine) connector.getService().getContainer();
 //递归为所有的容器注册MapperListener监听器 对已经形成的容器建立体系 便于查找
    addListeners(engine);

    Container[] conHosts = engine.findChildren();
    for (Container conHost : conHosts) {
        Host host = (Host) conHost;
        if (!LifecycleState.NEW.equals(host.getState())) {
            // Registering the host will register the context and wrappers
            registerHost(host);
        }
    }
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:24,代码来源:MapperListener.java

示例4: startInternal

import org.apache.catalina.Engine; //导入方法依赖的package包/类
@Override
public void startInternal() throws LifecycleException {

	setState(LifecycleState.STARTING);

	// Find any components that have already been initialized since the
	// MBean listener won't be notified as those components will have
	// already registered their MBeans
	findDefaultHost();

	Engine engine = (Engine) connector.getService().getContainer();
	addListeners(engine);

	Container[] conHosts = engine.findChildren();
	for (Container conHost : conHosts) {
		Host host = (Host) conHost;
		if (!LifecycleState.NEW.equals(host.getState())) {
			// Registering the host will register the context and wrappers
			registerHost(host);
		}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:23,代码来源:MapperListener.java

示例5: findDefaultHost

import org.apache.catalina.Engine; //导入方法依赖的package包/类
private void findDefaultHost() {

        Engine engine = (Engine) connector.getService().getContainer();
        String defaultHost = engine.getDefaultHost();

        boolean found = false;

        if (defaultHost != null && defaultHost.length() >0) {
            Container[] containers = engine.findChildren();

            for (Container container : containers) {
                Host host = (Host) container;
                if (defaultHost.equalsIgnoreCase(host.getName())) {
                    found = true;
                    break;
                }

                String[] aliases = host.findAliases();
                for (String alias : aliases) {
                    if (defaultHost.equalsIgnoreCase(alias)) {
                        found = true;
                        break;
                    }
                }
            }
        }

        if(found) {
            mapper.setDefaultHostName(defaultHost);
        } else {
            log.warn(sm.getString("mapperListener.unknownDefaultHost",
                    defaultHost, connector));
        }
    }
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:35,代码来源:MapperListener.java

示例6: registerListenersForEngine

import org.apache.catalina.Engine; //导入方法依赖的package包/类
private void registerListenersForEngine(Engine engine) {
    for (Container hostContainer : engine.findChildren()) {
        Host host = (Host) hostContainer;
        host.addContainerListener(this);
        registerListenersForHost(host);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:8,代码来源:ThreadLocalLeakPreventionListener.java

示例7: createMBeans

import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
 * Create the MBeans for the specified Engine and its nested components.
 *
 * @param engine Engine for which to create MBeans
 *
 * @exception Exception if an exception is thrown during MBean creation
 */
protected void createMBeans(Engine engine) throws Exception {

    // Create the MBean for the Engine itself
    if (log.isDebugEnabled()) {
        log.debug("Creating MBean for Engine " + engine);
    }
    //MBeanUtils.createMBean(engine);
    engine.addContainerListener(this);
    if (engine instanceof StandardEngine) {
        ((StandardEngine) engine).addPropertyChangeListener(this);
    }

    // Create the MBeans for the associated nested components
    Realm eRealm = engine.getRealm();
    if (eRealm != null) {
        if (log.isDebugEnabled())
            log.debug("Creating MBean for Realm " + eRealm);
        //MBeanUtils.createMBean(eRealm);
    }

    // Create the MBeans for each child Host
    Container hosts[] = engine.findChildren();
    for (int j = 0; j < hosts.length; j++) {
        createMBeans((Host) hosts[j]);
    }

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:35,代码来源:ServerLifecycleListener.java

示例8: destroyMBeans

import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
 * Deregister the MBeans for the specified Engine and its nested
 * components.
 *
 * @param engine Engine for which to destroy MBeans
 *
 * @exception Exception if an exception is thrown during MBean destruction
 */
protected void destroyMBeans(Engine engine) throws Exception {

    // Deregister ourselves as a ContainerListener
    engine.removeContainerListener(this);

    // Deregister the MBeans for each child Host
    Container hosts[] = engine.findChildren();
    for (int k = 0; k < hosts.length; k++) {
        destroyMBeans((Host) hosts[k]);
    }

    // Deregister the MBeans for the associated nested components
    Realm eRealm = engine.getRealm();
    if (eRealm != null) {
        if (log.isDebugEnabled())
            log.debug("Destroying MBean for Realm " + eRealm);
        //MBeanUtils.destroyMBean(eRealm);
    }

    // Deregister the MBean for the Engine itself
    if (log.isDebugEnabled()) {
        log.debug("Destroying MBean for Engine " + engine);
    }
    //MBeanUtils.destroyMBean(engine);

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:35,代码来源:ServerLifecycleListener.java

示例9: findDefaultHost

import org.apache.catalina.Engine; //导入方法依赖的package包/类
private void findDefaultHost() {

        Engine engine = (Engine) connector.getService().getContainer();
        String defaultHost = engine.getDefaultHost();

        boolean found = false;

        if (defaultHost != null && defaultHost.length() >0) {
            Container[] containers = engine.findChildren();

            for (Container container : containers) {
                Host host = (Host) container;
                if (defaultHost.equalsIgnoreCase(host.getName())) {
                    found = true;
                    break;
                }

                String[] aliases = host.findAliases();
                for (String alias : aliases) {
                    if (defaultHost.equalsIgnoreCase(alias)) {
                        found = true;
                        break;
                    }
                }
            }
        }

        if(found) {
            // localhost
            mapper.setDefaultHostName(defaultHost);
        } else {
            log.warn(sm.getString("mapperListener.unknownDefaultHost",
                    defaultHost, connector));
        }
    }
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:36,代码来源:MapperListener.java

示例10: findDefaultHost

import org.apache.catalina.Engine; //导入方法依赖的package包/类
private void findDefaultHost() {

		Engine engine = (Engine) connector.getService().getContainer();
		String defaultHost = engine.getDefaultHost();

		boolean found = false;

		if (defaultHost != null && defaultHost.length() > 0) {
			Container[] containers = engine.findChildren();

			for (Container container : containers) {
				Host host = (Host) container;
				if (defaultHost.equalsIgnoreCase(host.getName())) {
					found = true;
					break;
				}

				String[] aliases = host.findAliases();
				for (String alias : aliases) {
					if (defaultHost.equalsIgnoreCase(alias)) {
						found = true;
						break;
					}
				}
			}
		}

		if (found) {
			mapper.setDefaultHostName(defaultHost);
		} else {
			log.warn(sm.getString("mapperListener.unknownDefaultHost", defaultHost, connector));
		}
	}
 
开发者ID:how2j,项目名称:lazycat,代码行数:34,代码来源:MapperListener.java

示例11: registerListenersForEngine

import org.apache.catalina.Engine; //导入方法依赖的package包/类
private void registerListenersForEngine(Engine engine) {
	for (Container hostContainer : engine.findChildren()) {
		Host host = (Host) hostContainer;
		host.addContainerListener(this);
		registerListenersForHost(host);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:8,代码来源:ThreadLocalLeakPreventionListener.java

示例12: createMBeans

import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
 * Create the MBeans for the specified Engine and its nested components.
 *
 * @param engine Engine for which to create MBeans
 *
 * @exception Exception if an exception is thrown during MBean creation
 */
protected void createMBeans(Engine engine) throws Exception {

    // Create the MBean for the Engine itself
    if (debug >= 2) {
        log("Creating MBean for Engine " + engine);
    }
    MBeanUtils.createMBean(engine);
    engine.addContainerListener(this);
    if (engine instanceof StandardEngine) {
        ((StandardEngine) engine).addPropertyChangeListener(this);
    }

    // Create the MBeans for the associated nested components
    Logger eLogger = engine.getLogger();
    if (eLogger != null) {
        if (debug >= 2)
            log("Creating MBean for Logger " + eLogger);
        MBeanUtils.createMBean(eLogger);
    }
    Realm eRealm = engine.getRealm();
    if (eRealm != null) {
        if (debug >= 2)
            log("Creating MBean for Realm " + eRealm);
        MBeanUtils.createMBean(eRealm);
    }

    // Create the MBeans for the associated Valves
    if (engine instanceof StandardEngine) {
        Valve eValves[] = ((StandardEngine)engine).getValves();
        for (int j = 0; j < eValves.length; j++) {
            if (debug >= 2)
                log("Creating MBean for Valve " + eValves[j]);
            MBeanUtils.createMBean(eValves[j]);
        }
    }

    // Create the MBeans for each child Host
    Container hosts[] = engine.findChildren();
    for (int j = 0; j < hosts.length; j++) {
        createMBeans((Host) hosts[j]);
    }

    // Create the MBeans for DefaultContext
    DefaultContext dcontext = engine.getDefaultContext();
    if (dcontext != null) {
        dcontext.setParent(engine);
        createMBeans(dcontext);
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:58,代码来源:ServerLifecycleListener.java

示例13: destroyMBeans

import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
 * Deregister the MBeans for the specified Engine and its nested
 * components.
 *
 * @param engine Engine for which to destroy MBeans
 *
 * @exception Exception if an exception is thrown during MBean destruction
 */
protected void destroyMBeans(Engine engine) throws Exception {

    // Deregister ourselves as a ContainerListener
    engine.removeContainerListener(this);

    // Deregister the MBeans for each child Host
    Container hosts[] = engine.findChildren();
    for (int k = 0; k < hosts.length; k++) {
        destroyMBeans((Host) hosts[k]);
    }

    // Deregister the MBeans for the associated Valves
    if (engine instanceof StandardEngine) {
        Valve eValves[] = ((StandardEngine)engine).getValves();
        for (int k = 0; k < eValves.length; k++) {
            if (debug >= 3)
                log("Destroying MBean for Valve " + eValves[k]);
            MBeanUtils.destroyMBean(eValves[k], engine);
        }
    }

    // Deregister the MBeans for the associated nested components
    Realm eRealm = engine.getRealm();
    if (eRealm != null) {
        if (debug >= 3)
            log("Destroying MBean for Realm " + eRealm);
        MBeanUtils.destroyMBean(eRealm);
    }
    Logger eLogger = engine.getLogger();
    if (eLogger != null) {
        if (debug >= 3)
            log("Destroying MBean for Logger " + eLogger);
        MBeanUtils.destroyMBean(eLogger);
    }

    // Deregister the MBean for the Engine itself
    if (debug >= 2) {
        log("Destroying MBean for Engine " + engine);
    }
    MBeanUtils.destroyMBean(engine);

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:51,代码来源:ServerLifecycleListener.java


注:本文中的org.apache.catalina.Engine.findChildren方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。