Search in sources :

Example 1 with Bean

use of org.springframework.context.annotation.Bean in project spring-boot-admin by codecentric.

the class AdminServerCoreConfiguration method statusUpdater.

@Bean
@ConditionalOnMissingBean
public StatusUpdater statusUpdater(ApplicationStore applicationStore, ApplicationOperations applicationOperations) {
    StatusUpdater statusUpdater = new StatusUpdater(applicationStore, applicationOperations);
    statusUpdater.setStatusLifetime(adminServerProperties.getMonitor().getStatusLifetime());
    return statusUpdater;
}
Also used : StatusUpdater(de.codecentric.boot.admin.registry.StatusUpdater) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with Bean

use of org.springframework.context.annotation.Bean in project spring-boot-admin by codecentric.

the class AdminServerWebConfiguration method prefixHandlerMapping.

@Bean
public PrefixHandlerMapping prefixHandlerMapping() {
    Map<String, Object> beans = applicationContext.getBeansWithAnnotation(AdminController.class);
    PrefixHandlerMapping prefixHandlerMapping = new PrefixHandlerMapping(beans.values().toArray(new Object[beans.size()]));
    prefixHandlerMapping.setPrefix(adminServerProperties.getContextPath());
    return prefixHandlerMapping;
}
Also used : PrefixHandlerMapping(de.codecentric.boot.admin.web.PrefixHandlerMapping) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 3 with Bean

use of org.springframework.context.annotation.Bean in project spring-boot-admin by codecentric.

the class DiscoveryClientConfiguration method applicationDiscoveryListener.

@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = "spring.boot.admin.discovery")
public ApplicationDiscoveryListener applicationDiscoveryListener(ServiceInstanceConverter serviceInstanceConverter) {
    ApplicationDiscoveryListener listener = new ApplicationDiscoveryListener(discoveryClient, registry);
    listener.setConverter(serviceInstanceConverter);
    return listener;
}
Also used : ApplicationDiscoveryListener(de.codecentric.boot.admin.discovery.ApplicationDiscoveryListener) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 4 with Bean

use of org.springframework.context.annotation.Bean in project spring-boot-admin by codecentric.

the class RevereseZuulProxyConfiguration method proxyRequestHelper.

@Bean
public ProxyRequestHelper proxyRequestHelper() {
    TraceProxyRequestHelper helper = new TraceProxyRequestHelper();
    if (this.traces != null) {
        helper.setTraces(this.traces);
    }
    helper.setIgnoredHeaders(this.zuulProperties.getIgnoredHeaders());
    helper.setTraceRequestBody(this.zuulProperties.isTraceRequestBody());
    return helper;
}
Also used : TraceProxyRequestHelper(org.springframework.cloud.netflix.zuul.filters.TraceProxyRequestHelper) Bean(org.springframework.context.annotation.Bean)

Example 5 with Bean

use of org.springframework.context.annotation.Bean in project spring-boot-admin by codecentric.

the class SpringBootAdminClientAutoConfiguration method registrationListener.

@Bean
@ConditionalOnMissingBean
public RegistrationApplicationListener registrationListener(AdminProperties admin, ApplicationRegistrator registrator) {
    RegistrationApplicationListener listener = new RegistrationApplicationListener(registrator, registrationTaskScheduler());
    listener.setAutoRegister(admin.isAutoRegistration());
    listener.setAutoDeregister(admin.isAutoDeregistration());
    listener.setRegisterPeriod(admin.getPeriod());
    return listener;
}
Also used : RegistrationApplicationListener(de.codecentric.boot.admin.client.registration.RegistrationApplicationListener) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)4056 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1090 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)444 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)393 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)194 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)158 Map (java.util.Map)152 ServletRegistrationBean (org.springframework.boot.web.servlet.ServletRegistrationBean)112 Properties (java.util.Properties)100 Autowired (org.springframework.beans.factory.annotation.Autowired)93 ArrayList (java.util.ArrayList)85 Primary (org.springframework.context.annotation.Primary)84 Qualifier (org.springframework.beans.factory.annotation.Qualifier)75 CamelContextAware (org.apache.camel.CamelContextAware)69 ThreadPoolTaskExecutor (org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor)69 JpaTransactionManager (org.springframework.orm.jpa.JpaTransactionManager)61