doc
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
| --- | --- | --- |
|
||||
|key|未定义|缓存的key,支持参数动态组合,比如"key_#{id}"|
|
||||
|hash|```DEFAULT_HASH```|缓存的hash, 不能含有':'、'#'、'@'字符|
|
||||
|localExpire|-1|本地缓存过期时长, 0表示永不过期, -1表示不作本地缓存。 <br> 参数值支持方式:<br>  100: 设置数值 <br>  5*60: 乘法表达式,值为30 <br>  ${env.cache.expires}: 读取系统配置项 <br>  #delays: 读取宿主对象的delays字段值作为值,<br>       字段类型必须是int、long数值类型 |
|
||||
|remoteExpire|-1|远程缓存过期时长, 0表示永不过期, -1表示不作远程缓存。 <br> 参数值支持方式:<br>  100: 设置数值 <br>  5*60: 乘法表达式,值为30 <br>  ${env.cache.expires}: 读取系统配置项 <br>  #delays: 读取宿主对象的delays字段值作为值,<br>       字段类型必须是int、long数值类型 |
|
||||
|localExpire|-1|本地缓存过期时长, 0表示永不过期, -1表示不作本地缓存。 <br> 参数值支持方式:<br>  100: 设置数值 <br>  5*60: 乘法表达式,值为300 <br>  ${env.cache.expires}: 读取系统配置项 <br>  #delays: 读取宿主对象的delays字段值作为值,<br>       字段类型必须是int、long数值类型 |
|
||||
|remoteExpire|-1|远程缓存过期时长, 0表示永不过期, -1表示不作远程缓存。 <br> 参数值支持方式:<br>  100: 设置数值 <br>  5*60: 乘法表达式,值为300 <br>  ${env.cache.expires}: 读取系统配置项 <br>  #delays: 读取宿主对象的delays字段值作为值,<br>       字段类型必须是int、long数值类型 |
|
||||
|nullable|false|是否可以缓存null值|
|
||||
|timeUnit|```TimeUnit.SECONDS```|时间单位TimeUnit|
|
||||
|comment|未定义|备注描述|
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|name|未定义|名称, 可用于第三方实现的定时任务组件的key, 比如xxl-job的任务标识|
|
||||
|cron|未定义|cron表达式,也可以使用常量值: <br>  @yearly、@annually、@monthly、@weekly、<br>  @daily、@midnight、@hourly、@minutely <br>  @1m、@2m、@3m、@5m、@10m、@15m、@30m <br>  @1h、@2h、@3h、@6h <br>  ${env.scheduling.cron}: 读取系统配置项|
|
||||
|zone|未定义|时区,```cron```有值才有效, 例如: "Asia/Shanghai"|
|
||||
|fixedDelay|-1|延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br>  100: 设置数值 <br>  5*60: 乘法表达式,值为30 <br>  ${env.scheduling.fixedDelay}: 读取系统配置项 <br>  #delays: 读取宿主对象的delays字段值作为值, <br>      字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleWithFixedDelay |
|
||||
|fixedRate|-1|周期时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br>  100: 设置数值 <br>  5*60: 乘法表达式,值为30 <br>  ${env.scheduling.fixedRate}: 读取系统配置项 <br>  #intervals: 读取宿主对象的intervals字段值作为值, <br>        字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleAtFixedRate |
|
||||
|initialDelay|-1|起始延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br>  100: 设置数值 <br>  5*60: 乘法表达式,值为30 <br>  ${env.scheduling.initialDelay}: 读取系统配置项 <br>  #inits: 读取宿主对象的inits字段值作为值, <br>     字段类型必须是int、long数值类型 <br> 值大于0且fixedRate和fixedDelay小于0则使用 ScheduledThreadPoolExecutor.schedule |
|
||||
|fixedDelay|-1|延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br>  100: 设置数值 <br>  5*60: 乘法表达式,值为300 <br>  ${env.scheduling.fixedDelay}: 读取系统配置项 <br>  #delays: 读取宿主对象的delays字段值作为值, <br>      字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleWithFixedDelay |
|
||||
|fixedRate|-1|周期时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br>  100: 设置数值 <br>  5*60: 乘法表达式,值为300 <br>  ${env.scheduling.fixedRate}: 读取系统配置项 <br>  #intervals: 读取宿主对象的intervals字段值作为值, <br>        字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleAtFixedRate |
|
||||
|initialDelay|-1|起始延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br>  100: 设置数值 <br>  5*60: 乘法表达式,值为300 <br>  ${env.scheduling.initialDelay}: 读取系统配置项 <br>  #inits: 读取宿主对象的inits字段值作为值, <br>     字段类型必须是int、long数值类型 <br> 值大于0且fixedRate和fixedDelay小于0则使用 ScheduledThreadPoolExecutor.schedule |
|
||||
|timeUnit|```TimeUnit.SECONDS```|时间单位TimeUnit|
|
||||
|comment|未定义|备注描述|
|
||||
|mode|```LoadMode.LOCAL```|作用于Service模式,默认值为:LOCAL,<br> LOCAL: 表示远程模式的Service对象中的定时任务不起作用|
|
||||
|
||||
4
src/main/java/org/redkale/cache/Cached.java
vendored
4
src/main/java/org/redkale/cache/Cached.java
vendored
@@ -44,7 +44,7 @@ public @interface Cached {
|
||||
* 本地缓存过期时长, 0表示永不过期, -1表示不作本地缓存。<br>
|
||||
* 参数值支持方式:<br>
|
||||
* 100: 设置数值
|
||||
* 5*60: 乘法表达式,值为30
|
||||
* 5*60: 乘法表达式,值为300
|
||||
* ${env.cache.expires}: 读取系统配置项
|
||||
* #delays: 读取宿主对象的delays字段值作为值,字段类型必须是int、long数值类型
|
||||
*
|
||||
@@ -56,7 +56,7 @@ public @interface Cached {
|
||||
* 远程缓存过期时长, 0表示永不过期, -1表示不作远程缓存。<br>
|
||||
* 参数值支持方式:<br>
|
||||
* 100: 设置数值
|
||||
* 5*60: 乘法表达式,值为30
|
||||
* 5*60: 乘法表达式,值为300
|
||||
* ${env.cache.expires}: 读取系统配置项
|
||||
* #delays: 读取宿主对象的delays字段值作为值,字段类型必须是int、long数值类型
|
||||
*
|
||||
|
||||
@@ -79,8 +79,7 @@ public class HttpClusterRpcClient extends HttpRpcClient {
|
||||
private CompletableFuture<HttpResult<byte[]>> httpAsync(boolean produce, Serializable userid, HttpSimpleRequest req) {
|
||||
req.setTraceid(Traces.computeIfAbsent(req.getTraceid(), Traces.currentTraceid()));
|
||||
String module = req.getPath();
|
||||
module = module.substring(1); //去掉/
|
||||
module = module.substring(0, module.indexOf('/'));
|
||||
module = module.substring(1, module.indexOf('/', 1));
|
||||
HttpHeaders headers = req.getHeaders();
|
||||
String resname = req.getHeader(Rest.REST_HEADER_RESNAME, "");
|
||||
final String localModule = module;
|
||||
|
||||
@@ -233,7 +233,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
return this;
|
||||
}
|
||||
|
||||
public HttpSimpleRequest createSimpleRequest(String prefixPath) {
|
||||
public HttpSimpleRequest createSimpleRequest(String contextPath) {
|
||||
HttpSimpleRequest req = new HttpSimpleRequest();
|
||||
req.setBody(array.length() == 0 ? null : array.getBytes());
|
||||
if (!getHeaders().isEmpty()) {
|
||||
@@ -241,6 +241,9 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
if (headers.contains(Rest.REST_HEADER_RPC)) { //外部request不能包含RPC的header信息
|
||||
req.removeHeader(Rest.REST_HEADER_RPC);
|
||||
}
|
||||
if (headers.contains(Rest.REST_HEADER_RESNAME)) { //外部request不能包含RPC的header信息
|
||||
req.removeHeader(Rest.REST_HEADER_RESNAME);
|
||||
}
|
||||
if (headers.contains(Rest.REST_HEADER_CURRUSERID)) { //外部request不能包含RPC的header信息
|
||||
req.removeHeader(Rest.REST_HEADER_CURRUSERID);
|
||||
}
|
||||
@@ -250,11 +253,11 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
req.setRemoteAddr(getRemoteAddr());
|
||||
req.setLocale(getLocale());
|
||||
req.setContentType(getContentType());
|
||||
req.setContextPath(prefixPath);
|
||||
req.setContextPath(contextPath);
|
||||
req.setMethod(this.method);
|
||||
String path0 = this.requestPath;
|
||||
if (isNotEmpty(prefixPath) && path0.startsWith(prefixPath)) {
|
||||
path0 = path0.substring(prefixPath.length());
|
||||
if (isNotEmpty(contextPath) && path0.startsWith(contextPath)) {
|
||||
path0 = path0.substring(contextPath.length());
|
||||
}
|
||||
req.setPath(path0);
|
||||
req.setSessionid(getSessionid(false));
|
||||
@@ -353,7 +356,7 @@ public class HttpRequest extends Request<HttpContext> {
|
||||
this.keepAlive = false; //文件上传必须设置keepAlive为false,因为文件过大时用户不一定会skip掉多余的数据
|
||||
}
|
||||
//completed=true时ProtocolCodec会继续读下一个request
|
||||
this.completed = !this.boundary && !maybews && this.headerParsed;
|
||||
this.completed = !this.boundary && !maybews && this.headerParsed;
|
||||
this.readState = READ_STATE_BODY;
|
||||
}
|
||||
if (this.readState == READ_STATE_BODY) {
|
||||
|
||||
@@ -51,7 +51,7 @@ public @interface Scheduled {
|
||||
* 延迟时间,支持参数配置、乘法表达式和对象字段值 <br>
|
||||
* 参数值支持方式:<br>
|
||||
* 100: 设置数值
|
||||
* 5*60: 乘法表达式,值为30
|
||||
* 5*60: 乘法表达式,值为300
|
||||
* ${env.scheduling.fixedDelay}: 读取系统配置项
|
||||
* #delays: 读取宿主对象的delays字段值作为值,字段类型必须是int、long数值类型
|
||||
*
|
||||
@@ -65,7 +65,7 @@ public @interface Scheduled {
|
||||
* 周期时间,支持参数配置、乘法表达式和对象字段值 <br>
|
||||
* 参数值支持方式:<br>
|
||||
* 100: 设置数值
|
||||
* 5*60: 乘法表达式,值为30
|
||||
* 5*60: 乘法表达式,值为300
|
||||
* ${env.scheduling.fixedRate}: 读取系统配置项
|
||||
* #intervals: 读取宿主对象的intervals字段值作为值,字段类型必须是int、long数值类型
|
||||
*
|
||||
@@ -79,7 +79,7 @@ public @interface Scheduled {
|
||||
* 起始延迟时间,支持参数配置、乘法表达式和对象字段值 <br>
|
||||
* 参数值支持方式:<br>
|
||||
* 100: 设置数值
|
||||
* 5*60: 乘法表达式,值为30
|
||||
* 5*60: 乘法表达式,值为300
|
||||
* ${env.scheduling.initialDelay}: 读取系统配置项
|
||||
* #inits: 读取宿主对象的inits字段值作为值,字段类型必须是int、long数值类型
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user