use of com.alipay.sofa.runtime.spi.service.BindingConverterFactory 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;
}
use of com.alipay.sofa.runtime.spi.service.BindingConverterFactory 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);
}
use of com.alipay.sofa.runtime.spi.service.BindingConverterFactory 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;
}
use of com.alipay.sofa.runtime.spi.service.BindingConverterFactory 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);
}
use of com.alipay.sofa.runtime.spi.service.BindingConverterFactory 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;
}
Aggregations