org.apache.hadoop.yarn.webapp
Class WebApps
java.lang.Object
org.apache.hadoop.yarn.webapp.WebApps
public class WebApps
- extends Object
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");
}
});
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebApps
public WebApps()
$for
public static <T> WebApps.Builder<T> $for(String prefix,
Class<T> api,
T app,
String wsPrefix)
- 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 a complete example
$for
public static <T> WebApps.Builder<T> $for(String prefix,
Class<T> api,
T app)
- 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 a complete example
$for
public static <T> WebApps.Builder<T> $for(String prefix,
T app)
$for
public static <T> WebApps.Builder<T> $for(T app)
$for
public static <T> WebApps.Builder<T> $for(String prefix)
Copyright © 2012 Apache Software Foundation. All Rights Reserved.