提交 b24e7026 编写于 作者: Y YunaiV

未实现

上级 a4b0fe84
...@@ -26,6 +26,7 @@ import com.alibaba.dubbo.remoting.http.HttpServer; ...@@ -26,6 +26,7 @@ import com.alibaba.dubbo.remoting.http.HttpServer;
*/ */
public class JettyHttpBinder implements HttpBinder { public class JettyHttpBinder implements HttpBinder {
@Override
public HttpServer bind(URL url, HttpHandler handler) { public HttpServer bind(URL url, HttpHandler handler) {
return new JettyHttpServer(url, handler); return new JettyHttpServer(url, handler);
} }
......
...@@ -25,11 +25,14 @@ import javax.servlet.ServletContextListener; ...@@ -25,11 +25,14 @@ import javax.servlet.ServletContextListener;
*/ */
public class BootstrapListener implements ServletContextListener { public class BootstrapListener implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent servletContextEvent) { public void contextInitialized(ServletContextEvent servletContextEvent) {
ServletManager.getInstance().addServletContext(ServletManager.EXTERNAL_SERVER_PORT, servletContextEvent.getServletContext()); ServletManager.getInstance().addServletContext(ServletManager.EXTERNAL_SERVER_PORT, servletContextEvent.getServletContext());
} }
@Override
public void contextDestroyed(ServletContextEvent servletContextEvent) { public void contextDestroyed(ServletContextEvent servletContextEvent) {
ServletManager.getInstance().removeServletContext(ServletManager.EXTERNAL_SERVER_PORT); ServletManager.getInstance().removeServletContext(ServletManager.EXTERNAL_SERVER_PORT);
} }
} }
...@@ -23,6 +23,7 @@ import com.alibaba.dubbo.remoting.http.HttpServer; ...@@ -23,6 +23,7 @@ import com.alibaba.dubbo.remoting.http.HttpServer;
public class TomcatHttpBinder implements HttpBinder { public class TomcatHttpBinder implements HttpBinder {
@Override
public HttpServer bind(URL url, HttpHandler handler) { public HttpServer bind(URL url, HttpHandler handler) {
return new TomcatHttpServer(url, handler); return new TomcatHttpServer(url, handler);
} }
......
...@@ -48,13 +48,11 @@ public class TomcatHttpServer extends AbstractHttpServer { ...@@ -48,13 +48,11 @@ public class TomcatHttpServer extends AbstractHttpServer {
tomcat = new Tomcat(); tomcat = new Tomcat();
tomcat.setBaseDir(baseDir); tomcat.setBaseDir(baseDir);
tomcat.setPort(url.getPort()); tomcat.setPort(url.getPort());
tomcat.getConnector().setProperty( tomcat.getConnector().setProperty("maxThreads", String.valueOf(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS)));
"maxThreads", String.valueOf(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS)));
// tomcat.getConnector().setProperty( // tomcat.getConnector().setProperty(
// "minSpareThreads", String.valueOf(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS))); // "minSpareThreads", String.valueOf(url.getParameter(Constants.THREADS_KEY, Constants.DEFAULT_THREADS)));
tomcat.getConnector().setProperty( tomcat.getConnector().setProperty("maxConnections", String.valueOf(url.getParameter(Constants.ACCEPTS_KEY, -1)));
"maxConnections", String.valueOf(url.getParameter(Constants.ACCEPTS_KEY, -1)));
tomcat.getConnector().setProperty("URIEncoding", "UTF-8"); tomcat.getConnector().setProperty("URIEncoding", "UTF-8");
tomcat.getConnector().setProperty("connectionTimeout", "60000"); tomcat.getConnector().setProperty("connectionTimeout", "60000");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册