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


Java Connector.init方法代码示例

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


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

示例1: initInternal

import org.apache.catalina.connector.Connector; //导入方法依赖的package包/类
/**
 * Invoke a pre-startup initialization. This is used to allow connectors
 * to bind to restricted ports under Unix operating environments.
 */
@Override
protected void initInternal() throws LifecycleException {

    super.initInternal();
    
    if (container != null) {
        container.init();
    }

    // Initialize any Executors
    for (Executor executor : findExecutors()) {
        if (executor instanceof LifecycleMBeanBase) {
            ((LifecycleMBeanBase) executor).setDomain(getDomain());
        }
        executor.init();  // StandardThreadExecutor#initInternal
    }

    // Initialize our defined Connectors
    synchronized (connectorsLock) {
        for (Connector connector : connectors) {
            try {
                connector.init();
            } catch (Exception e) {
                String message = sm.getString(
                        "standardService.connector.initFailed", connector);
                log.error(message, e);

                if (Boolean.getBoolean("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE"))
                    throw new LifecycleException(message);
            }
        }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:38,代码来源:StandardService.java

示例2: initInternal

import org.apache.catalina.connector.Connector; //导入方法依赖的package包/类
/**
 * Invoke a pre-startup initialization. This is used to allow connectors
 * to bind to restricted ports under Unix operating environments.
 */
@Override
protected void initInternal() throws LifecycleException {

    super.initInternal();
    
    if (container != null) {
     //初始化容器StandEngine
        container.init();
    }

    // Initialize any Executors
    for (Executor executor : findExecutors()) {
        if (executor instanceof LifecycleMBeanBase) {
            ((LifecycleMBeanBase) executor).setDomain(getDomain());
        }
        executor.init();
    }

    // 等到容器初始化的差不多的时候才去初始化连接器
    // Initialize our defined Connectors
    synchronized (connectorsLock) {
        for (Connector connector : connectors) {
            try {
            	//
                connector.init();
            } catch (Exception e) {
                String message = sm.getString(
                        "standardService.connector.initFailed", connector);
                log.error(message, e);

                if (Boolean.getBoolean("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE"))
                    throw new LifecycleException(message);
            }
        }
    }
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:41,代码来源:StandardService.java

示例3: initInternal

import org.apache.catalina.connector.Connector; //导入方法依赖的package包/类
/**
 * Invoke a pre-startup initialization. This is used to allow connectors to
 * bind to restricted ports under Unix operating environments.
 */
@Override
protected void initInternal() throws LifecycleException {

	super.initInternal();

	if (container != null) {
		container.init();
	}

	// Initialize any Executors
	for (Executor executor : findExecutors()) {
		if (executor instanceof LifecycleMBeanBase) {
			((LifecycleMBeanBase) executor).setDomain(getDomain());
		}
		executor.init();
	}

	// Initialize our defined Connectors
	synchronized (connectorsLock) {
		for (Connector connector : connectors) {
			try {
				connector.init();
			} catch (Exception e) {
				String message = sm.getString("standardService.connector.initFailed", connector);
				log.error(message, e);

				if (Boolean.getBoolean("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE"))
					throw new LifecycleException(message);
			}
		}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:37,代码来源:StandardService.java


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