本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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()};
}
}
示例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() };
}
}