Search in sources :

Example 6 with BindingConverterFactoryImpl

use of com.alipay.sofa.runtime.service.impl.BindingConverterFactoryImpl in project sofa-boot by alipay.

the class RuntimeConfiguration method bindingConverterFactory.

@Bean
public static BindingConverterFactory bindingConverterFactory() {
    BindingConverterFactory bindingConverterFactory = new BindingConverterFactoryImpl();
    bindingConverterFactory.addBindingConverters(getClassesByServiceLoader(BindingConverter.class));
    return bindingConverterFactory;
}
Also used : BindingConverterFactory(com.alipay.sofa.runtime.spi.service.BindingConverterFactory) BindingConverterFactoryImpl(com.alipay.sofa.runtime.service.impl.BindingConverterFactoryImpl) BindingConverter(com.alipay.sofa.runtime.spi.service.BindingConverter) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 7 with BindingConverterFactoryImpl

use of com.alipay.sofa.runtime.service.impl.BindingConverterFactoryImpl in project sofa-boot by alipay.

the class RpcBindingConverterTest method testOrder.

@Test
public void testOrder() {
    BindingConverterFactory factory = new BindingConverterFactoryImpl();
    factory.addBindingConverters(RuntimeTestConfiguration.getClassesByServiceLoader(BindingConverter.class));
    BindingConverter bindingConverter = factory.getBindingConverter(TestBindingConverter.TEST);
    BindingConverter bindingConverterByTagName = factory.getBindingConverterByTagName(TestBindingConverter.TARGET_NAME);
    Assert.assertTrue(bindingConverter instanceof TestBindingConverter2);
    Assert.assertTrue(bindingConverterByTagName instanceof TestBindingConverter2);
}
Also used : BindingConverterFactory(com.alipay.sofa.runtime.spi.service.BindingConverterFactory) BindingConverterFactoryImpl(com.alipay.sofa.runtime.service.impl.BindingConverterFactoryImpl) BindingConverter(com.alipay.sofa.runtime.spi.service.BindingConverter) RpcBindingConverter(com.alipay.sofa.rpc.boot.runtime.converter.RpcBindingConverter) BoltBindingConverter(com.alipay.sofa.rpc.boot.runtime.converter.BoltBindingConverter) Test(org.junit.Test)

Example 8 with BindingConverterFactoryImpl

use of com.alipay.sofa.runtime.service.impl.BindingConverterFactoryImpl in project sofa-boot by sofastack.

the class SofaRuntimeAutoConfiguration method bindingConverterFactory.

@Bean
@ConditionalOnMissingBean
public static BindingConverterFactory bindingConverterFactory() {
    BindingConverterFactory bindingConverterFactory = new BindingConverterFactoryImpl();
    bindingConverterFactory.addBindingConverters(getClassesByServiceLoader(BindingConverter.class));
    return bindingConverterFactory;
}
Also used : BindingConverterFactory(com.alipay.sofa.runtime.spi.service.BindingConverterFactory) BindingConverterFactoryImpl(com.alipay.sofa.runtime.service.impl.BindingConverterFactoryImpl) BindingConverter(com.alipay.sofa.runtime.spi.service.BindingConverter) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 9 with BindingConverterFactoryImpl

use of com.alipay.sofa.runtime.service.impl.BindingConverterFactoryImpl in project sofa-boot by sofastack.

the class RpcBindingConverterTest method testOrder.

@Test
public void testOrder() {
    BindingConverterFactory factory = new BindingConverterFactoryImpl();
    factory.addBindingConverters(RuntimeTestConfiguration.getClassesByServiceLoader(BindingConverter.class));
    BindingConverter bindingConverter = factory.getBindingConverter(TestBindingConverter.TEST);
    BindingConverter bindingConverterByTagName = factory.getBindingConverterByTagName(TestBindingConverter.TARGET_NAME);
    Assert.assertTrue(bindingConverter instanceof TestBindingConverter2);
    Assert.assertTrue(bindingConverterByTagName instanceof TestBindingConverter2);
}
Also used : BindingConverterFactory(com.alipay.sofa.runtime.spi.service.BindingConverterFactory) BindingConverterFactoryImpl(com.alipay.sofa.runtime.service.impl.BindingConverterFactoryImpl) BindingConverter(com.alipay.sofa.runtime.spi.service.BindingConverter) RpcBindingConverter(com.alipay.sofa.rpc.boot.runtime.converter.RpcBindingConverter) BoltBindingConverter(com.alipay.sofa.rpc.boot.runtime.converter.BoltBindingConverter) Test(org.junit.Test)

Example 10 with BindingConverterFactoryImpl

use of com.alipay.sofa.runtime.service.impl.BindingConverterFactoryImpl in project sofa-boot by sofastack.

the class RuntimeConfiguration method bindingConverterFactory.

@Bean
public static BindingConverterFactory bindingConverterFactory() {
    BindingConverterFactory bindingConverterFactory = new BindingConverterFactoryImpl();
    bindingConverterFactory.addBindingConverters(getClassesByServiceLoader(BindingConverter.class));
    return bindingConverterFactory;
}
Also used : BindingConverterFactory(com.alipay.sofa.runtime.spi.service.BindingConverterFactory) BindingConverterFactoryImpl(com.alipay.sofa.runtime.service.impl.BindingConverterFactoryImpl) BindingConverter(com.alipay.sofa.runtime.spi.service.BindingConverter) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

BindingConverterFactoryImpl (com.alipay.sofa.runtime.service.impl.BindingConverterFactoryImpl)11 BindingConverter (com.alipay.sofa.runtime.spi.service.BindingConverter)11 BindingConverterFactory (com.alipay.sofa.runtime.spi.service.BindingConverterFactory)11 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)8 Bean (org.springframework.context.annotation.Bean)8 BoltBindingConverter (com.alipay.sofa.rpc.boot.runtime.converter.BoltBindingConverter)2 RpcBindingConverter (com.alipay.sofa.rpc.boot.runtime.converter.RpcBindingConverter)2 Test (org.junit.Test)2