Created
February 17, 2015 07:42
-
-
Save zeroows/c38da313121c3843892d to your computer and use it in GitHub Desktop.
Extension to tell Akka how to create beans via Spring.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tk.aalkhodiry.client.akka; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.stereotype.Component; | |
import akka.actor.Extension; | |
import akka.actor.Props; | |
/** | |
* Extension to tell Akka how to create beans via Spring. | |
*/ | |
@Component | |
public class SpringExtension implements Extension { | |
private ApplicationContext applicationContext; | |
/** | |
* Used to initialize the Spring application context for the extension. | |
*/ | |
public void initialize(ApplicationContext applicationContext) { | |
this.applicationContext = applicationContext; | |
} | |
/** | |
* Create a Props for the specified actorBeanName using the | |
* SpringActorProducer class. | |
*/ | |
public Props props(String actorBeanName) { | |
return Props.create(SpringActorProducer.class, applicationContext, actorBeanName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment