Class Tomcat8xEmbeddedLocalContainer

    • Constructor Detail

      • Tomcat8xEmbeddedLocalContainer

        public Tomcat8xEmbeddedLocalContainer​(LocalConfiguration configuration)
        Creates a Tomcat 8.x EmbeddedLocalContainer.
        Parameters:
        configuration - the configuration of the newly created container.
    • Method Detail

      • getId

        public String getId()
        Returns:
        the short name of the container. Note: this is not a unique id. It is simply the name in a computer-usable format.
      • getName

        public String getName()
        Returns:
        the human readable name of the Container (ex: "Resin 3.x", "JBoss 3.0.8", etc).
      • prepareController

        protected void prepareController​(TomcatEmbedded wrapper,
                                         File home,
                                         int port)
        Prepare the Tomcat controller. After this method returns, the host and connector protected attributes must be set.
        Specified by:
        prepareController in class AbstractCatalinaEmbeddedLocalContainer
        Parameters:
        wrapper - Tomcat wrapper.
        home - CATALINA_BASE directory.
        port - HTTP port.
      • getClassLoader

        public ClassLoader getClassLoader()
        Tomcat 8.x has a weird class called TomcatURLStreamHandlerFactory where the singleton has a static instance field and a final attribute registered which are not always in sync and cause unexpected exceptions. Save old class loaders in order to avoid trouble when the container is executed twice (for example, in CARGO's integration tests).
        Specified by:
        getClassLoader in interface EmbeddedLocalContainer
        Overrides:
        getClassLoader in class AbstractEmbeddedLocalContainer
        Returns:
        the custom classloader to use for loading the Embedded container's classes.