liulingling.177216
2024-08-26 349f1cfc5fa77fbc636d542df0d8050fddec48c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.dingzhuo.compute.engine.utils;
 
import akka.actor.Extension;
import akka.actor.Props;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
 
/**
 * @author fanxinfu
 */
@Component
public class SpringAkkaExtension implements Extension {
 
  private ApplicationContext applicationContext;
 
  public void initialize(ApplicationContext applicationContext) {
    this.applicationContext = applicationContext;
  }
 
  public Props props(String actorBeanName) {
    return Props.create(SpringActorProducer.class, applicationContext, actorBeanName);
  }
}