Skip to content

Instantly share code, notes, and snippets.

@jbcpollak
Created November 13, 2013 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbcpollak/7442815 to your computer and use it in GitHub Desktop.
Save jbcpollak/7442815 to your computer and use it in GitHub Desktop.
Future Factory Spring Configuration
@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