DispatcherServlet
This commit is contained in:
@@ -160,7 +160,6 @@
|
||||
aliveTimeoutSeconds: KeepAlive读操作超时秒数, 默认30, 0表示永久不超时; -1表示禁止KeepAlive
|
||||
readTimeoutSeconds: 读操作超时秒数, 默认0, 0表示永久不超时
|
||||
writeTimeoutSeconds: 写操作超时秒数, 默认0, 0表示永久不超时
|
||||
dispatcher: DispatcherServlet的自定义实现类,若是HttpServer,则实现类必须是HttpDispatcherServlet的子类
|
||||
interceptor: 启动/关闭NodeServer时被调用的拦截器实现类,必须是org.redkale.boot.NodeInterceptor的子类,默认为null
|
||||
-->
|
||||
<server protocol="HTTP" host="127.0.0.1" port="6060" root="root" lib="">
|
||||
|
||||
@@ -57,7 +57,7 @@ public abstract class Server<K extends Serializable, C extends Context, R extend
|
||||
protected final ResourceFactory resourceFactory;
|
||||
|
||||
//服务的根Servlet
|
||||
protected DispatcherServlet<K, C, R, P, S> dispatcher;
|
||||
protected final DispatcherServlet<K, C, R, P, S> dispatcher;
|
||||
|
||||
//ClassLoader
|
||||
protected RedkaleClassLoader serverClassLoader;
|
||||
@@ -138,14 +138,6 @@ public abstract class Server<K extends Serializable, C extends Context, R extend
|
||||
if (!this.name.matches("^[a-zA-Z][\\w_-]{1,64}$")) {
|
||||
throw new RedkaleException("server.name (" + this.name + ") is illegal");
|
||||
}
|
||||
String dispatcherImpl = config.getValue("dispatcher");
|
||||
if (Utility.isNotBlank(dispatcherImpl)) {
|
||||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||
Class dispatcherImplClass = classLoader.loadClass(dispatcherImpl);
|
||||
RedkaleClassLoader.putReflectionDeclaredConstructors(dispatcherImplClass, dispatcherImplClass.getName());
|
||||
this.dispatcher = (DispatcherServlet) dispatcherImplClass.getConstructors()[0].newInstance();
|
||||
this.dispatcher.application = application;
|
||||
}
|
||||
AnyValue sslConf = config.getAnyValue("ssl");
|
||||
if (sslConf != null) {
|
||||
String builderClass = sslConf.getValue("builder", SSLBuilder.class.getName());
|
||||
|
||||
Reference in New Issue
Block a user