This commit is contained in:
@@ -7,6 +7,7 @@ package org.redkale.boot.watch;
|
||||
|
||||
import java.net.*;
|
||||
import java.nio.channels.AsynchronousSocketChannel;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.annotation.Resource;
|
||||
import org.redkale.boot.Application;
|
||||
@@ -39,6 +40,11 @@ public class TransportWatchService implements WatchService {
|
||||
@Resource
|
||||
private TransportFactory transportFactory;
|
||||
|
||||
@RestMapping(name = "nodes", auth = false, comment = "获取所有Node节点")
|
||||
public RetResult<List<TransportGroupInfo>> addNode() {
|
||||
return new RetResult<>(transportFactory.getGroupInfos());
|
||||
}
|
||||
|
||||
@RestMapping(name = "addnode", auth = false, comment = "动态增加指定Group的Node节点")
|
||||
public RetResult addNode(
|
||||
@RestParam(name = "group", comment = "Group节点名") final String group,
|
||||
|
||||
@@ -141,6 +141,10 @@ public class TransportFactory {
|
||||
return executor;
|
||||
}
|
||||
|
||||
public List<TransportGroupInfo> getGroupInfos() {
|
||||
return new ArrayList<>(this.groupInfos.values());
|
||||
}
|
||||
|
||||
public void addSncpService(Service service) {
|
||||
if (service == null) return;
|
||||
services.add(new WeakReference<>(service));
|
||||
|
||||
Reference in New Issue
Block a user