Java Code Examples for org.apache.catalina.LifecycleState#NEW

The following examples show how to use org.apache.catalina.LifecycleState#NEW . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebappClassLoaderBase.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
protected void copyStateWithoutTransformers(WebappClassLoaderBase base) {
    base.resources = this.resources;
    base.delegate = this.delegate;
    base.state = LifecycleState.NEW;
    base.clearReferencesStopThreads = this.clearReferencesStopThreads;
    base.clearReferencesStopTimerThreads = this.clearReferencesStopTimerThreads;
    base.clearReferencesLogFactoryRelease = this.clearReferencesLogFactoryRelease;
    base.clearReferencesHttpClientKeepAliveThread = this.clearReferencesHttpClientKeepAliveThread;
    base.jarModificationTimes.putAll(this.jarModificationTimes);
    base.permissionList.addAll(this.permissionList);
    base.loaderPC.putAll(this.loaderPC);
}
 
Example 2
Source File: ArkTomcatServletWebServerFactory.java    From sofa-ark with Apache License 2.0 5 votes vote down vote up
@Override
protected void prepareContext(Host host, ServletContextInitializer[] initializers) {
    if (host.getState() == LifecycleState.NEW) {
        super.prepareContext(host, initializers);
    } else {
        File documentRoot = getValidDocumentRoot();
        StandardContext context = new StandardContext();
        if (documentRoot != null) {
            context.setResources(new StandardRoot(context));
        }
        context.setName(getContextPath());
        context.setDisplayName(getDisplayName());
        context.setPath(getContextPath());
        File docBase = (documentRoot != null) ? documentRoot : createTempDir("tomcat-docbase");
        context.setDocBase(docBase.getAbsolutePath());
        context.addLifecycleListener(new Tomcat.FixContextListener());
        context.setParentClassLoader(Thread.currentThread().getContextClassLoader());
        resetDefaultLocaleMapping(context);
        addLocaleMappings(context);
        context.setUseRelativeRedirects(false);
        configureTldSkipPatterns(context);
        WebappLoader loader = new WebappLoader(context.getParentClassLoader());
        loader
            .setLoaderClass("com.alipay.sofa.ark.web.embed.tomcat.ArkTomcatEmbeddedWebappClassLoader");
        loader.setDelegate(true);
        context.setLoader(loader);
        if (isRegisterDefaultServlet()) {
            addDefaultServlet(context);
        }
        if (shouldRegisterJspServlet()) {
            addJspServlet(context);
            addJasperInitializer(context);
        }
        context.addLifecycleListener(new StaticResourceConfigurer(context));
        ServletContextInitializer[] initializersToUse = mergeInitializers(initializers);
        context.setParent(host);
        configureContext(context, initializersToUse);
        host.addChild(context);
    }
}
 
Example 3
Source File: MockWebResourceRoot.java    From joinfaces with Apache License 2.0 4 votes vote down vote up
@Override
public LifecycleState getState() {
	return LifecycleState.NEW;
}
 
Example 4
Source File: WebappClassLoaderBase.java    From Tomcat7.0.67 with Apache License 2.0 2 votes vote down vote up
/**
 * Obtain the current state of the source component.
 *
 * @return The current state of the source component.
 */
@Override
public LifecycleState getState() {
    return LifecycleState.NEW;
}
 
Example 5
Source File: WebappClassLoaderBase.java    From tomcatsrc with Apache License 2.0 2 votes vote down vote up
/**
 * Obtain the current state of the source component.
 *
 * @return The current state of the source component.
 */
@Override
public LifecycleState getState() {
    return LifecycleState.NEW;
}