本文整理了Java中io.vertx.ext.web.Route.enable
方法的一些代码示例,展示了Route.enable
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Route.enable
方法的具体详情如下:
包路径:io.vertx.ext.web.Route
类名称:Route
方法名:enable
[英]Enable this route.
[中]启用此路线。
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Enable this route.
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.ext.web.Route enable() {
delegate.enable();
return this;
}
代码示例来源:origin: gentics/mesh
@Override
public InternalEndpointRoute enable() {
route.enable();
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Enable this route.
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.ext.web.Route enable() {
delegate.enable();
return this;
}
代码示例来源:origin: wang007/vertx-start
@Override
public Route enable() {
return delegate.enable();
}
代码示例来源:origin: vert-x3/vertx-web
@Test
public void testDisableEnable() throws Exception {
String path = "/blah";
Route route1 = router.route(path).handler(rc -> {
rc.response().setChunked(true);
rc.response().write("apples");
rc.next();
});
Route route2 = router.route(path).handler(rc -> {
rc.response().write("oranges");
rc.next();
});
Route route3 = router.route(path).handler(rc -> {
rc.response().write("bananas");
rc.response().end();
});
testRequest(HttpMethod.GET, path, 200, "OK", "applesorangesbananas");
route2.disable();
testRequest(HttpMethod.GET, path, 200, "OK", "applesbananas");
route1.disable();
route3.disable();
testRequest(HttpMethod.GET, path, 404, "Not Found");
route3.enable();
route1.enable();
testRequest(HttpMethod.GET, path, 200, "OK", "applesbananas");
route2.enable();
testRequest(HttpMethod.GET, path, 200, "OK", "applesorangesbananas");
}
代码示例来源:origin: io.vertx/vertx-web
@Test
public void testDisableEnable() throws Exception {
String path = "/blah";
Route route1 = router.route(path).handler(rc -> {
rc.response().setChunked(true);
rc.response().write("apples");
rc.next();
});
Route route2 = router.route(path).handler(rc -> {
rc.response().write("oranges");
rc.next();
});
Route route3 = router.route(path).handler(rc -> {
rc.response().write("bananas");
rc.response().end();
});
testRequest(HttpMethod.GET, path, 200, "OK", "applesorangesbananas");
route2.disable();
testRequest(HttpMethod.GET, path, 200, "OK", "applesbananas");
route1.disable();
route3.disable();
testRequest(HttpMethod.GET, path, 404, "Not Found");
route3.enable();
route1.enable();
testRequest(HttpMethod.GET, path, 200, "OK", "applesbananas");
route2.enable();
testRequest(HttpMethod.GET, path, 200, "OK", "applesorangesbananas");
}
内容来源于网络,如有侵权,请联系作者删除!