Created
November 13, 2013 02:45
-
-
Save jbcpollak/7442815 to your computer and use it in GitHub Desktop.
Future Factory Spring Configuration
This file contains hidden or 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
@Configuration | |
public class FutureFactoryConfiguration { | |
ActorSystem system = ActorSystem.create(); | |
@Resource(name="geocodingService") | |
private GeocodingService geocodingService; | |
@Bean(name="executionContext") | |
public ExecutionContext getExecutionContext() { | |
return system.dispatcher(); | |
} | |
@Bean(name="geocodingFutureFactory") | |
public AddressGeocodingFutureFactory getAddressGeocodingFutureFactory() { | |
AddressGeocodingFutureFactory gff = new AddressGeocodingFutureFactory(); | |
gff.setExecutionContext(getExecutionContext()); | |
gff.setGeocodingService(geocodingService); | |
return gff; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment