WangHan
2024-09-12 d5855a4926926698b740bc6c7ba489de47adb68b
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
34
35
36
37
38
39
40
41
42
43
package tech.powerjob.remote.framework.cs;
 
import tech.powerjob.remote.framework.actor.ActorInfo;
import tech.powerjob.remote.framework.transporter.Transporter;
 
import java.io.Closeable;
import java.io.IOException;
import java.util.List;
 
/**
 * client & server initializer
 *
 * @author MuBao
 * @since 2022/12/31
 */
public interface CSInitializer {
 
    /**
     * 类型名称,比如 akka, netty4,httpJson
     * @return 名称
     */
    String type();
 
    /**
     * initialize the framework
     * @param config config
     */
    void init(CSInitializerConfig config);
 
    /**
     * build a Transporter by based network framework
     * @return Transporter
     */
    Transporter buildTransporter();
 
    /**
     * bind Actor, publish handler's service
     * @param actorInfos actor infos
     */
    void bindHandlers(List<ActorInfo> actorInfos);
 
    void close() throws IOException;
}