Search in sources :

Example 1 with EmbeddedWebContainer

use of com.sun.enterprise.web.EmbeddedWebContainer in project Payara by payara.

the class WebContainerImpl method init.

// --------------------------------------------------------- Private Methods
private void init() {
    if (initialized) {
        return;
    }
    if (config == null) {
        // use default settings
        config = new WebContainerConfig();
    }
    container = habitat.getServiceHandle(org.glassfish.api.container.Container.class, "com.sun.enterprise.web.WebContainer");
    if (container == null) {
        log.severe("Cannot find webcontainer implementation");
        return;
    }
    ActiveDescriptor<?> activeDescriptor = habitat.getBestDescriptor(BuilderHelper.createContractFilter("com.sun.enterprise.web.EmbeddedWebContainer"));
    if (activeDescriptor == null) {
        log.severe("Cannot find embedded implementation");
        return;
    }
    embeddedInhabitant = habitat.getServiceHandle(activeDescriptor);
    try {
        webContainer = (com.sun.enterprise.web.WebContainer) container.getService();
        embedded = (EmbeddedWebContainer) embeddedInhabitant.getService();
        if ((webContainer == null) || (embedded == null)) {
            log.severe("Cannot find webcontainer implementation");
            return;
        }
        engine = webContainer.getEngine();
        if (engine == null) {
            log.severe("Cannot find engine implementation");
            return;
        }
        initialized = true;
    } catch (Exception e) {
        log.severe("Init exception " + e.getMessage());
    }
}
Also used : EmbeddedWebContainer(com.sun.enterprise.web.EmbeddedWebContainer) WebContainer(org.glassfish.embeddable.web.WebContainer) Container(org.apache.catalina.Container) WebContainerConfig(org.glassfish.embeddable.web.config.WebContainerConfig) PropertyVetoException(java.beans.PropertyVetoException) ConfigException(org.glassfish.embeddable.web.ConfigException) GlassFishException(org.glassfish.embeddable.GlassFishException)

Aggregations

EmbeddedWebContainer (com.sun.enterprise.web.EmbeddedWebContainer)1 PropertyVetoException (java.beans.PropertyVetoException)1 Container (org.apache.catalina.Container)1 GlassFishException (org.glassfish.embeddable.GlassFishException)1 ConfigException (org.glassfish.embeddable.web.ConfigException)1 WebContainer (org.glassfish.embeddable.web.WebContainer)1 WebContainerConfig (org.glassfish.embeddable.web.config.WebContainerConfig)1