Search in sources :

Example 11 with Qualifier

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

the class RMIConfig method buildPreparationResourceServiceFactory.

@Bean
@Qualifier("preparationResourceServiceFactory")
public RmiProxyFactoryBean buildPreparationResourceServiceFactory() {
    RmiProxyFactoryBean bean = new RmiProxyFactoryBean();
    bean.setServiceUrl("rmi://" + host + ":" + port + "/preparationResourceService");
    LOG.info("远程访问路径:{}", bean.getServiceUrl());
    bean.setServiceInterface(PreparationResourceService.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 12 with Qualifier

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

the class RMIConfig method buildElecCompServiceFactory.

@Bean
@Qualifier("elecCompServiceFactory")
public RmiProxyFactoryBean buildElecCompServiceFactory() {
    RmiProxyFactoryBean bean = new RmiProxyFactoryBean();
    bean.setServiceUrl("rmi://" + host + ":" + port + "/elecCompService");
    LOG.info("远程访问路径:{}", bean.getServiceUrl());
    bean.setServiceInterface(ElecCompService.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 13 with Qualifier

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

the class ApplicationConfig method authTokenFactory.

/**
 * Exposes a factory for JWTs asserting a client's identity as a Spring bean.
 *
 * @return The bean.
 */
@Bean
@Qualifier("signing")
public AuthTokenHelper authTokenFactory() {
    ServiceConfigProperties amqpProps = amqpProperties();
    AuthenticationServerConfigProperties serviceProps = serviceProperties();
    if (!serviceProps.getSigning().isAppropriateForCreating() && amqpProps.getKeyPath() != null) {
        // fall back to TLS configuration
        serviceProps.getSigning().setKeyPath(amqpProps.getKeyPath());
    }
    return AuthTokenHelperImpl.forSigning(vertx(), serviceProps.getSigning());
}
Also used : ServiceConfigProperties(org.eclipse.hono.config.ServiceConfigProperties) Qualifier(org.springframework.beans.factory.annotation.Qualifier) Bean(org.springframework.context.annotation.Bean) ObjectFactoryCreatingFactoryBean(org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean)

Example 14 with Qualifier

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

the class AbstractAdapterConfig method registrationServiceClientConfig.

/**
 * Exposes configuration properties for accessing the registration service as a Spring bean.
 * <p>
 * Sets the <em>amqpHostname</em> to {@code hono-device-registry} if not set explicitly.
 *
 * @return The properties.
 */
@Qualifier(RegistrationConstants.REGISTRATION_ENDPOINT)
@ConfigurationProperties(prefix = "hono.registration")
@Bean
public RequestResponseClientConfigProperties registrationServiceClientConfig() {
    final RequestResponseClientConfigProperties config = new RequestResponseClientConfigProperties();
    customizeRegistrationServiceClientConfig(config);
    return config;
}
Also used : RequestResponseClientConfigProperties(org.eclipse.hono.client.RequestResponseClientConfigProperties) Qualifier(org.springframework.beans.factory.annotation.Qualifier) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) Bean(org.springframework.context.annotation.Bean)

Example 15 with Qualifier

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

the class AbstractAdapterConfig method credentialsServiceClientConfig.

/**
 * Exposes configuration properties for accessing the credentials service as a Spring bean.
 *
 * @return The properties.
 */
@Qualifier(CredentialsConstants.CREDENTIALS_ENDPOINT)
@ConfigurationProperties(prefix = "hono.credentials")
@Bean
public ClientConfigProperties credentialsServiceClientConfig() {
    final RequestResponseClientConfigProperties config = new RequestResponseClientConfigProperties();
    customizeCredentialsServiceClientConfig(config);
    return config;
}
Also used : RequestResponseClientConfigProperties(org.eclipse.hono.client.RequestResponseClientConfigProperties) Qualifier(org.springframework.beans.factory.annotation.Qualifier) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) Bean(org.springframework.context.annotation.Bean)

Aggregations

Qualifier (org.springframework.beans.factory.annotation.Qualifier)66 Bean (org.springframework.context.annotation.Bean)59 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