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


Java Container.getLoader方法代码示例

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


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

示例1: processChildren

import org.apache.catalina.Container; //导入方法依赖的package包/类
protected void processChildren(Container container, ClassLoader cl) {
    try {
        if (container.getLoader() != null) {
            Thread.currentThread().setContextClassLoader
                (container.getLoader().getClassLoader());
        }
        container.backgroundProcess();
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
        log.error("Exception invoking periodic operation: ", t);
    } finally {
        Thread.currentThread().setContextClassLoader(cl);
    }
    Container[] children = container.findChildren();
    for (int i = 0; i < children.length; i++) {
        if (children[i].getBackgroundProcessorDelay() <= 0) {
            processChildren(children[i], cl);
        }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:21,代码来源:ContainerBase.java

示例2: run

import org.apache.catalina.Container; //导入方法依赖的package包/类
public void run() {
    while (!threadDone) {
        try {
            Thread.sleep(backgroundProcessorDelay * 1000L);
        } catch (InterruptedException e) {
            ;
        }
        if (!threadDone) {
            Container parent = (Container) getMappingObject();
            ClassLoader cl = 
                Thread.currentThread().getContextClassLoader();
            if (parent.getLoader() != null) {
                cl = parent.getLoader().getClassLoader();
            }
            processChildren(parent, cl);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:ContainerBase.java

示例3: processChildren

import org.apache.catalina.Container; //导入方法依赖的package包/类
protected void processChildren(Container container, ClassLoader cl) {
    try {
        if (container.getLoader() != null) {
            Thread.currentThread().setContextClassLoader
                (container.getLoader().getClassLoader());
        }
        container.backgroundProcess();
    } catch (Throwable t) {
        log.error("Exception invoking periodic operation: ", t);
    } finally {
        Thread.currentThread().setContextClassLoader(cl);
    }
    Container[] children = container.findChildren();
    for (int i = 0; i < children.length; i++) {
        if (children[i].getBackgroundProcessorDelay() <= 0) {
            processChildren(children[i], cl);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:ContainerBase.java

示例4: processChildren

import org.apache.catalina.Container; //导入方法依赖的package包/类
protected void processChildren(Container container, ClassLoader cl) {
	try {
		if (container.getLoader() != null) {
			Thread.currentThread().setContextClassLoader(container.getLoader().getClassLoader());
		}
		container.backgroundProcess();
	} catch (Throwable t) {
		ExceptionUtils.handleThrowable(t);
		log.error("Exception invoking periodic operation: ", t);
	} finally {
		Thread.currentThread().setContextClassLoader(cl);
	}
	Container[] children = container.findChildren();
	for (int i = 0; i < children.length; i++) {
		if (children[i].getBackgroundProcessorDelay() <= 0) {
			processChildren(children[i], cl);
		}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:20,代码来源:ContainerBase.java

示例5: getClassLoaders

import org.apache.catalina.Container; //导入方法依赖的package包/类
public static ClassLoader[] getClassLoaders(Container container) {
    Loader loader = null;
    ClassLoader classLoader = null;
    if (container != null) loader = container.getLoader();
    if (loader != null) classLoader = loader.getClassLoader();
    else classLoader = Thread.currentThread().getContextClassLoader();
    if ( classLoader == Thread.currentThread().getContextClassLoader() ) {
        return new ClassLoader[] {classLoader};
    } else {
        return new ClassLoader[] {classLoader,Thread.currentThread().getContextClassLoader()};
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:13,代码来源:ClusterManagerBase.java

示例6: getClassLoaders

import org.apache.catalina.Container; //导入方法依赖的package包/类
public static ClassLoader[] getClassLoaders(Container container) {
	Loader loader = null;
	ClassLoader classLoader = null;
	if (container != null)
		loader = container.getLoader();
	if (loader != null)
		classLoader = loader.getClassLoader();
	else
		classLoader = Thread.currentThread().getContextClassLoader();
	if (classLoader == Thread.currentThread().getContextClassLoader()) {
		return new ClassLoader[] { classLoader };
	} else {
		return new ClassLoader[] { classLoader, Thread.currentThread().getContextClassLoader() };
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:16,代码来源:ClusterManagerBase.java


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