正在写项目。
package qqservice;
import java.util.HashMap;
public class ManageClientConnectServerThread {
private static HashMap<String,ClientConnectServerThread> hm= new HashMap<>();
//加入某个线程
public static void addClientConnectServerThread(String userId,ClientConnectServerThread clientConnectServerThread){
hm.put(userId,clientConnectServerThread);
}
//通过userId得到对应的线程
public static ClientConnectServerThread getClientConnectServerThread(String userId){
return hm.get(userId);
}
}