Watch1200.java
1.38 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.sincere.weigeng;
import com.sincere.weigeng.feign.SmFeign;
import com.sincere.weigeng.feign.XaFeign;
import com.sincere.weigeng.utils.WatchServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
/**
* @author chen
* @version 1.0
* @date 2019/12/3 0003 11:42
*/
@Component
public class Watch1200 extends WatchServer implements ApplicationRunner {
@Autowired
SmFeign smFeign;
@Autowired
XaFeign xaFeign;
@Override
public void run(ApplicationArguments args) throws Exception {
watchPort(1200);
Listen1200 listen1200 = new Listen1200(this);
listen1200.start();
}
class Listen1200 extends Thread {
private Watch1200 watch1200;
public Watch1200 getWatch1200() {
return watch1200;
}
public void setWatch1200(Watch1200 watch1200) {
this.watch1200 = watch1200;
}
public Listen1200(Watch1200 watch1200) {
this.watch1200 = watch1200;
}
@Override
public synchronized void start() {
super.start();
}
@Override
public void run() {
super.run();
this.watch1200.listen(smFeign, xaFeign);
}
}
}