hefeixia
2021-02-18 5b8c95c760840f09910730943b21391e47187315
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package chat.module;
 
import chat.module.entity.ChatRoom;
import chat.user.User;
 
public class ChatroomBucket extends Bucket<ChatRoom> {
    
    private static ChatroomBucket instance;
    
    private ChatroomBucket() {
        
    }
    
    public static synchronized ChatroomBucket getInstance() {
        if (instance == null) {
            instance = new ChatroomBucket();
        }
        
        return instance;
    }
    
//    public ChatRoom createOne(String name, User sender) {
//        ChatRoom chatroom = new ChatRoom(name, sender);
//        String key = chatroom.getId();
//        
//        addOne(key, chatroom);
//        
//        return chatroom;
//    }
 
 
    
}