@InterfaceAudience.LimitedPrivate(value={"YARN","MapReduce"})
public class WebApps
extends 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 and Description |
|---|---|
static class |
WebApps.Builder<T> |
| Constructor and Description |
|---|
WebApps() |
| Modifier and Type | Method and Description |
|---|---|
static <T> WebApps.Builder<T> |
$for(String prefix) |
static <T> WebApps.Builder<T> |
$for(String prefix,
Class<T> api,
T app)
Create a new webapp builder.
|
static <T> WebApps.Builder<T> |
$for(String prefix,
Class<T> api,
T app,
String wsPrefix)
Create a new webapp builder.
|
static <T> WebApps.Builder<T> |
$for(String prefix,
T app) |
static <T> WebApps.Builder<T> |
$for(T app) |
public static <T> WebApps.Builder<T> $for(String prefix, Class<T> api, T app, 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(String prefix, 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(String prefix, T app)
public static <T> WebApps.Builder<T> $for(T app)
public static <T> WebApps.Builder<T> $for(String prefix)
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.