本文整理了Java中io.vertx.ext.web.Route.disable
方法的一些代码示例,展示了Route.disable
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Route.disable
方法的具体详情如下:
包路径:io.vertx.ext.web.Route
类名称:Route
方法名:disable
[英]Disable this route. While disabled the router will not route any requests or failures to it.
[中]禁用此路径。禁用时,路由器不会将任何请求或故障路由到路由器。
代码示例来源:origin: gentics/mesh
@Override
public InternalEndpointRoute disable() {
route.disable();
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Disable this route. While disabled the router will not route any requests or failures to it.
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.ext.web.Route disable() {
delegate.disable();
return this;
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Disable this route. While disabled the router will not route any requests or failures to it.
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.ext.web.Route disable() {
delegate.disable();
return this;
}
代码示例来源:origin: wang007/vertx-start
@Override
public Route disable() {
return delegate.disable();
}
代码示例来源: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");
}
内容来源于网络,如有侵权,请联系作者删除!