public class EmbeddedServerFactory extends Object
Factory that sets up an embedded standalone server using modular classloading.
To use this class the jboss.home.dir system property must be set to the
application server home directory. By default it will use the directories
{$jboss.home.dir}/standalone/config as the configuration directory and
{$jboss.home.dir}/standalone/data as the data directory. This can be overridden
with the ${jboss.server.base.dir}, ${jboss.server.config.dir} or ${jboss.server.config.dir}
system properties as for normal server startup.
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.
| Modifier and Type | Method and Description |
|---|---|
static StandaloneServer |
create(org.jboss.modules.ModuleLoader moduleLoader,
File jbossHomeDir)
Create an embedded standalone server with an already established module loader.
|
static StandaloneServer |
create(org.jboss.modules.ModuleLoader moduleLoader,
File jbossHomeDir,
String[] cmdargs)
Create an embedded standalone server with an already established module loader.
|
static StandaloneServer |
create(String jbossHomePath,
String modulePath,
String... systemPackages)
Create an embedded standalone server.
|
static StandaloneServer |
create(String jbossHomePath,
String modulePath,
String[] systemPackages,
String[] cmdargs)
Create an embedded standalone server.
|
static EmbeddedServerReference |
createHostController(org.jboss.modules.ModuleLoader moduleLoader,
File jbossHomeDir,
String[] cmdargs)
Create an embedded host controller with an already established module loader.
|
static EmbeddedServerReference |
createHostController(String jbossHomePath,
String modulePath,
String[] systemPackages,
String[] cmdargs) |
static EmbeddedServerReference |
createStandalone(org.jboss.modules.ModuleLoader moduleLoader,
File jbossHomeDir,
String[] cmdargs) |
static EmbeddedServerReference |
createStandalone(String jbossHomePath,
String modulePath,
String[] systemPackages,
String[] cmdargs) |
public static StandaloneServer create(String jbossHomePath, String modulePath, String... systemPackages)
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 usedsystemPackages - 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 classlaodernullpublic static StandaloneServer create(String jbossHomePath, String modulePath, String[] systemPackages, String[] cmdargs)
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 usedsystemPackages - 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 classlaodercmdargs - any additional arguments to pass to the embedded server (e.g. -b=192.168.100.10)nullpublic static EmbeddedServerReference createStandalone(String jbossHomePath, String modulePath, String[] systemPackages, String[] cmdargs)
public static StandaloneServer create(org.jboss.modules.ModuleLoader moduleLoader, File jbossHomeDir)
moduleLoader - the module loader. Cannot be nulljbossHomeDir - the location of the root of server installation. Cannot be null or empty.nullpublic static StandaloneServer create(org.jboss.modules.ModuleLoader moduleLoader, File jbossHomeDir, String[] cmdargs)
moduleLoader - the module loader. Cannot be nulljbossHomeDir - 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)nullpublic static EmbeddedServerReference createStandalone(org.jboss.modules.ModuleLoader moduleLoader, File jbossHomeDir, String[] cmdargs)
public static EmbeddedServerReference createHostController(String jbossHomePath, String modulePath, String[] systemPackages, String[] cmdargs)
public static EmbeddedServerReference createHostController(org.jboss.modules.ModuleLoader moduleLoader, File jbossHomeDir, String[] cmdargs)
moduleLoader - the module loader. Cannot be nulljbossHomeDir - 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)nullCopyright © 2015 JBoss by Red Hat. All rights reserved.