File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ public class SyncPool {
64
64
private NodeManager nodeManager ;
65
65
66
66
@ Autowired
67
+ private ApplicationContext ctx ;
68
+
67
69
private ChannelManager channelManager ;
68
70
69
71
private PeerConnectionDelegate peerDel ;
@@ -86,6 +88,8 @@ public SyncPool(PeerClient peerClient) {
86
88
public void init (PeerConnectionDelegate peerDel ) {
87
89
this .peerDel = peerDel ;
88
90
91
+ channelManager = ctx .getBean (ChannelManager .class );
92
+
89
93
poolLoopExecutor .scheduleWithFixedDelay (() -> {
90
94
try {
91
95
fillUp ();
Original file line number Diff line number Diff line change 1
1
package org .tron .program ;
2
2
3
3
import lombok .extern .slf4j .Slf4j ;
4
+ import org .springframework .beans .factory .support .DefaultListableBeanFactory ;
4
5
import org .springframework .context .ApplicationContext ;
5
6
import org .springframework .context .annotation .AnnotationConfigApplicationContext ;
6
7
import org .tron .common .application .Application ;
@@ -27,7 +28,11 @@ public static void main(String[] args) throws InterruptedException {
27
28
return ;
28
29
}
29
30
30
- ApplicationContext context = new AnnotationConfigApplicationContext (DefaultConfig .class );
31
+ DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory ();
32
+ beanFactory .setAllowCircularReferences (false );
33
+ AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext (beanFactory );
34
+ context .register (DefaultConfig .class );
35
+ context .refresh ();
31
36
Application appT = ApplicationFactory .create (context );
32
37
shutdown (appT );
33
38
//appT.init(cfgArgs);
You can’t perform that action at this time.
0 commit comments