格式化

This commit is contained in:
redkale
2025-03-15 11:51:02 +08:00
parent bdcebcb67d
commit 3d847fb9b7
3 changed files with 16 additions and 12 deletions

View File

@@ -31,6 +31,13 @@ public interface ApplicationListener {
*/ */
default void onPreStart(Application application) {} default void onPreStart(Application application) {}
/**
* Application在运行start后调用
*
* @param application Application
*/
default void onPostStart(Application application) {}
/** /**
* 服务全部停掉前被调用 * 服务全部停掉前被调用
* *
@@ -45,13 +52,6 @@ public interface ApplicationListener {
*/ */
default void onServersPostStop(Application application) {} default void onServersPostStop(Application application) {}
/**
* Application在运行start后调用
*
* @param application Application
*/
default void onPostStart(Application application) {}
/** /**
* Application在运行Compile前调用 * Application在运行Compile前调用
* *

View File

@@ -58,7 +58,12 @@ public class JsonObject extends LinkedHashMap<String, Object> implements JsonEle
return convertFrom(JsonConvert.root().convertTo(bean)); return convertFrom(JsonConvert.root().convertTo(bean));
} }
@Deprecated(since = "2.8.1")
public <T> T toObject(Type type) { public <T> T toObject(Type type) {
return cast(type);
}
public <T> T cast(Type type) {
return (T) JsonConvert.root().convertFrom(type, JsonConvert.root().convertTo(this)); return (T) JsonConvert.root().convertFrom(type, JsonConvert.root().convertTo(this));
} }

View File

@@ -5,10 +5,9 @@
*/ */
package org.redkale.net.http; package org.redkale.net.http;
import static java.nio.file.StandardWatchEventKinds.*;
import java.io.*; import java.io.*;
import java.nio.file.*; import java.nio.file.*;
import static java.nio.file.StandardWatchEventKinds.*;
import java.util.*; import java.util.*;
import java.util.AbstractMap.SimpleEntry; import java.util.AbstractMap.SimpleEntry;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@@ -52,7 +51,7 @@ public class HttpResourceServlet extends HttpServlet {
key.cancel(); key.cancel();
continue; continue;
} }
key.pollEvents().stream().forEach((event) -> { key.pollEvents().forEach(event -> {
try { try {
Path path = parent.resolve((Path) event.context()); Path path = parent.resolve((Path) event.context());
final String uri = final String uri =
@@ -92,10 +91,10 @@ public class HttpResourceServlet extends HttpServlet {
protected final LongAdder cachedLength = new LongAdder(); protected final LongAdder cachedLength = new LongAdder();
// 缓存总大小, 默认0 // 缓存总大小, 默认0
protected long cachelimit = 0 * 1024 * 1024L; protected long cachelimit = 0L * 1024 * 1024L;
// 最大可缓存的文件大小, 大于该值的文件将不被缓存 // 最大可缓存的文件大小, 大于该值的文件将不被缓存
protected long cachelengthmax = 1 * 1024 * 1024; protected long cachelengthmax = 1L * 1024 * 1024;
// 是否监控缓存文件的变化, 默认不监控 // 是否监控缓存文件的变化, 默认不监控
protected boolean watch = false; protected boolean watch = false;