use of org.springframework.context.annotation.Bean in project opennms by OpenNMS.
the class AppConfig method collectorJmsDLMC.
@Bean(name = "nrtCollector")
public NrtCollector collectorJmsDLMC() {
NrtCollectorJMSDLMC collector = new NrtCollectorJMSDLMC();
collector.setListenerContainer(listenerContainer());
return collector;
}
use of org.springframework.context.annotation.Bean in project opennms by OpenNMS.
the class AppConfig method protocolCollectorRegistry.
@Bean(name = "protocolCollectorRegistry")
public ProtocolCollectorRegistry protocolCollectorRegistry() {
ProtocolCollectorRegistryImpl registry = new ProtocolCollectorRegistryImpl();
registry.getProtocolCollectors().add(snmpCollector());
return registry;
}
use of org.springframework.context.annotation.Bean in project rhino by PLOS.
the class TestConfiguration method runtimeConfiguration.
@Bean
public RuntimeConfiguration runtimeConfiguration(Yaml yaml) throws Exception {
YamlConfiguration runtimeConfiguration;
InputStream is = null;
boolean threw = true;
try {
is = TestConfiguration.class.getClassLoader().getResourceAsStream("rhino-test.yaml");
runtimeConfiguration = new YamlConfiguration(yaml.loadAs(is, YamlConfiguration.Input.class));
threw = false;
} finally {
Closeables.close(is, threw);
}
return runtimeConfiguration;
}
use of org.springframework.context.annotation.Bean in project rhino by PLOS.
the class TestConfiguration method transactionManager.
@Bean
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
HibernateTransactionManager manager = new HibernateTransactionManager();
manager.setSessionFactory(sessionFactory);
return manager;
}
use of org.springframework.context.annotation.Bean in project rhino by PLOS.
the class RhinoConfiguration method httpClient.
@Bean
public CloseableHttpClient httpClient(RuntimeConfiguration runtimeConfiguration) {
PoolingHttpClientConnectionManager manager = new PoolingHttpClientConnectionManager();
Integer maxTotal = runtimeConfiguration.getHttpConnectionPoolConfiguration().getMaxTotal();
manager.setMaxTotal(maxTotal == null ? 400 : maxTotal);
Integer defaultMaxPerRoute = runtimeConfiguration.getHttpConnectionPoolConfiguration().getDefaultMaxPerRoute();
manager.setDefaultMaxPerRoute(defaultMaxPerRoute == null ? 20 : defaultMaxPerRoute);
return HttpClientBuilder.create().setConnectionManager(manager).build();
}
Aggregations