本文整理汇总了Java中com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider类的典型用法代码示例。如果您正苦于以下问题:Java AnnotationProcessorsProvider类的具体用法?Java AnnotationProcessorsProvider怎么用?Java AnnotationProcessorsProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnnotationProcessorsProvider类属于com.netflix.ribbon.proxy.processor包,在下文中一共展示了AnnotationProcessorsProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldBindCustomClientConfigFactory
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
@Test
public void shouldBindCustomClientConfigFactory() {
ConfigurationManager.getConfigInstance().setProperty(MovieService.class.getSimpleName() + ".MyConfig.listOfServers", "localhost:" + port);
Injector injector = Guice.createInjector(
new AbstractModule() {
@Override
protected void configure() {
bind(RibbonResourceFactory.class).to(DefaultResourceFactory.class).in(Scopes.SINGLETON);
bind(RibbonTransportFactory.class).to(DefaultRibbonTransportFactory.class).in(Scopes.SINGLETON);
bind(AnnotationProcessorsProvider.class).to(DefaultAnnotationProcessorsProvider.class).in(Scopes.SINGLETON);
bind(ClientConfigFactory.class).to(MyClientConfigFactory.class).in(Scopes.SINGLETON);
}
},
new AbstractModule() {
@Override
protected void configure() {
bind(MovieService.class).toProvider(new RibbonResourceProvider<MovieService>(MovieService.class)).asEagerSingleton();
}
}
);
RxMovieProxyExample example = injector.getInstance(RxMovieProxyExample.class);
assertTrue(example.runExample());
}
示例2: configure
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
@Override
protected void configure() {
bind(ClientConfigFactory.class).to(DefaultClientConfigFactory.class).in(Scopes.SINGLETON);
bind(RibbonTransportFactory.class).to(DefaultRibbonTransportFactory.class).in(Scopes.SINGLETON);
bind(AnnotationProcessorsProvider.class).to(DefaultAnnotationProcessorsProvider.class).in(Scopes.SINGLETON);
bind(RibbonResourceFactory.class).to(DefaultResourceFactory.class).in(Scopes.SINGLETON);
}
示例3: MethodTemplateExecutor
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
MethodTemplateExecutor(HttpResourceGroup httpResourceGroup, MethodTemplate methodTemplate, AnnotationProcessorsProvider annotations) {
this.httpResourceGroup = httpResourceGroup;
this.methodTemplate = methodTemplate;
httpRequestTemplateBuilder = createHttpRequestTemplateBuilder();
for (AnnotationProcessor processor: annotations.getProcessors()) {
processor.process(methodTemplate.getTemplateName(), httpRequestTemplateBuilder, methodTemplate.getMethod());
}
}
示例4: from
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
public static Map<Method, MethodTemplateExecutor> from(HttpResourceGroup httpResourceGroup, Class<?> clientInterface, AnnotationProcessorsProvider annotations) {
MethodTemplate[] methodTemplates = MethodTemplate.from(clientInterface);
Map<Method, MethodTemplateExecutor> tgm = new HashMap<Method, MethodTemplateExecutor>();
for (MethodTemplate mt : methodTemplates) {
tgm.put(mt.getMethod(), new MethodTemplateExecutor(httpResourceGroup, mt, annotations));
}
return tgm;
}
示例5: RibbonDynamicProxy
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
public RibbonDynamicProxy(Class<T> clientInterface, RibbonResourceFactory resourceGroupFactory, ClientConfigFactory configFactory,
RibbonTransportFactory transportFactory, AnnotationProcessorsProvider processors) {
registerAnnotationProcessors(processors);
ClassTemplate<T> classTemplate = ClassTemplate.from(clientInterface);
HttpResourceGroup httpResourceGroup = new ProxyHttpResourceGroupFactory<T>(classTemplate, resourceGroupFactory, processors).createResourceGroup();
templateExecutorMap = MethodTemplateExecutor.from(httpResourceGroup, clientInterface, processors);
lifeCycle = new ProxyLifecycleImpl(httpResourceGroup);
}
示例6: newInstance
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static <T> T newInstance(Class<T> clientInterface, RibbonResourceFactory resourceGroupFactory,
ClientConfigFactory configFactory, RibbonTransportFactory transportFactory, AnnotationProcessorsProvider processors) {
if (!clientInterface.isInterface()) {
throw new IllegalArgumentException(clientInterface.getName() + " is a class not interface");
}
return (T) Proxy.newProxyInstance(
Thread.currentThread().getContextClassLoader(),
new Class[]{clientInterface, ProxyLifeCycle.class},
new RibbonDynamicProxy<T>(clientInterface, resourceGroupFactory, configFactory, transportFactory, processors)
);
}
示例7: testSetupWithResourceGroupNameInAnnotation
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
@Test
public void testSetupWithResourceGroupNameInAnnotation() throws Exception {
mockStatic(ProxyHttpResourceGroupFactory.class);
expectNew(ProxyHttpResourceGroupFactory.class, new Class[]{ClassTemplate.class,
RibbonResourceFactory.class, AnnotationProcessorsProvider.class
}, anyObject(), anyObject(), anyObject()).andReturn(httpResourceGroupFactoryMock);
replayAll();
RibbonDynamicProxy.newInstance(SampleMovieServiceWithResourceGroupNameAnnotation.class);
}
示例8: initializeSampleMovieServiceMocks
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
private void initializeSampleMovieServiceMocks() {
MethodTemplateExecutor tgMock = createMock(MethodTemplateExecutor.class);
expect(tgMock.executeFromTemplate(anyObject(Object[].class))).andReturn(ribbonRequestMock);
Map<Method, MethodTemplateExecutor> tgMap = new HashMap<Method, MethodTemplateExecutor>();
tgMap.put(methodByName(SampleMovieService.class, "findMovieById"), tgMock);
mockStatic(MethodTemplateExecutor.class);
expect(MethodTemplateExecutor.from(httpResourceGroupMock, SampleMovieService.class, AnnotationProcessorsProvider.DEFAULT)).andReturn(tgMap);
}
示例9: testFromFactory
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
@Test
public void testFromFactory() throws Exception {
expect(httpResourceGroupMock.newTemplateBuilder(anyObject(String.class))).andReturn(httpRequestTemplateBuilderMock).anyTimes();
expect(httpRequestTemplateBuilderMock.withMethod(anyObject(String.class))).andReturn(httpRequestTemplateBuilderMock).anyTimes();
expect(httpRequestTemplateBuilderMock.withUriTemplate(anyObject(String.class))).andReturn(httpRequestTemplateBuilderMock).anyTimes();
replayAll();
Map<Method, MethodTemplateExecutor> executorMap = MethodTemplateExecutor.from(httpResourceGroupMock, ShortMovieService.class, AnnotationProcessorsProvider.DEFAULT);
assertEquals(ShortMovieService.class.getMethods().length, executorMap.size());
}
示例10: testServiceLoader
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
@Test
public void testServiceLoader() {
AnnotationProcessorsProvider annotations = AnnotationProcessorsProvider.DEFAULT;
List<AnnotationProcessor> processors = annotations.getProcessors();
boolean hasEVCacheProcessor = false;
for (AnnotationProcessor processor: processors) {
Class<?> clazz = processor.getClass();
if (clazz.equals(EVCacheAnnotationProcessor.class)) {
hasEVCacheProcessor = true;
break;
}
}
assertTrue(hasEVCacheProcessor);
}
示例11: SecuredRibbonResourceFactory
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
public SecuredRibbonResourceFactory(final int maxChunkSize) {
this(ClientConfigFactory.DEFAULT,
new SecuredTransportFactory(maxChunkSize),
AnnotationProcessorsProvider.DEFAULT);
}
示例12: SecuredRibbonResourceFactory
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
public SecuredRibbonResourceFactory(final int maxChunkSize) {
this(ClientConfigFactory.DEFAULT,
new SecuredTransportFactory(maxChunkSize),
AnnotationProcessorsProvider.DEFAULT);
}
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:6,代码来源:SecuredRibbonResourceFactory.java
示例13: DefaultResourceFactory
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
@Inject
public DefaultResourceFactory(ClientConfigFactory clientConfigFactory, RibbonTransportFactory transportFactory,
AnnotationProcessorsProvider annotationProcessorsProvider) {
super(clientConfigFactory, transportFactory, annotationProcessorsProvider);
}
示例14: ProxyHttpResourceGroupFactory
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
ProxyHttpResourceGroupFactory(ClassTemplate<T> classTemplate) {
this(classTemplate, new DefaultResourceFactory(ClientConfigFactory.DEFAULT, RibbonTransportFactory.DEFAULT, AnnotationProcessorsProvider.DEFAULT),
AnnotationProcessorsProvider.DEFAULT);
}
示例15: registerAnnotationProcessors
import com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider; //导入依赖的package包/类
static void registerAnnotationProcessors(AnnotationProcessorsProvider processors) {
processors.register(new HttpAnnotationProcessor());
processors.register(new HystrixAnnotationProcessor());
processors.register(new CacheProviderAnnotationProcessor());
processors.register(new ClientPropertiesProcessor());
}