Class TomcatEmbedded.Embedded

  • Enclosing class:
    TomcatEmbedded

    public final class TomcatEmbedded.Embedded
    extends Object
    Copy of org.apache.catalina.startup.Embedded
    • Method Detail

      • createHost

        public TomcatEmbedded.Host createHost​(String name,
                                              File appBase)
        Creates a new virtual host mapping.
        Parameters:
        name - Host name.
        appBase - The "webapp" directory.
        Returns:
        Always non-null.
      • start

        public void start()
        Starts the container.
      • stop

        public void stop()
        Stops the container.
      • createConnector

        public TomcatEmbedded.Connector createConnector​(InetAddress inetAddress,
                                                        int port,
                                                        boolean secure)
        Creates a new connector.
        Parameters:
        inetAddress - non-null if you want to bind to specific interfaces
        port - TCP port number.
        secure - Not sure what this really is.
        Returns:
        Always non-null.
      • addConnector

        public void addConnector​(TomcatEmbedded.Connector connector)
        Adds a connector.
        Parameters:
        connector - must be non-null.
      • createContext

        public TomcatEmbedded.Context createContext​(String path,
                                                    String docBase)
        Creates an web application for deployment.
        Parameters:
        path - the context URL
        docBase - the exploded war file image.
        Returns:
        Always non-null
      • setRealm

        public void setRealm​(TomcatEmbedded.MemoryRealm realm)
        Associates a realm to Tomcat.
        Parameters:
        realm - realm object.
      • setCatalinaBase

        public void setCatalinaBase​(File dir)
        Sets the Tomcat installation where catalina jars are loaded from.
        Parameters:
        dir - the home directory.
      • setCatalinaHome

        public void setCatalinaHome​(File dir)
        Sets the directory where Tomcat stores data file for the current running instance.
        Parameters:
        dir - the home directory.
      • setPort

        public void setPort​(int port)
        Sets the HTTP port number.
        Parameters:
        port - Port.
      • enableNaming

        public void enableNaming()
        Enable JNDI naming.