diff --git a/src/org/redkale/boot/Application.java b/src/org/redkale/boot/Application.java index 0f1be1cf6..90a45e498 100644 --- a/src/org/redkale/boot/Application.java +++ b/src/org/redkale/boot/Application.java @@ -420,7 +420,7 @@ public final class Application { NodeServer server = null; if ("SNCP".equals(protocol)) { server = new NodeSncpServer(Application.this, serconf); - } else if ("HTTP".equals(protocol) || "HTTPS".equals(protocol)) { + } else if ("HTTP".equals(protocol)) { server = new NodeHttpServer(Application.this, serconf); } else { if (!inited.get()) { @@ -435,7 +435,7 @@ public final class Application { NodeProtocol pros = type.getAnnotation(NodeProtocol.class); for (String p : pros.value()) { p = p.toUpperCase(); - if ("SNCP".equals(p) || "HTTP".equals(p) || "HTTPS".equals(p)) continue; + if ("SNCP".equals(p) || "HTTP".equals(p)) continue; final Class old = nodeClasses.get(p); if (old != null && old != type) throw new RuntimeException("Protocol(" + p + ") had NodeServer-Class(" + old.getName() + ") but repeat NodeServer-Class(" + type.getName() + ")"); nodeClasses.put(p, type); diff --git a/src/org/redkale/boot/NodeHttpServer.java b/src/org/redkale/boot/NodeHttpServer.java index 68bbaf072..d241abc85 100644 --- a/src/org/redkale/boot/NodeHttpServer.java +++ b/src/org/redkale/boot/NodeHttpServer.java @@ -27,7 +27,7 @@ import org.redkale.util.*; * * @author zhangjx */ -@NodeProtocol({"HTTP", "HTTPS"}) +@NodeProtocol({"HTTP"}) public final class NodeHttpServer extends NodeServer { private final HttpServer httpServer; diff --git a/src/org/redkale/boot/NodeServer.java b/src/org/redkale/boot/NodeServer.java index 8903dfb91..6dac389ba 100644 --- a/src/org/redkale/boot/NodeServer.java +++ b/src/org/redkale/boot/NodeServer.java @@ -246,7 +246,6 @@ public abstract class NodeServer { if (Modifier.isFinal(type.getModifiers())) continue; if (!Modifier.isPublic(type.getModifiers())) continue; if (Modifier.isAbstract(type.getModifiers())) continue; - if (type.getAnnotation(Ignore.class) != null) continue; if (!isSNCP() && factory.find(entry.getName(), type) != null) continue; final Set sameGroupAddrs = new LinkedHashSet<>(); final Map> diffGroupAddrs = new HashMap<>(); diff --git a/src/org/redkale/util/Attribute.java b/src/org/redkale/util/Attribute.java index 93c348ff9..98cd72338 100644 --- a/src/org/redkale/util/Attribute.java +++ b/src/org/redkale/util/Attribute.java @@ -11,7 +11,11 @@ import jdk.internal.org.objectweb.asm.Type; /** * 该类功能是动态映射一个Data类中成员对应的getter、setter方法; 代替低效的反射实现方式。 - * 映射Field时,field要么是public非final,要么存在对应的getter、setter方法。 + * 映射Field时,field必须满足以下条件之一: + * 1、field属性是public且非final + * 2、至少存在对应的getter、setter方法中的一个 + * 当不存在getter方法时,get操作规定返回null + * 当不存在setter方法时,set操作为空方法 * * @author zhangjx * @param @@ -78,19 +82,58 @@ public interface Attribute { public static Attribute create(Class clazz, final String fieldname, final java.lang.reflect.Field field) { return create(clazz, fieldname, field, null, null); } - + + /** + * getter、setter不能全为null + * + * @param + * @param + * @param getter + * @param setter + * @return + */ public static Attribute create(final Method getter, final Method setter) { return create((Class) (getter == null ? setter.getDeclaringClass() : getter.getDeclaringClass()), null, null, getter, setter); } - + /** + * getter、setter不能全为null + * + * @param + * @param + * @param clazz + * @param getter + * @param setter + * @return + */ public static Attribute create(Class clazz, final Method getter, final Method setter) { return create(clazz, null, null, getter, setter); } - + /** + * getter、setter不能全为null + * + * @param + * @param + * @param clazz + * @param fieldalias + * @param getter + * @param setter + * @return + */ public static Attribute create(Class clazz, final String fieldalias, final Method getter, final Method setter) { return create(clazz, fieldalias, null, getter, setter); } - + + /** + * field、getter、setter不能全为null + * @param + * @param + * @param clazz + * @param fieldalias0 + * @param field0 + * @param getter0 + * @param setter0 + * @return + */ @SuppressWarnings("unchecked") public static Attribute create(final Class clazz, String fieldalias0, final Field field0, Method getter0, Method setter0) { if (fieldalias0 != null && fieldalias0.isEmpty()) fieldalias0 = null; diff --git a/src/org/redkale/util/AutoLoad.java b/src/org/redkale/util/AutoLoad.java index c015c69c5..c503cdf83 100644 --- a/src/org/redkale/util/AutoLoad.java +++ b/src/org/redkale/util/AutoLoad.java @@ -10,9 +10,10 @@ import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** - * 自动加载。 使用场景有两种: - * 一、 扫描时自动加载。 系统在启动时会扫描classpath下Service和Servlet的实现类,默认情况下会加载所有的实现类, 只有当标记为@AutoLoad(false)时才会被忽略。 没标记的与标记为@AutoLoad(true)是等价的。 - * 二、 Entity类数据加载。 DataSource初始化某个标记为@javax.persistence.Cacheable的Entity类时,如果该类存在@AutoLoad时,则需要将Entity类对应的表数据全量加载进缓存中。 + * 自动加载。 使用场景: + * 1、被标记为@AutoLoad(false)的Service类不会被自动加载 + * 2、被标记为@AutoLoad(false)的Servlet类不会被自动加载 + * 3、被标记为@AutoLoad且同时被标记为@javax.persistence.Cacheable的Entity类在被DataSource初始化时需要将Entity类对应的表数据全量加载进缓存中。 * * @author zhangjx */ diff --git a/src/org/redkale/util/Creator.java b/src/org/redkale/util/Creator.java index 1faa605bf..729705a14 100644 --- a/src/org/redkale/util/Creator.java +++ b/src/org/redkale/util/Creator.java @@ -12,7 +12,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; import jdk.internal.org.objectweb.asm.Type; /** - * 实现一个类的构造方法。 代替低效的反射实现方式。 + * 实现一个类的构造方法。 代替低效的反射实现方式。 不支持数组类 * * @author zhangjx * @param diff --git a/src/org/redkale/util/DLong.java b/src/org/redkale/util/DLong.java index 6d5351f0e..dfb81e3bf 100644 --- a/src/org/redkale/util/DLong.java +++ b/src/org/redkale/util/DLong.java @@ -6,6 +6,7 @@ package org.redkale.util; /** + * 双long数据结构 * * @author zhangjx */ diff --git a/src/org/redkale/util/Ignore.java b/src/org/redkale/util/Ignore.java index 077e7ece3..487276dbc 100644 --- a/src/org/redkale/util/Ignore.java +++ b/src/org/redkale/util/Ignore.java @@ -10,6 +10,11 @@ import static java.lang.annotation.ElementType.*; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** + * 用于忽略字段、方法或类。使用场景: + * 1、convert功能中被标记为@Ignore的字段或方法会被忽略 + * 2、FilterBean中的被标记为@Ignore的字段会被忽略 + * 3、被标记为@Ignore的Service类不会被自动加载 + * 4、被标记为@Ignore的Servlet类不会被自动加载 * * @author zhangjx */ diff --git a/src/org/redkale/util/ObjectNode.java b/src/org/redkale/util/ObjectNode.java deleted file mode 100644 index 6b13c3a2d..000000000 --- a/src/org/redkale/util/ObjectNode.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.redkale.util; - -import java.util.*; - -/** - * 便于操作的HashMap类 - * - * @author zhangjx - */ -public class ObjectNode extends HashMap { - - public static ObjectNode create(String key, Object value) { - ObjectNode node = new ObjectNode(); - node.put(key, value); - return node; - } - - public ObjectNode appand(String key, Object value) { - this.put(key, value); - return this; - } -} diff --git a/src/org/redkale/util/Sheet.java b/src/org/redkale/util/Sheet.java index 4884d5512..e74851085 100644 --- a/src/org/redkale/util/Sheet.java +++ b/src/org/redkale/util/Sheet.java @@ -8,6 +8,7 @@ package org.redkale.util; import java.util.*; /** + * 页集合。 结构由一个total总数和一个List列表组合而成。 * * @author zhangjx * @param