Search in sources :

Example 6 with Autowired

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

the class DynamoDbTicketRegistryConfiguration method ticketRegistry.

@Autowired
@RefreshScope
@Bean
public TicketRegistry ticketRegistry(@Qualifier("ticketCatalog") final TicketCatalog ticketCatalog) {
    final DynamoDbTicketRegistryProperties db = casProperties.getTicket().getRegistry().getDynamoDb();
    final CryptographyProperties crypto = db.getCrypto();
    return new DynamoDbTicketRegistry(Beans.newTicketRegistryCipherExecutor(crypto), dynamoDbTicketRegistryFacilitator(ticketCatalog));
}
Also used : CryptographyProperties(org.apereo.cas.configuration.model.core.util.CryptographyProperties) DynamoDbTicketRegistryProperties(org.apereo.cas.configuration.model.support.dynamodb.DynamoDbTicketRegistryProperties) DynamoDbTicketRegistry(org.apereo.cas.ticket.registry.DynamoDbTicketRegistry) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Autowired(org.springframework.beans.factory.annotation.Autowired) Bean(org.springframework.context.annotation.Bean)

Example 7 with Autowired

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

the class HazelcastTicketRegistryConfiguration method ticketRegistry.

@Autowired
@Bean
public TicketRegistry ticketRegistry(@Qualifier("ticketCatalog") final TicketCatalog ticketCatalog) {
    final HazelcastProperties hz = casProperties.getTicket().getRegistry().getHazelcast();
    final HazelcastTicketRegistry r = new HazelcastTicketRegistry(hazelcast(ticketCatalog), ticketCatalog, hz.getPageSize());
    r.setCipherExecutor(Beans.newTicketRegistryCipherExecutor(hz.getCrypto()));
    return r;
}
Also used : HazelcastProperties(org.apereo.cas.configuration.model.support.hazelcast.HazelcastProperties) HazelcastTicketRegistry(org.apereo.cas.ticket.registry.HazelcastTicketRegistry) Autowired(org.springframework.beans.factory.annotation.Autowired) Bean(org.springframework.context.annotation.Bean)

Example 8 with Autowired

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

the class LdapServiceRegistryConfiguration method serviceRegistryDao.

@Bean
@RefreshScope
@Autowired
public ServiceRegistryDao serviceRegistryDao(@Qualifier("ldapServiceRegistryMapper") final LdapRegisteredServiceMapper mapper) {
    final LdapServiceRegistryProperties ldap = casProperties.getServiceRegistry().getLdap();
    final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(ldap);
    return new LdapServiceRegistryDao(connectionFactory, ldap.getBaseDn(), mapper, ldap);
}
Also used : ConnectionFactory(org.ldaptive.ConnectionFactory) LdapServiceRegistryProperties(org.apereo.cas.configuration.model.support.ldap.serviceregistry.LdapServiceRegistryProperties) LdapServiceRegistryDao(org.apereo.cas.adaptors.ldap.services.LdapServiceRegistryDao) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Autowired(org.springframework.beans.factory.annotation.Autowired) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 9 with Autowired

use of org.springframework.beans.factory.annotation.Autowired in project pinpoint by naver.

the class HbaseTraceDao method setSpanMapper.

@Autowired
@Qualifier("spanMapper")
public void setSpanMapper(RowMapper<List<SpanBo>> spanMapper) {
    final Logger logger = LoggerFactory.getLogger(spanMapper.getClass());
    if (logger.isDebugEnabled()) {
        spanMapper = CellTraceMapper.wrap(spanMapper);
    }
    this.spanMapper = spanMapper;
}
Also used : Logger(org.slf4j.Logger) Autowired(org.springframework.beans.factory.annotation.Autowired) Qualifier(org.springframework.beans.factory.annotation.Qualifier)

Example 10 with Autowired

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

the class SpringExtension method supports.

/**
	 * Determine if the value for the {@link Parameter} in the supplied {@link ParameterContext}
	 * should be autowired from the test's {@link ApplicationContext}.
	 * <p>Returns {@code true} if the parameter is declared in a {@link Constructor}
	 * that is annotated with {@link Autowired @Autowired} and otherwise delegates to
	 * {@link ParameterAutowireUtils#isAutowirable}.
	 * <p><strong>WARNING</strong>: If the parameter is declared in a {@code Constructor}
	 * that is annotated with {@code @Autowired}, Spring will assume the responsibility
	 * for resolving all parameters in the constructor. Consequently, no other registered
	 * {@link ParameterResolver} will be able to resolve parameters.
	 * @see #resolve
	 * @see ParameterAutowireUtils#isAutowirable
	 */
@Override
public boolean supports(ParameterContext parameterContext, ExtensionContext extensionContext) {
    Parameter parameter = parameterContext.getParameter();
    Executable executable = parameter.getDeclaringExecutable();
    return (executable instanceof Constructor && AnnotatedElementUtils.hasAnnotation(executable, Autowired.class)) || ParameterAutowireUtils.isAutowirable(parameter);
}
Also used : Autowired(org.springframework.beans.factory.annotation.Autowired) Constructor(java.lang.reflect.Constructor) Parameter(java.lang.reflect.Parameter) Executable(java.lang.reflect.Executable)

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