Search in sources :

Example 96 with Bean

use of org.springframework.context.annotation.Bean in project spring-framework by spring-projects.

the class AbstractMessageBrokerConfiguration method userRegistryMessageHandler.

@Bean
public MessageHandler userRegistryMessageHandler() {
    if (getBrokerRegistry().getUserRegistryBroadcast() == null) {
        return new NoOpMessageHandler();
    }
    SimpUserRegistry userRegistry = userRegistry();
    Assert.isInstanceOf(MultiServerUserRegistry.class, userRegistry, "MultiServerUserRegistry required");
    return new UserRegistryMessageHandler((MultiServerUserRegistry) userRegistry, brokerMessagingTemplate(), getBrokerRegistry().getUserRegistryBroadcast(), messageBrokerTaskScheduler());
}
Also used : UserRegistryMessageHandler(org.springframework.messaging.simp.user.UserRegistryMessageHandler) SimpUserRegistry(org.springframework.messaging.simp.user.SimpUserRegistry) Bean(org.springframework.context.annotation.Bean)

Example 97 with Bean

use of org.springframework.context.annotation.Bean in project cas by apereo.

the class OpenIdConfiguration method serverManager.

@RefreshScope
@Bean
public ServerManager serverManager() {
    final ServerManager manager = new ServerManager();
    manager.setOPEndpointUrl(casProperties.getServer().getLoginUrl());
    manager.setEnforceRpId(casProperties.getAuthn().getOpenid().isEnforceRpId());
    manager.setSharedAssociations(new InMemoryServerAssociationStore());
    LOGGER.info("Creating openid server manager with OP endpoint [{}]", casProperties.getServer().getLoginUrl());
    return manager;
}
Also used : ServerManager(org.openid4java.server.ServerManager) InMemoryServerAssociationStore(org.openid4java.server.InMemoryServerAssociationStore) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 98 with Bean

use of org.springframework.context.annotation.Bean in project cas by apereo.

the class OpenIdAuthenticationEventExecutionPlanConfiguration method openIdPrincipalResolver.

@Bean
public OpenIdPrincipalResolver openIdPrincipalResolver() {
    final OpenIdPrincipalResolver r = new OpenIdPrincipalResolver();
    r.setAttributeRepository(attributeRepository);
    r.setPrincipalAttributeName(casProperties.getAuthn().getOpenid().getPrincipal().getPrincipalAttribute());
    r.setReturnNullIfNoAttributes(casProperties.getAuthn().getOpenid().getPrincipal().isReturnNull());
    r.setPrincipalFactory(openidPrincipalFactory());
    return r;
}
Also used : OpenIdPrincipalResolver(org.apereo.cas.support.openid.authentication.principal.OpenIdPrincipalResolver) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 99 with Bean

use of org.springframework.context.annotation.Bean in project cas by apereo.

the class RadiusMultifactorConfiguration method radiusFlowRegistry.

@Bean
public FlowDefinitionRegistry radiusFlowRegistry() {
    final FlowDefinitionRegistryBuilder builder = new FlowDefinitionRegistryBuilder(this.applicationContext, this.flowBuilderServices);
    builder.setBasePath("classpath*:/webflow");
    builder.addFlowLocationPattern("/mfa-radius/*-webflow.xml");
    return builder.build();
}
Also used : FlowDefinitionRegistryBuilder(org.springframework.webflow.config.FlowDefinitionRegistryBuilder) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 100 with Bean

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

the class EndpointMBeanExportAutoConfiguration method endpointMBeanExporter.

@Bean
public EndpointMBeanExporter endpointMBeanExporter(MBeanServer server) {
    EndpointMBeanExporter mbeanExporter = new EndpointMBeanExporter(this.objectMapper);
    String domain = this.properties.getDomain();
    if (StringUtils.hasText(domain)) {
        mbeanExporter.setDomain(domain);
    }
    mbeanExporter.setServer(server);
    mbeanExporter.setEnsureUniqueRuntimeObjectNames(this.properties.isUniqueNames());
    mbeanExporter.setObjectNameStaticProperties(this.properties.getStaticNames());
    return mbeanExporter;
}
Also used : EndpointMBeanExporter(org.springframework.boot.actuate.endpoint.jmx.EndpointMBeanExporter) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)4059 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