Class EmbeddedProcessFactory


  • public class EmbeddedProcessFactory
    extends Object

    Factory that sets up an embedded StandaloneServer or HostController process using modular classloading.

    If a clean run is wanted, you can specify ${jboss.embedded.root} to an existing directory which will copy the contents of the data and configuration directories under a temporary folder. This has the effect of this run not polluting later runs of the embedded server.

    Author:
    Kabir Khan, Thomas.Diesler@jboss.com
    • Method Detail

      • createStandaloneServer

        public static StandaloneServer createStandaloneServer​(String jbossHomePath,
                                                              String modulePath,
                                                              String... systemPackages)
        Create an embedded standalone server.
        Parameters:
        jbossHomePath - the location of the root of server installation. Cannot be null or empty.
        modulePath - the location of the root of the module repository. May be null if the standard location under jbossHomePath should be used
        systemPackages - names of any packages that must be treated as system packages, with the same classes visible to the caller's classloader visible to server-side classes loaded from the server's modular classloader
        Returns:
        the server. Will not be null
      • createStandaloneServer

        public static StandaloneServer createStandaloneServer​(String jbossHomePath,
                                                              String modulePath,
                                                              String[] systemPackages,
                                                              String[] cmdargs)
        Create an embedded standalone server.
        Parameters:
        jbossHomePath - the location of the root of server installation. Cannot be null or empty.
        modulePath - the location of the root of the module repository. May be null if the standard location under jbossHomePath should be used
        systemPackages - names of any packages that must be treated as system packages, with the same classes visible to the caller's classloader visible to server-side classes loaded from the server's modular classloader
        cmdargs - any additional arguments to pass to the embedded server (e.g. -b=192.168.100.10)
        Returns:
        the server. Will not be null
      • createStandaloneServer

        public static StandaloneServer createStandaloneServer​(org.jboss.modules.ModuleLoader moduleLoader,
                                                              File jbossHomeDir,
                                                              String... cmdargs)
        Create an embedded standalone server with an already established module loader.
        Parameters:
        moduleLoader - the module loader. Cannot be null
        jbossHomeDir - the location of the root of server installation. Cannot be null or empty.
        cmdargs - any additional arguments to pass to the embedded server (e.g. -b=192.168.100.10)
        Returns:
        the running embedded server. Will not be null
      • createStandaloneServer

        public static StandaloneServer createStandaloneServer​(Configuration configuration)
        Create an embedded standalone server with an already established module loader.
        Parameters:
        configuration - the configuration for the embedded server
        Returns:
        the running embedded server. Will not be null
      • createHostController

        public static HostController createHostController​(String jbossHomePath,
                                                          String modulePath,
                                                          String[] systemPackages,
                                                          String[] cmdargs)
        Create an embedded host controller.
        Parameters:
        jbossHomePath - the location of the root of the host controller installation. Cannot be null or empty.
        modulePath - the location of the root of the module repository. May be null if the standard location under jbossHomePath should be used
        systemPackages - names of any packages that must be treated as system packages, with the same classes visible to the caller's classloader visible to host-controller-side classes loaded from the server's modular classloader
        cmdargs - any additional arguments to pass to the embedded host controller (e.g. -b=192.168.100.10)
        Returns:
        the server. Will not be null
      • createHostController

        public static HostController createHostController​(org.jboss.modules.ModuleLoader moduleLoader,
                                                          File jbossHomeDir,
                                                          String[] cmdargs)
        Create an embedded host controller with an already established module loader.
        Parameters:
        moduleLoader - the module loader. Cannot be null
        jbossHomeDir - the location of the root of server installation. Cannot be null or empty.
        cmdargs - any additional arguments to pass to the embedded host controller (e.g. -b=192.168.100.10)
        Returns:
        the running host controller Will not be null
      • createHostController

        public static HostController createHostController​(Configuration configuration)
        Create an embedded host controller with an already established module loader.
        Parameters:
        configuration - the configuration for the embedded host controller
        Returns:
        the running host controller Will not be null