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 {
6464 private NodeManager nodeManager ;
6565
6666 @ Autowired
67+ private ApplicationContext ctx ;
68+
6769 private ChannelManager channelManager ;
6870
6971 private PeerConnectionDelegate peerDel ;
@@ -86,6 +88,8 @@ public SyncPool(PeerClient peerClient) {
8688 public void init (PeerConnectionDelegate peerDel ) {
8789 this .peerDel = peerDel ;
8890
91+ channelManager = ctx .getBean (ChannelManager .class );
92+
8993 poolLoopExecutor .scheduleWithFixedDelay (() -> {
9094 try {
9195 fillUp ();
Original file line number Diff line number Diff line change 11package org .tron .program ;
22
33import lombok .extern .slf4j .Slf4j ;
4+ import org .springframework .beans .factory .support .DefaultListableBeanFactory ;
45import org .springframework .context .ApplicationContext ;
56import org .springframework .context .annotation .AnnotationConfigApplicationContext ;
67import org .tron .common .application .Application ;
@@ -27,7 +28,11 @@ public static void main(String[] args) throws InterruptedException {
2728 return ;
2829 }
2930
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 ();
3136 Application appT = ApplicationFactory .create (context );
3237 shutdown (appT );
3338 //appT.init(cfgArgs);
You can’t perform that action at this time.
0 commit comments