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


Java Engine.stop方法代码示例

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


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

示例1: removeEngine

import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
 * Remove the specified Engine from the set of defined Engines, along with
 * all of its related Hosts and Contexts.  All associated Connectors are
 * also removed.
 *
 * @param engine The Engine to be removed
 */
public synchronized void removeEngine(Engine engine) {

    if( log.isDebugEnabled() )
        log.debug("Removing engine (" + engine.getInfo() + ")");

    // Is the specified Engine actually defined?
    int j = -1;
    for (int i = 0; i < engines.length; i++) {
        if (engine == engines[i]) {
            j = i;
            break;
        }
    }
    if (j < 0)
        return;

    // Remove any Connector that is using this Engine
    if( log.isDebugEnabled() )
        log.debug(" Removing related Containers");
    while (true) {
        int n = -1;
        for (int i = 0; i < connectors.length; i++) {
            if (connectors[i].getService().getContainer() == engine) {
                n = i;
                break;
            }
        }
        if (n < 0)
            break;
        removeConnector(connectors[n]);
    }

    // Stop this Engine if necessary
    if( log.isDebugEnabled() )
        log.debug(" Stopping this Engine");
    try {
        engine.stop();
    } catch (LifecycleException e) {
        log.error("Engine.stop", e);
    }

    // Remove this Engine from our set of defined Engines
    if( log.isDebugEnabled() )
        log.debug(" Removing this Engine");
    int k = 0;
    Engine results[] = new Engine[engines.length - 1];
    for (int i = 0; i < engines.length; i++) {
        if (i != j)
            results[k++] = engines[i];
    }
    engines = results;

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:61,代码来源:Embedded.java

示例2: removeEngine

import org.apache.catalina.Engine; //导入方法依赖的package包/类
/**
 * Remove the specified Engine from the set of defined Engines, along with
 * all of its related Hosts and Contexts. All associated Connectors are also
 * removed.
 *
 * @param engine
 *            The Engine to be removed
 */
public synchronized void removeEngine(Engine engine) {

	if (log.isDebugEnabled())
		log.debug("Removing engine (" + engine.getInfo() + ")");

	// Is the specified Engine actually defined?
	int j = -1;
	for (int i = 0; i < engines.length; i++) {
		if (engine == engines[i]) {
			j = i;
			break;
		}
	}
	if (j < 0)
		return;

	// Remove any Connector that is using this Engine
	if (log.isDebugEnabled())
		log.debug(" Removing related Containers");
	while (true) {
		int n = -1;
		for (int i = 0; i < connectors.length; i++) {
			if (connectors[i].getService().getContainer() == engine) {
				n = i;
				break;
			}
		}
		if (n < 0)
			break;
		removeConnector(connectors[n]);
	}

	// Stop this Engine if necessary
	if (log.isDebugEnabled())
		log.debug(" Stopping this Engine");
	try {
		engine.stop();
	} catch (LifecycleException e) {
		log.error("Engine.stop", e);
	}

	// Remove this Engine from our set of defined Engines
	if (log.isDebugEnabled())
		log.debug(" Removing this Engine");
	int k = 0;
	Engine results[] = new Engine[engines.length - 1];
	for (int i = 0; i < engines.length; i++) {
		if (i != j)
			results[k++] = engines[i];
	}
	engines = results;

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:62,代码来源:Embedded.java


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