use of com.google.inject.Provides in project webpieces by deanhiller.
the class WebServerModule method providesChanMgr.
@Provides
@Singleton
public ChannelManager providesChanMgr(WebServerConfig config, BufferPool pool) {
String id = "webpieces";
Executor executor = Executors.newFixedThreadPool(config.getNumFrontendServerThreads(), new NamedThreadFactory(id));
ChannelManagerFactory factory = ChannelManagerFactory.createFactory();
ChannelManager chanMgr = factory.createMultiThreadedChanMgr(id, pool, executor);
return chanMgr;
}
use of com.google.inject.Provides in project webpieces by deanhiller.
the class HibernateModule method providesSessionFactory.
@Singleton
@Provides
public EntityManagerFactory providesSessionFactory() throws IOException {
log.info("Loading Hibernate. ENTITY classloader=" + entityClassLoader + " hibernate classloader=" + this.getClass().getClassLoader());
Map<String, Object> properties = createClassLoaderProperty();
EntityManagerFactory factory = Persistence.createEntityManagerFactory(persistenceUnit, properties);
log.info("Done loading Hibernate");
return factory;
}
use of com.google.inject.Provides in project graphhopper by graphhopper.
the class GraphHopperModule method createGraphHopper.
@Provides
@Singleton
GraphHopper createGraphHopper(CmdArgs args) {
GraphHopper graphHopper = new GraphHopperOSM(SpatialRuleLookupHelper.createLandmarkSplittingFeatureCollection(args.get(Parameters.Landmark.PREPARE + "split_area_location", ""))).forServer();
SpatialRuleLookupHelper.buildAndInjectSpatialRuleIntoGH(graphHopper, args);
graphHopper.init(args);
return graphHopper;
}
use of com.google.inject.Provides in project verify-hub by alphagov.
the class SamlProxyModule method getVerifyMetadataResolver.
@Provides
@Singleton
@Named("VerifyMetadataResolver")
public MetadataResolver getVerifyMetadataResolver(Environment environment, SamlProxyConfiguration configuration) {
final MetadataResolver metadataResolver = new DropwizardMetadataResolverFactory().createMetadataResolver(environment, configuration.getMetadataConfiguration());
registerMetadataRefreshTask(environment, metadataResolver, configuration.getMetadataConfiguration(), "metadata");
return metadataResolver;
}
use of com.google.inject.Provides in project verify-hub by alphagov.
the class SamlSoapProxyModule method jsonClient.
@Provides
@Singleton
public JsonClient jsonClient(JsonResponseProcessor jsonResponseProcessor, Environment environment, SamlSoapProxyConfiguration configuration) {
Client client = new ClientProvider(environment, configuration.getJerseyClientConfiguration(), configuration.getEnableRetryTimeOutConnections(), "samlSoapProxyClient").get();
ErrorHandlingClient errorHandlingClient = new ErrorHandlingClient(client);
return new JsonClient(errorHandlingClient, jsonResponseProcessor);
}
Aggregations