Search in sources :

Example 11 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project spring-framework by spring-projects.

the class AbstractTransactionalAnnotatedConfigClassTests method setDataSource.

@Autowired
public void setDataSource(DataSource dataSource) {
    this.dataSourceViaInjection = dataSource;
    this.jdbcTemplate = new JdbcTemplate(dataSource);
}
Also used : JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate) Autowired(org.springframework.beans.factory.annotation.Autowired)

Example 12 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project spring-security by spring-projects.

the class WebSecurityConfigurerAdapter method setObjectPostProcessor.

@Autowired
public void setObjectPostProcessor(ObjectPostProcessor<Object> objectPostProcessor) {
    this.objectPostProcessor = objectPostProcessor;
    authenticationBuilder = new AuthenticationManagerBuilder(objectPostProcessor);
    localConfigureAuthenticationBldr = new AuthenticationManagerBuilder(objectPostProcessor) {

        @Override
        public AuthenticationManagerBuilder eraseCredentials(boolean eraseCredentials) {
            authenticationBuilder.eraseCredentials(eraseCredentials);
            return super.eraseCredentials(eraseCredentials);
        }
    };
}
Also used : AuthenticationManagerBuilder(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder) Autowired(org.springframework.beans.factory.annotation.Autowired)

Example 13 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class CasValidationConfiguration method legacyValidateController.

@Autowired
@Bean
public LegacyValidateController legacyValidateController(@Qualifier("argumentExtractor") final ArgumentExtractor argumentExtractor) {
    final LegacyValidateController c = new LegacyValidateController();
    c.setValidationSpecification(this.cas10ProtocolValidationSpecification);
    c.setSuccessView(cas1ServiceSuccessView());
    c.setFailureView(cas1ServiceFailureView());
    c.setProxyHandler(proxy10Handler);
    c.setAuthenticationSystemSupport(authenticationSystemSupport);
    c.setServicesManager(servicesManager);
    c.setCentralAuthenticationService(centralAuthenticationService);
    c.setArgumentExtractor(argumentExtractor);
    c.setMultifactorTriggerSelectionStrategy(multifactorTriggerSelectionStrategy);
    c.setAuthenticationContextValidator(authenticationContextValidator);
    c.setJsonView(cas3ServiceJsonView());
    c.setAuthnContextAttribute(casProperties.getAuthn().getMfa().getAuthenticationContextAttribute());
    return c;
}
Also used : LegacyValidateController(org.apereo.cas.web.LegacyValidateController) Autowired(org.springframework.beans.factory.annotation.Autowired) Bean(org.springframework.context.annotation.Bean)

Example 14 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class CasValidationConfiguration method v3ProxyValidateController.

@Autowired
@Bean
public V3ProxyValidateController v3ProxyValidateController(@Qualifier("argumentExtractor") final ArgumentExtractor argumentExtractor) {
    final V3ProxyValidateController c = new V3ProxyValidateController();
    c.setValidationSpecification(cas20ProtocolValidationSpecification);
    c.setSuccessView(cas3ServiceSuccessView());
    c.setFailureView(cas3ServiceFailureView);
    c.setProxyHandler(proxy20Handler);
    c.setAuthenticationSystemSupport(authenticationSystemSupport);
    c.setServicesManager(servicesManager);
    c.setCentralAuthenticationService(centralAuthenticationService);
    c.setArgumentExtractor(argumentExtractor);
    c.setMultifactorTriggerSelectionStrategy(multifactorTriggerSelectionStrategy);
    c.setAuthenticationContextValidator(authenticationContextValidator);
    c.setJsonView(cas3ServiceJsonView());
    c.setAuthnContextAttribute(casProperties.getAuthn().getMfa().getAuthenticationContextAttribute());
    return c;
}
Also used : V3ProxyValidateController(org.apereo.cas.web.v3.V3ProxyValidateController) Autowired(org.springframework.beans.factory.annotation.Autowired) Bean(org.springframework.context.annotation.Bean)

Example 15 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project cas by apereo.

the class JdbcMultifactorAuthnTrustConfiguration method transactionManagerMfaAuthnTrust.

@Autowired
@Bean
public PlatformTransactionManager transactionManagerMfaAuthnTrust(@Qualifier("mfaTrustedAuthnEntityManagerFactory") final EntityManagerFactory emf) {
    final JpaTransactionManager mgmr = new JpaTransactionManager();
    mgmr.setEntityManagerFactory(emf);
    return mgmr;
}
Also used : JpaTransactionManager(org.springframework.orm.jpa.JpaTransactionManager) Autowired(org.springframework.beans.factory.annotation.Autowired) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

Aggregations

Autowired (org.springframework.beans.factory.annotation.Autowired)38 Bean (org.springframework.context.annotation.Bean)23 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)9 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)5 JpaTransactionManager (org.springframework.orm.jpa.JpaTransactionManager)3 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)3 V3ProxyValidateController (org.apereo.cas.web.v3.V3ProxyValidateController)2 V3ServiceValidateController (org.apereo.cas.web.v3.V3ServiceValidateController)2 Logger (org.slf4j.Logger)2 Qualifier (org.springframework.beans.factory.annotation.Qualifier)2 File (java.io.File)1 Constructor (java.lang.reflect.Constructor)1 Executable (java.lang.reflect.Executable)1 Field (java.lang.reflect.Field)1 Parameter (java.lang.reflect.Parameter)1 Properties (java.util.Properties)1 Resource (javax.annotation.Resource)1 Inject (javax.inject.Inject)1 PersistenceConfiguration (net.sf.ehcache.config.PersistenceConfiguration)1 CacheEntryFactory (net.sf.ehcache.constructs.blocking.CacheEntryFactory)1