This commit is contained in:
@@ -354,9 +354,7 @@ public abstract class NodeServer {
|
|||||||
|
|
||||||
protected Transport loadTransport(final HashSet<String> groups) {
|
protected Transport loadTransport(final HashSet<String> groups) {
|
||||||
if (groups == null || groups.isEmpty()) return null;
|
if (groups == null || groups.isEmpty()) return null;
|
||||||
List<String> tmpgroup = new ArrayList<>(groups);
|
final String groupid = new ArrayList<>(groups).stream().sorted().collect(Collectors.joining(";")); //按字母排列顺序
|
||||||
Collections.sort(tmpgroup); //按字母排列顺序
|
|
||||||
final String groupid = tmpgroup.stream().collect(Collectors.joining(";"));
|
|
||||||
Transport transport = application.resourceFactory.find(groupid, Transport.class);
|
Transport transport = application.resourceFactory.find(groupid, Transport.class);
|
||||||
if (transport != null) return transport;
|
if (transport != null) return transport;
|
||||||
final List<Transport> transports = new ArrayList<>();
|
final List<Transport> transports = new ArrayList<>();
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
package org.redkale.net;
|
package org.redkale.net;
|
||||||
|
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import java.nio.*;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.*;
|
import java.nio.channels.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import java.util.function.*;
|
import java.util.function.Supplier;
|
||||||
import java.util.stream.*;
|
import java.util.stream.Collectors;
|
||||||
import org.redkale.util.*;
|
import org.redkale.util.ObjectPool;
|
||||||
import org.redkale.watch.*;
|
import org.redkale.watch.WatchFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 传输客户端
|
* 传输客户端
|
||||||
@@ -84,8 +84,8 @@ public final class Transport {
|
|||||||
if (first == null) first = t;
|
if (first == null) first = t;
|
||||||
tmpgroup.add(t.name);
|
tmpgroup.add(t.name);
|
||||||
}
|
}
|
||||||
Collections.sort(tmpgroup); //必须按字母排列顺序确保,相同内容的transport列表组合的name相同,而不会因为list的顺序不同产生不同的name
|
//必须按字母排列顺序确保,相同内容的transport列表组合的name相同,而不会因为list的顺序不同产生不同的name
|
||||||
this.name = tmpgroup.stream().collect(Collectors.joining(";"));
|
this.name = tmpgroup.stream().sorted().collect(Collectors.joining(";"));
|
||||||
this.watch = first.watch;
|
this.watch = first.watch;
|
||||||
this.protocol = first.protocol;
|
this.protocol = first.protocol;
|
||||||
this.tcp = "TCP".equalsIgnoreCase(first.protocol);
|
this.tcp = "TCP".equalsIgnoreCase(first.protocol);
|
||||||
|
|||||||
Reference in New Issue
Block a user