use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean 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;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean 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;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean 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;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project cas by apereo.
the class CasCoreAuthenticationConfiguration method authenticationEventExecutionPlan.
@ConditionalOnMissingBean(name = "authenticationEventExecutionPlan")
@Autowired
@Bean
public AuthenticationEventExecutionPlan authenticationEventExecutionPlan(final List<AuthenticationEventExecutionPlanConfigurer> configurers) {
final DefaultAuthenticationEventExecutionPlan plan = new DefaultAuthenticationEventExecutionPlan();
configurers.forEach(c -> {
final String name = StringUtils.removePattern(c.getClass().getSimpleName(), "\\$.+");
LOGGER.debug("Configuring authentication execution plan [{}]", name);
c.configureAuthenticationExecutionPlan(plan);
});
return plan;
}
use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project cas by apereo.
the class CasCoreMonitorConfiguration method healthCheckMonitor.
@ConditionalOnMissingBean(name = "healthCheckMonitor")
@Bean
public Monitor healthCheckMonitor() {
final Map<String, Monitor> beans = applicationContext.getBeansOfType(Monitor.class, false, true);
final Set<Monitor> monitors = beans.entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toSet());
final int freeMemThreshold = casProperties.getMonitor().getFreeMemThreshold();
if (freeMemThreshold > 0) {
monitors.add(new MemoryMonitor(freeMemThreshold));
}
final MonitorProperties.Warn warn = casProperties.getMonitor().getSt().getWarn();
if (warn.getThreshold() > 0) {
final SessionMonitor bean = new SessionMonitor(ticketRegistry, warn.getThreshold(), warn.getThreshold());
monitors.add(bean);
}
return new HealthCheckMonitor(monitors);
}
Aggregations