This commit is contained in:
Redkale
2018-01-30 11:27:14 +08:00
parent 11d8d36c12
commit 15cd16e771
13 changed files with 53 additions and 30 deletions

View File

@@ -45,6 +45,9 @@ public abstract class Server<K extends Serializable, C extends Context, R extend
//应用层协议名
protected final String protocol;
//依赖注入工厂类
protected final ResourceFactory resourceFactory;
//服务的根Servlet
protected final PrepareServlet<K, C, R, P, S> prepare;
@@ -93,9 +96,10 @@ public abstract class Server<K extends Serializable, C extends Context, R extend
//最大连接数
protected int maxconns;
protected Server(long serverStartTime, String protocol, PrepareServlet<K, C, R, P, S> servlet) {
protected Server(long serverStartTime, String protocol, ResourceFactory resourceFactory, PrepareServlet<K, C, R, P, S> servlet) {
this.serverStartTime = serverStartTime;
this.protocol = protocol;
this.resourceFactory = resourceFactory;
this.prepare = servlet;
}
@@ -148,6 +152,10 @@ public abstract class Server<K extends Serializable, C extends Context, R extend
this.prepare.destroy(context, config);
}
public ResourceFactory getResourceFactory() {
return resourceFactory;
}
public ThreadPoolExecutor getExecutor() {
return executor;
}