Package org.apache.hadoop.yarn.webapp
Class WebApps
java.lang.Object
org.apache.hadoop.yarn.webapp.WebApps
Helpers to create an embedded webapp.
Quick start:
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");
}
});-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> WebApps.Builder<T>static <T> WebApps.Builder<T>Create a new webapp builder.static <T> WebApps.Builder<T>Create a new webapp builder.static <T> WebApps.Builder<T>static <T> WebApps.Builder<T>$for(T app)
-
Constructor Details
-
WebApps
public WebApps()
-
-
Method Details
-
$for
Create a new webapp builder.- Type Parameters:
T- application (holding the embedded webapp) type- Parameters:
prefix- of the webappapi- the api class for the applicationapp- the application instancewsPrefix- the prefix for the webservice api for this app- Returns:
- a webapp builder
- See Also:
-
$for
Create a new webapp builder.- Type Parameters:
T- application (holding the embedded webapp) type- Parameters:
prefix- of the webappapi- the api class for the applicationapp- the application instance- Returns:
- a webapp builder
- See Also:
-
$for
-
$for
-
$for
-