@LimitedPrivate({"YARN","MapReduce"})
public class WebApps
extends java.lang.Object
WebApp wa = WebApps.$for(myApp).start();Starts a webapp with default routes binds to 0.0.0.0 (all network interfaces) on an ephemeral port, which can be obtained with:
int port = wa.port();With more options:
WebApp wa = WebApps.$for(myApp).at(address, port).
with(configuration).
start(new WebApp() {
@Override public void setup() {
route("/foo/action", FooController.class);
route("/foo/:id", FooController.class, "show");
}
});| Modifier and Type | Class | Description |
|---|---|---|
static class |
WebApps.Builder<T> |
| Constructor | Description |
|---|---|
WebApps() |
| Modifier and Type | Method | Description |
|---|---|---|
static <T> WebApps.Builder<T> |
$for(java.lang.String prefix) |
|
static <T> WebApps.Builder<T> |
$for(java.lang.String prefix,
java.lang.Class<T> api,
T app) |
Create a new webapp builder.
|
static <T> WebApps.Builder<T> |
$for(java.lang.String prefix,
java.lang.Class<T> api,
T app,
java.lang.String wsPrefix) |
Create a new webapp builder.
|
static <T> WebApps.Builder<T> |
$for(java.lang.String prefix,
T app) |
|
static <T> WebApps.Builder<T> |
$for(T app) |
public static <T> WebApps.Builder<T> $for(java.lang.String prefix, java.lang.Class<T> api, T app, java.lang.String wsPrefix)
T - application (holding the embedded webapp) typeprefix - of the webappapi - the api class for the applicationapp - the application instancewsPrefix - the prefix for the webservice api for this appfor a complete examplepublic static <T> WebApps.Builder<T> $for(java.lang.String prefix, java.lang.Class<T> api, T app)
T - application (holding the embedded webapp) typeprefix - of the webappapi - the api class for the applicationapp - the application instancefor a complete examplepublic static <T> WebApps.Builder<T> $for(java.lang.String prefix, T app)
public static <T> WebApps.Builder<T> $for(T app)
public static <T> WebApps.Builder<T> $for(java.lang.String prefix)
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.