This commit is contained in:
@@ -114,6 +114,9 @@ public final class Application {
|
|||||||
//临时计数器
|
//临时计数器
|
||||||
CountDownLatch servicecdl; //会出现两次赋值
|
CountDownLatch servicecdl; //会出现两次赋值
|
||||||
|
|
||||||
|
//是否启动了WATCH协议服务
|
||||||
|
boolean watching;
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------
|
||||||
//是否用于main方法运行
|
//是否用于main方法运行
|
||||||
private final boolean singletonrun;
|
private final boolean singletonrun;
|
||||||
@@ -544,6 +547,7 @@ public final class Application {
|
|||||||
others.add(entry);
|
others.add(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.watching = !watchs.isEmpty();
|
||||||
//单向SNCP服务不需要对等group
|
//单向SNCP服务不需要对等group
|
||||||
//if (!sncps.isEmpty() && globalNodes.isEmpty()) throw new RuntimeException("found SNCP Server node but not found <group> node info.");
|
//if (!sncps.isEmpty() && globalNodes.isEmpty()) throw new RuntimeException("found SNCP Server node but not found <group> node info.");
|
||||||
|
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ public final class ClassFilter<T> {
|
|||||||
boolean rs = superClass == null || (clazz != superClass && superClass.isAssignableFrom(clazz));
|
boolean rs = superClass == null || (clazz != superClass && superClass.isAssignableFrom(clazz));
|
||||||
if (rs && this.excludeSuperClasses != null && this.excludeSuperClasses.length > 0) {
|
if (rs && this.excludeSuperClasses != null && this.excludeSuperClasses.length > 0) {
|
||||||
for (Class c : this.excludeSuperClasses) {
|
for (Class c : this.excludeSuperClasses) {
|
||||||
if (c != null && (clazz == c || clazz.isAssignableFrom(c))) return false;
|
if (c != null && (clazz == c || c.isAssignableFrom(clazz))) return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rs;
|
return rs;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ package org.redkale.boot;
|
|||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
import java.lang.reflect.*;
|
import java.lang.reflect.*;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.nio.file.WatchService;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -57,7 +56,7 @@ public class NodeHttpServer extends NodeServer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ClassFilter<Service> createServiceClassFilter() {
|
protected ClassFilter<Service> createServiceClassFilter() {
|
||||||
return createClassFilter(this.sncpGroup, null, Service.class, new Class[]{WatchService.class}, Annotation.class, "services", "service");
|
return createClassFilter(this.sncpGroup, null, Service.class, new Class[]{org.redkale.watch.WatchService.class}, Annotation.class, "services", "service");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.io.*;
|
|||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
import java.lang.reflect.*;
|
import java.lang.reflect.*;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import java.util.function.*;
|
import java.util.function.*;
|
||||||
@@ -509,7 +509,7 @@ public abstract class NodeServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected ClassFilter<Service> createServiceClassFilter() {
|
protected ClassFilter<Service> createServiceClassFilter() {
|
||||||
return createClassFilter(this.sncpGroup, null, Service.class, null, Annotation.class, "services", "service");
|
return createClassFilter(this.sncpGroup, null, Service.class, (!isSNCP() || application.watching) ? null : new Class[]{org.redkale.watch.WatchService.class}, Annotation.class, "services", "service");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ClassFilter createClassFilter(final String localGroup, Class<? extends Annotation> ref,
|
protected ClassFilter createClassFilter(final String localGroup, Class<? extends Annotation> ref,
|
||||||
|
|||||||
Reference in New Issue
Block a user