修复Resource.name使用$的问题

This commit is contained in:
redkale
2023-08-07 17:48:20 +08:00
parent 357962ec97
commit 3e2a8c932e
5 changed files with 12 additions and 12 deletions

View File

@@ -139,7 +139,7 @@
backlog: 默认10K
threads【已废弃】 线程数, 默认: CPU核数*2最小8个【已废弃 @since 2.3.0】
maxconns 最大连接数, 小于1表示无限制 默认: 0
maxbody: request.body最大值 默认: 64K
maxbody: request.body最大值 默认: 256K
bufferCapacity: ByteBuffer的初始化大小 TCP默认: 32K; (HTTP 2.0、WebSocket必须要16k以上); UDP默认: 8K
bufferPoolSize ByteBuffer池的大小默认: 线程数*4
responsePoolSize Response池的大小默认: 1024

View File

@@ -128,7 +128,7 @@ public abstract class Server<K extends Serializable, C extends Context, R extend
this.readTimeoutSeconds = config.getIntValue("readTimeoutSeconds", 0);
this.writeTimeoutSeconds = config.getIntValue("writeTimeoutSeconds", 0);
this.backlog = parseLenth(config.getValue("backlog"), 1024);
this.maxBody = parseLenth(config.getValue("maxbody"), "UDP".equalsIgnoreCase(netprotocol) ? 16 * 1024 : 64 * 1024);
this.maxBody = parseLenth(config.getValue("maxbody"), "UDP".equalsIgnoreCase(netprotocol) ? 16 * 1024 : 256 * 1024);
int bufCapacity = parseLenth(config.getValue("bufferCapacity"), "UDP".equalsIgnoreCase(netprotocol) ? UDP_BUFFER_CAPACITY : 32 * 1024);
this.bufferCapacity = "UDP".equalsIgnoreCase(netprotocol) ? bufCapacity : (bufCapacity < 1024 ? 1024 : bufCapacity);
this.bufferPoolSize = config.getIntValue("bufferPoolSize", Utility.cpus() * 8);

View File

@@ -102,13 +102,13 @@ public abstract class WebSocketServlet extends HttpServlet implements Resourcabl
@Resource(name = "jsonconvert", required = false)
protected Convert jsonConvert;
@Resource(name = "$_textconvert", required = false)
@Resource(name = Resource.PARENT_NAME + "_textconvert", required = false)
protected Convert textConvert;
@Resource(name = "$_binaryconvert", required = false)
@Resource(name = Resource.PARENT_NAME + "_binaryconvert", required = false)
protected Convert binaryConvert;
@Resource(name = "$_sendconvert", required = false)
@Resource(name = Resource.PARENT_NAME + "_sendconvert", required = false)
protected Convert sendConvert;
@Resource(name = Resource.PARENT_NAME)

View File

@@ -43,7 +43,7 @@ public final class CacheMemorySource extends AbstractCacheSource {
@Resource
private JsonConvert defaultConvert;
@Resource(name = "$_convert", required = false)
@Resource(name = Resource.PARENT_NAME + "_convert", required = false)
private JsonConvert convert;
private String name;

View File

@@ -23,12 +23,17 @@ public interface DataSqlSource extends DataSource {
public int[] nativeUpdates(String... sqls);
//----------------------------- 无参数 -----------------------------
public int nativeUpdate(String sql);
public int nativeUpdate(String sql, Map<String, Object> params);
//BiConsumer 参数1: connection, 参数2: statement
public <V> V nativeQuery(String sql, BiConsumer<Object, Object> consumer, Function<DataResultSet, V> handler);
//BiConsumer 参数1: connection, 参数2: statement
public <V> V nativeQuery(String sql, BiConsumer<Object, Object> consumer, Function<DataResultSet, V> handler, Map<String, Object> params);
//----------------------------- 无参数 -----------------------------
default <V> V nativeQuery(String sql, Function<DataResultSet, V> handler) {
return nativeQuery(sql, null, handler);
}
@@ -81,11 +86,6 @@ public interface DataSqlSource extends DataSource {
}
//----------------------------- Map<String, Object> -----------------------------
public int nativeUpdate(String sql, Map<String, Object> params);
//BiConsumer 参数1: connection, 参数2: statement
public <V> V nativeQuery(String sql, BiConsumer<Object, Object> consumer, Function<DataResultSet, V> handler, Map<String, Object> params);
default <V> V nativeQuery(String sql, Function<DataResultSet, V> handler, Map<String, Object> params) {
return nativeQuery(sql, null, handler, params);
}