Search in sources :

Example 1 with AnnotationProcessor

use of com.netflix.ribbon.proxy.processor.AnnotationProcessor in project ribbon by Netflix.

the class ServiceLoaderTest method testServiceLoader.

@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);
}
Also used : AnnotationProcessor(com.netflix.ribbon.proxy.processor.AnnotationProcessor) EVCacheAnnotationProcessor(com.netflix.ribbon.proxy.processor.EVCacheAnnotationProcessor) AnnotationProcessorsProvider(com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider) Test(org.junit.Test)

Example 2 with AnnotationProcessor

use of com.netflix.ribbon.proxy.processor.AnnotationProcessor in project ribbon by Netflix.

the class ProxyHttpResourceGroupFactory method createResourceGroup.

public HttpResourceGroup createResourceGroup() {
    Class<? extends HttpResourceGroup> resourceClass = classTemplate.getResourceGroupClass();
    if (resourceClass != null) {
        return Utils.newInstance(resourceClass);
    } else {
        String name = classTemplate.getResourceGroupName();
        if (name == null) {
            name = classTemplate.getClientInterface().getSimpleName();
        }
        HttpResourceGroup.Builder builder = httpResourceGroupFactory.createHttpResourceGroupBuilder(name);
        for (AnnotationProcessor processor : processors.getProcessors()) {
            processor.process(name, builder, httpResourceGroupFactory, classTemplate.getClientInterface());
        }
        return builder.build();
    }
}
Also used : HttpResourceGroup(com.netflix.ribbon.http.HttpResourceGroup) AnnotationProcessor(com.netflix.ribbon.proxy.processor.AnnotationProcessor)

Aggregations

AnnotationProcessor (com.netflix.ribbon.proxy.processor.AnnotationProcessor)2 HttpResourceGroup (com.netflix.ribbon.http.HttpResourceGroup)1 AnnotationProcessorsProvider (com.netflix.ribbon.proxy.processor.AnnotationProcessorsProvider)1 EVCacheAnnotationProcessor (com.netflix.ribbon.proxy.processor.EVCacheAnnotationProcessor)1 Test (org.junit.Test)1