org.apache.catalina.Loader.setContext()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中org.apache.catalina.Loader.setContext()方法的一些代码示例,展示了Loader.setContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Loader.setContext()方法的具体详情如下:
包路径:org.apache.catalina.Loader
类名称:Loader
方法名:setContext

Loader.setContext介绍

[英]Set the Context with which this Loader has been associated.
[中]设置与此加载程序关联的上下文。

代码示例

代码示例来源:origin: org.apache.tomee/tomee-catalina

@Override
public void setContext(final Context context) {
  delegate.setContext(context);
}

代码示例来源:origin: org.apache.tomee/tomee-catalina

private void initContextLoader(final StandardContext standardContext) {
  final Loader standardContextLoader = standardContext.getLoader();
  if (standardContextLoader != null
      && (
      (!TomEEWebappLoader.class.equals(standardContextLoader.getClass())
        && !WebappLoader.class.equals(standardContextLoader.getClass()))
          || (WebappLoader.class.equals(standardContextLoader.getClass())
              && !WebappLoader.class.cast(standardContextLoader).getLoaderClass().startsWith("org.apache.tom")))
      ) {
    // custom loader, we don't know it
    // and since we don't have a full delegate pattern for our lazy stop loader
    // simply skip lazy stop loader - normally sides effect will be an early shutdown for ears and some particular features
    // only affecting the app if the classes were not laoded at all
    return;
  }
  if (standardContextLoader != null && TomEEWebappLoader.class.isInstance(standardContextLoader)) {
    standardContextLoader.setContext(standardContext);
    return; // no need to replace the loader
  }
  // we just want to wrap it to lazy stop it (afterstop)
  // to avoid classnotfound in @PreDestoy or destroyApplication()
  final TomEEWebappLoader loader = new TomEEWebappLoader();
  loader.setDelegate(standardContext.getDelegate());
  loader.setLoaderClass(TomEEWebappClassLoader.class.getName());
  final Loader lazyStopLoader = new LazyStopLoader(loader);
  standardContext.setLoader(lazyStopLoader);
}

代码示例来源:origin: codefollower/Tomcat-Research

loader.setContext(this);
if (getState().isAvailable() && (loader != null) &&
  (loader instanceof Lifecycle)) {

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

loader.setContext(this);
if (getState().isAvailable() && (loader != null) &&
  (loader instanceof Lifecycle)) {

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

loader.setContext(this);
if (getState().isAvailable() && (loader != null) &&
  (loader instanceof Lifecycle)) {

相关文章