Search in sources :

Example 51 with Qualifier

use of org.springframework.beans.factory.annotation.Qualifier in project TeachingInSimulation by ScOrPiOzzy.

the class RMIConfig method buildTypicalCaseServiceFactory.

@Bean
@Qualifier("typicalCaseServiceFactory")
public RmiProxyFactoryBean buildTypicalCaseServiceFactory() {
    RmiProxyFactoryBean bean = new RmiProxyFactoryBean();
    bean.setServiceUrl("rmi://" + host + ":" + port + "/typicalCaseService");
    LOG.info("远程访问路径:{}", bean.getServiceUrl());
    bean.setServiceInterface(TypicalCaseService.class);
    return bean;
}
Also used : RmiProxyFactoryBean(org.springframework.remoting.rmi.RmiProxyFactoryBean) Qualifier(org.springframework.beans.factory.annotation.Qualifier) RmiProxyFactoryBean(org.springframework.remoting.rmi.RmiProxyFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 52 with Qualifier

use of org.springframework.beans.factory.annotation.Qualifier in project runelite by runelite.

the class CacheConfiguration method sql2o.

@Bean
@Qualifier("Runelite Cache SQL2O")
public Sql2o sql2o(DataSource dataSource) {
    Map<Class, Converter> converters = new HashMap<>();
    converters.put(Instant.class, new InstantConverter());
    return new Sql2o(dataSource, new NoQuirks(converters));
}
Also used : HashMap(java.util.HashMap) Converter(org.sql2o.converters.Converter) NoQuirks(org.sql2o.quirks.NoQuirks) Sql2o(org.sql2o.Sql2o) Qualifier(org.springframework.beans.factory.annotation.Qualifier) Bean(org.springframework.context.annotation.Bean)

Example 53 with Qualifier

use of org.springframework.beans.factory.annotation.Qualifier in project xm-ms-entity by xm-online.

the class WebappTenantOverrideConfiguration method webappTenantConfigRepository.

@Bean
@Qualifier("webappTenantConfigRepository")
public TenantConfigRepository webappTenantConfigRepository() {
    TenantConfigRepository repository = Mockito.mock(TenantConfigRepository.class);
    Mockito.doNothing().when(repository).updateConfig(Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
    return repository;
}
Also used : TenantConfigRepository(com.icthh.xm.commons.config.client.repository.TenantConfigRepository) Qualifier(org.springframework.beans.factory.annotation.Qualifier) Bean(org.springframework.context.annotation.Bean)

Example 54 with Qualifier

use of org.springframework.beans.factory.annotation.Qualifier in project giftcard-demo-series by AxonIQ.

the class EventStoreJpaConfig method eventsFlyway.

/**
 **********************************************************************
 * Using Flyway to do the required schema creation/updates
 ***********************************************************************
 */
@Bean
@Qualifier("events")
@ConfigurationProperties(prefix = "events.flyway")
public Flyway eventsFlyway(@Qualifier("events") DataSource dataSource) {
    Flyway flyway = new Flyway();
    flyway.setDataSource(dataSource);
    return flyway;
}
Also used : Flyway(org.flywaydb.core.Flyway) Qualifier(org.springframework.beans.factory.annotation.Qualifier) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

Example 55 with Qualifier

use of org.springframework.beans.factory.annotation.Qualifier in project zipkin by openzipkin.

the class ZipkinElasticsearchStorageConfiguration method esClientFactory.

// exposed as a bean so that we can test TLS by swapping it out.
// TODO: see if we can override the TLS via properties instead as that has less surface area.
@Bean
@Qualifier(QUALIFIER)
@ConditionalOnMissingBean
ClientFactory esClientFactory(ZipkinElasticsearchStorageProperties es, MeterRegistry meterRegistry) throws Exception {
    ClientFactoryBuilder builder = ClientFactory.builder();
    Ssl ssl = es.getSsl();
    if (ssl.isNoVerify())
        builder.tlsNoVerify();
    // Allow use of a custom KeyStore or TrustStore when connecting to Elasticsearch
    if (ssl.getKeyStore() != null || ssl.getTrustStore() != null)
        configureSsl(builder, ssl);
    // TODO: find or raise a bug with Elastic
    return builder.useHttp2Preface(false).connectTimeoutMillis(es.getTimeout()).meterRegistry(meterRegistry).build();
}
Also used : ClientFactoryBuilder(com.linecorp.armeria.client.ClientFactoryBuilder) Ssl(zipkin2.server.internal.elasticsearch.ZipkinElasticsearchStorageProperties.Ssl) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Qualifier(org.springframework.beans.factory.annotation.Qualifier) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

Qualifier (org.springframework.beans.factory.annotation.Qualifier)65 Bean (org.springframework.context.annotation.Bean)58 RmiProxyFactoryBean (org.springframework.remoting.rmi.RmiProxyFactoryBean)18 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)12 Configuration (org.springframework.context.annotation.Configuration)7 EnableConfigurationProperties (org.springframework.boot.context.properties.EnableConfigurationProperties)6 lombok.val (lombok.val)5 CasConfigurationProperties (org.apereo.cas.configuration.CasConfigurationProperties)5 ConfigurationProperties (org.springframework.boot.context.properties.ConfigurationProperties)5 RequestResponseClientConfigProperties (org.eclipse.hono.client.RequestResponseClientConfigProperties)4 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)4 ScopedProxyMode (org.springframework.context.annotation.ScopedProxyMode)4 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 HashSet (java.util.HashSet)3 List (java.util.List)3 Collectors (java.util.stream.Collectors)3 ClientFactoryBuilder (com.linecorp.armeria.client.ClientFactoryBuilder)2 IdMCacheConfiguration (eu.bcvsolutions.idm.core.api.config.cache.IdMCacheConfiguration)2 Supplier (java.util.function.Supplier)2