Search in sources :

Example 1 with AbsoluteOrderingDescriptor

use of org.glassfish.web.deployment.descriptor.AbsoluteOrderingDescriptor in project Payara by payara.

the class DynamicWebServletRegistrationImpl method start.

/**
 * Starts this web module.
 */
@Override
public synchronized void start() throws LifecycleException {
    // Get interestList of ServletContainerInitializers present, if any.
    List<Object> orderingList = null;
    boolean hasOthers = false;
    Map<String, String> webFragmentMap = Collections.emptyMap();
    if (webBundleDescriptor != null) {
        AbsoluteOrderingDescriptor aod = ((WebBundleDescriptorImpl) webBundleDescriptor).getAbsoluteOrderingDescriptor();
        if (aod != null) {
            orderingList = aod.getOrdering();
            hasOthers = aod.hasOthers();
        }
        webFragmentMap = webBundleDescriptor.getJarNameToWebFragmentNameMap();
    }
    boolean servletInitializersEnabled = true;
    if (webBundleDescriptor != null) {
        servletInitializersEnabled = webBundleDescriptor.getServletInitializersEnabled();
    }
    Iterable<ServletContainerInitializer> allInitializers = ServletContainerInitializerUtil.getServletContainerInitializers(webFragmentMap, orderingList, hasOthers, wmInfo.getAppClassLoader(), servletInitializersEnabled);
    setServletContainerInitializerInterestList(allInitializers);
    DeploymentContext dc = getWebModuleConfig().getDeploymentContext();
    if (dc != null) {
        directoryDeployed = Boolean.valueOf(dc.getAppProps().getProperty(ServerTags.DIRECTORY_DEPLOYED));
    }
    if (webBundleDescriptor != null) {
        showArchivedRealPathEnabled = webBundleDescriptor.isShowArchivedRealPathEnabled();
        servletReloadCheckSecs = webBundleDescriptor.getServletReloadCheckSecs();
        String reqEncoding = webBundleDescriptor.getRequestCharacterEncoding();
        if (reqEncoding != null) {
            setRequestCharacterEncoding(reqEncoding);
        }
        String resEncoding = webBundleDescriptor.getResponseCharacterEncoding();
        if (resEncoding != null) {
            setResponseCharacterEncoding(resEncoding);
        }
    }
    // Start and register Tomcat mbeans
    super.start();
    // Configure catalina listeners and valves. This can only happen
    // after this web module has been started, in order to be able to
    // load the specified listener and valve classes.
    configureValves();
    configureCatalinaProperties();
    webModuleStartedEvent();
    if (directoryListing) {
        setDirectoryListing(directoryListing);
    }
    hasStarted = true;
}
Also used : ServletContainerInitializer(javax.servlet.ServletContainerInitializer) DeploymentContext(org.glassfish.api.deployment.DeploymentContext) WebBundleDescriptorImpl(org.glassfish.web.deployment.descriptor.WebBundleDescriptorImpl) AbsoluteOrderingDescriptor(org.glassfish.web.deployment.descriptor.AbsoluteOrderingDescriptor)

Aggregations

ServletContainerInitializer (javax.servlet.ServletContainerInitializer)1 DeploymentContext (org.glassfish.api.deployment.DeploymentContext)1 AbsoluteOrderingDescriptor (org.glassfish.web.deployment.descriptor.AbsoluteOrderingDescriptor)1 WebBundleDescriptorImpl (org.glassfish.web.deployment.descriptor.WebBundleDescriptorImpl)1