Search in sources :

Example 31 with Bean

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;
}
Also used : NrtCollectorJMSDLMC(org.opennms.nrtg.nrtcollector.internal.jms.NrtCollectorJMSDLMC) Bean(org.springframework.context.annotation.Bean)

Example 32 with Bean

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;
}
Also used : ProtocolCollectorRegistryImpl(org.opennms.nrtg.nrtcollector.internal.ProtocolCollectorRegistryImpl) Bean(org.springframework.context.annotation.Bean)

Example 33 with Bean

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;
}
Also used : InputStream(java.io.InputStream) LocalSessionFactoryBean(org.springframework.orm.hibernate3.LocalSessionFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 34 with Bean

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;
}
Also used : HibernateTransactionManager(org.springframework.orm.hibernate3.HibernateTransactionManager) LocalSessionFactoryBean(org.springframework.orm.hibernate3.LocalSessionFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 35 with Bean

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();
}
Also used : PoolingHttpClientConnectionManager(org.apache.http.impl.conn.PoolingHttpClientConnectionManager) AnnotationSessionFactoryBean(org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)3865 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1065 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)444 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)389 ConditionalOnClass (org.springframework.boot.autoconfigure.condition.ConditionalOnClass)309 lombok.val (lombok.val)294 HashMap (java.util.HashMap)285 Lazy (org.springframework.context.annotation.Lazy)257 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)190 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)151 Map (java.util.Map)150 ServletRegistrationBean (org.springframework.boot.web.servlet.ServletRegistrationBean)110 Properties (java.util.Properties)94 Autowired (org.springframework.beans.factory.annotation.Autowired)92 ArrayList (java.util.ArrayList)79 Primary (org.springframework.context.annotation.Primary)75 Qualifier (org.springframework.beans.factory.annotation.Qualifier)71 CamelContextAware (org.apache.camel.CamelContextAware)69 ThreadPoolTaskExecutor (org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor)68 JpaTransactionManager (org.springframework.orm.jpa.JpaTransactionManager)59