本文整理了Java中org.apache.catalina.Wrapper.setAsyncSupported()
方法的一些代码示例,展示了Wrapper.setAsyncSupported()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wrapper.setAsyncSupported()
方法的具体详情如下:
包路径:org.apache.catalina.Wrapper
类名称:Wrapper
方法名:setAsyncSupported
[英]Set the async support for the associated servlet.
[中]为关联的servlet设置异步支持。
代码示例来源:origin: spring-projects/spring-framework
@Override
protected void initServer() throws Exception {
this.tomcatServer = new Tomcat();
this.tomcatServer.setBaseDir(baseDir);
this.tomcatServer.setHostname(getHost());
this.tomcatServer.setPort(getPort());
ServletHttpHandlerAdapter servlet = initServletAdapter();
File base = new File(System.getProperty("java.io.tmpdir"));
Context rootContext = tomcatServer.addContext(this.contextPath, base.getAbsolutePath());
Tomcat.addServlet(rootContext, "httpHandlerServlet", servlet).setAsyncSupported(true);
rootContext.addServletMappingDecoded(this.servletMapping, "httpHandlerServlet");
if (wsListener != null) {
rootContext.addApplicationListener(wsListener.getName());
}
}
代码示例来源:origin: spring-projects/spring-framework
@Override
public void deployConfig(WebApplicationContext wac, Filter... filters) {
Assert.state(this.port != -1, "setup() was never called.");
this.context = this.tomcatServer.addContext("", System.getProperty("java.io.tmpdir"));
this.context.addApplicationListener(WsContextListener.class.getName());
Tomcat.addServlet(this.context, "dispatcherServlet", new DispatcherServlet(wac)).setAsyncSupported(true);
this.context.addServletMappingDecoded("/", "dispatcherServlet");
for (Filter filter : filters) {
FilterDef filterDef = new FilterDef();
filterDef.setFilterName(filter.getClass().getName());
filterDef.setFilter(filter);
filterDef.setAsyncSupported("true");
this.context.addFilterDef(filterDef);
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(filter.getClass().getName());
filterMap.addURLPattern("/*");
filterMap.setDispatcher("REQUEST,FORWARD,INCLUDE,ASYNC");
this.context.addFilterMap(filterMap);
}
}
代码示例来源:origin: org.springframework.boot/spring-boot
protected void prepareContext(Host host, TomcatHttpHandlerAdapter servlet) {
File docBase = createTempDir("tomcat-docbase");
TomcatEmbeddedContext context = new TomcatEmbeddedContext();
context.setPath("");
context.setDocBase(docBase.getAbsolutePath());
context.addLifecycleListener(new Tomcat.FixContextListener());
context.setParentClassLoader(ClassUtils.getDefaultClassLoader());
skipAllTldScanning(context);
WebappLoader loader = new WebappLoader(context.getParentClassLoader());
loader.setLoaderClass(TomcatEmbeddedWebappClassLoader.class.getName());
loader.setDelegate(true);
context.setLoader(loader);
Tomcat.addServlet(context, "httpHandlerServlet", servlet).setAsyncSupported(true);
context.addServletMappingDecoded("/", "httpHandlerServlet");
host.addChild(context);
configureContext(context);
}
代码示例来源:origin: AsyncHttpClient/async-http-client
wrapper.setAsyncSupported(true);
ctx.addServletMappingDecoded("/*", "webdav");
tomcat.start();
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
@Override
public void setAsyncSupported(boolean asyncSupported) {
wrapper.setAsyncSupported(asyncSupported);
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
@Override
public void setAsyncSupported(boolean asyncSupported) {
wrapper.setAsyncSupported(asyncSupported);
}
代码示例来源:origin: codefollower/Tomcat-Research
@Override
public void setAsyncSupported(boolean asyncSupported) {
wrapper.setAsyncSupported(asyncSupported);
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
@Override
public void setAsyncSupported(boolean asyncSupported) {
wrapper.setAsyncSupported(asyncSupported);
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
@Override
public void setAsyncSupported(boolean asyncSupported) {
wrapper.setAsyncSupported(asyncSupported);
}
代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina
@Override
public void setAsyncSupported(boolean asyncSupported) {
wrapper.setAsyncSupported(asyncSupported);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
@Override
public void setAsyncSupported(boolean asyncSupported) {
wrapper.setAsyncSupported(asyncSupported);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
@Override
public void setAsyncSupported(boolean asyncSupported) {
wrapper.setAsyncSupported(asyncSupported);
}
代码示例来源:origin: spring-projects/spring-integration
public TomcatWebSocketTestServer(Class<?>... serverConfigs) {
this.tomcatServer = new Tomcat();
this.tomcatServer.setPort(0);
this.tomcatServer.setBaseDir(createTempDir());
this.serverContext = new AnnotationConfigWebApplicationContext();
this.serverContext.register(serverConfigs);
Context context = this.tomcatServer.addContext("", System.getProperty("java.io.tmpdir"));
context.addApplicationListener(WsContextListener.class.getName());
Tomcat.addServlet(context, "dispatcherServlet", new DispatcherServlet(this.serverContext))
.setAsyncSupported(true);
context.addServletMappingDecoded("/", "dispatcherServlet");
}
代码示例来源:origin: ws.ament.hammock/web-tomcat
String servletName = "TomcatDefault";
Wrapper wrapper = Tomcat.addServlet(ctx, servletName, DefaultServlet.class.getName());
wrapper.setAsyncSupported(true);
ctx.addServletMappingDecoded("/*", servletName);
.forEach(p -> wrapper.addInitParameter(p.name(), p.value()));
wrapper.setAsyncSupported(true);
stream(servletDescriptor.urlPatterns()).forEach(s -> ctx.addServletMappingDecoded(s, servletName));
});
代码示例来源:origin: hammock-project/hammock
String servletName = "TomcatDefault";
Wrapper wrapper = Tomcat.addServlet(ctx, servletName, DefaultServlet.class.getName());
wrapper.setAsyncSupported(true);
ctx.addServletMappingDecoded("/*", servletName);
.forEach(p -> wrapper.addInitParameter(p.name(), p.value()));
wrapper.setAsyncSupported(true);
stream(servletDescriptor.urlPatterns()).forEach(s -> ctx.addServletMappingDecoded(s, servletName));
});
代码示例来源:origin: apache/cxf
protected void run() {
server = new Tomcat();
server.setPort(port);
try {
final File base = createTemporaryDirectory();
server.setBaseDir(base.getAbsolutePath());
if (resourcePath == null) {
final Context context = server.addContext("/", base.getAbsolutePath());
final Wrapper cxfServlet = Tomcat.addServlet(context, "cxfServlet", new CXFNonSpringJaxrsServlet());
cxfServlet.addInitParameter("jaxrs.serviceClasses", BookStore.class.getName());
cxfServlet.addInitParameter("jaxrs.providers", JacksonJsonProvider.class.getName());
cxfServlet.setAsyncSupported(true);
context.addServletMappingDecoded("/rest/*", "cxfServlet");
} else {
server.getHost().setAppBase(base.getAbsolutePath());
server.getHost().setAutoDeploy(true);
server.getHost().setDeployOnStartup(true);
server.addWebapp(contextPath, getClass().getResource(resourcePath).toURI().getPath().toString());
}
server.start();
} catch (final Exception ex) {
ex.printStackTrace();
fail(ex.getMessage());
}
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
wrapper.setAsyncSupported(
servlet.getAsyncSupported().booleanValue());
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
wrapper.setAsyncSupported(
servlet.getAsyncSupported().booleanValue());
代码示例来源:origin: codefollower/Tomcat-Research
wrapper.setAsyncSupported(
servlet.getAsyncSupported().booleanValue());
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
wrapper.setAsyncSupported(
servlet.getAsyncSupported().booleanValue());
内容来源于网络,如有侵权,请联系作者删除!