當前位置: 首頁>>代碼示例>>Java>>正文


Java AnnotationProcessorsProvider類代碼示例

本文整理匯總了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());
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:26,代碼來源:RxMovieProxyExampleTest.java

示例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);
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:8,代碼來源:RibbonModule.java

示例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());
    }
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:9,代碼來源:MethodTemplateExecutor.java

示例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;
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:9,代碼來源:MethodTemplateExecutor.java

示例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);
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:9,代碼來源:RibbonDynamicProxy.java

示例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)
    );
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:13,代碼來源:RibbonDynamicProxy.java

示例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);
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:12,代碼來源:RibbonDynamicProxyTest.java

示例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);
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:11,代碼來源:RibbonDynamicProxyTest.java

示例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());
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:12,代碼來源:MethodTemplateExecutorTest.java

示例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);
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:15,代碼來源:ServiceLoaderTest.java

示例11: 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,項目名稱:wildfly-swarm,代碼行數:6,代碼來源:SecuredRibbonResourceFactory.java

示例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);
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:6,代碼來源:DefaultResourceFactory.java

示例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);
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:5,代碼來源:ProxyHttpResourceGroupFactory.java

示例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());
}
 
開發者ID:Netflix,項目名稱:ribbon,代碼行數:7,代碼來源:RibbonDynamicProxy.java


注:本文中的com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。