Search in sources :

Example 1 with StaticFieldLookUp

use of com.navercorp.pinpoint.common.util.StaticFieldLookUp in project pinpoint by naver.

the class DefaultAnnotationKeyMatcherService method build.

private AnnotationKeyMatcherRegistry build(TraceMetadataLoaderService typeLoaderService) {
    AnnotationKeyMatcherRegistry.Builder builder = new AnnotationKeyMatcherRegistry.Builder();
    StaticFieldLookUp<DisplayArgumentMatcher> staticFieldLookUp = new StaticFieldLookUp<>(DefaultDisplayArgument.class, DisplayArgumentMatcher.class);
    List<DisplayArgumentMatcher> lookup = staticFieldLookUp.lookup();
    for (DisplayArgumentMatcher displayArgumentMatcher : lookup) {
        AnnotationKeyMatcher annotationKeyMatcher = displayArgumentMatcher.getAnnotationKeyMatcher();
        if (annotationKeyMatcher == null) {
            continue;
        }
        logger.debug("add DefaultAnnotationKeyMatcher ServiceType:{}, AnnotationKeyMatcher:{}", displayArgumentMatcher.getServiceType(), annotationKeyMatcher);
        builder.addAnnotationMatcher(displayArgumentMatcher.getServiceType(), annotationKeyMatcher);
    }
    List<ServiceTypeInfo> types = typeLoaderService.getServiceTypeInfos();
    for (ServiceTypeInfo type : types) {
        if (type.getPrimaryAnnotationKeyMatcher() == null) {
            continue;
        }
        logger.debug("add AnnotationKeyMatcher ServiceType:{}, AnnotationKeyMatcher:{}", type.getServiceType(), type.getPrimaryAnnotationKeyMatcher());
        builder.addAnnotationMatcher(type.getServiceType(), type.getPrimaryAnnotationKeyMatcher());
    }
    return builder.build();
}
Also used : StaticFieldLookUp(com.navercorp.pinpoint.common.util.StaticFieldLookUp) AnnotationKeyMatcher(com.navercorp.pinpoint.common.trace.AnnotationKeyMatcher) ServiceTypeInfo(com.navercorp.pinpoint.common.trace.ServiceTypeInfo) AnnotationKeyMatcherRegistry(com.navercorp.pinpoint.web.util.AnnotationKeyMatcherRegistry) DisplayArgumentMatcher(com.navercorp.pinpoint.common.util.DisplayArgumentMatcher)

Example 2 with StaticFieldLookUp

use of com.navercorp.pinpoint.common.util.StaticFieldLookUp in project pinpoint by naver.

the class DefaultAnnotationKeyRegistryService method buildAnnotationKeyRegistry.

private AnnotationKeyRegistry buildAnnotationKeyRegistry() {
    AnnotationKeyRegistry.Builder builder = new AnnotationKeyRegistry.Builder();
    StaticFieldLookUp<AnnotationKey> staticFieldLookUp = new StaticFieldLookUp<AnnotationKey>(AnnotationKey.class, AnnotationKey.class);
    List<AnnotationKey> lookup = staticFieldLookUp.lookup();
    for (AnnotationKey serviceType : lookup) {
        if (logger.isInfoEnabled()) {
            logger.info("add Default AnnotationKey:" + serviceType);
        }
        builder.addAnnotationKey(serviceType);
    }
    final List<AnnotationKey> types = typeLoaderService.getAnnotationKeys();
    for (AnnotationKey type : types) {
        if (logger.isInfoEnabled()) {
            logger.info("add Plugin AnnotationKey:" + type);
        }
        builder.addAnnotationKey(type);
    }
    return builder.build();
}
Also used : StaticFieldLookUp(com.navercorp.pinpoint.common.util.StaticFieldLookUp) AnnotationKey(com.navercorp.pinpoint.common.trace.AnnotationKey) AnnotationKeyRegistry(com.navercorp.pinpoint.common.trace.AnnotationKeyRegistry)

Example 3 with StaticFieldLookUp

use of com.navercorp.pinpoint.common.util.StaticFieldLookUp in project pinpoint by naver.

the class DefaultServiceTypeRegistryService method buildServiceTypeRegistry.

private ServiceTypeRegistry buildServiceTypeRegistry() {
    ServiceTypeRegistry.Builder builder = new ServiceTypeRegistry.Builder();
    StaticFieldLookUp<ServiceType> staticFieldLookUp = new StaticFieldLookUp<ServiceType>(ServiceType.class, ServiceType.class);
    List<ServiceType> lookup = staticFieldLookUp.lookup();
    for (ServiceType serviceType : lookup) {
        if (logger.isInfoEnabled()) {
            logger.info("add Default ServiceType:" + serviceType);
        }
        builder.addServiceType(serviceType);
    }
    final List<ServiceTypeInfo> types = loadType();
    for (ServiceTypeInfo type : types) {
        if (logger.isInfoEnabled()) {
            logger.info("add Plugin ServiceType:" + type.getServiceType());
        }
        builder.addServiceType(type.getServiceType());
    }
    return builder.build();
}
Also used : ServiceTypeRegistry(com.navercorp.pinpoint.common.trace.ServiceTypeRegistry) StaticFieldLookUp(com.navercorp.pinpoint.common.util.StaticFieldLookUp) ServiceTypeInfo(com.navercorp.pinpoint.common.trace.ServiceTypeInfo) ServiceType(com.navercorp.pinpoint.common.trace.ServiceType)

Aggregations

StaticFieldLookUp (com.navercorp.pinpoint.common.util.StaticFieldLookUp)3 ServiceTypeInfo (com.navercorp.pinpoint.common.trace.ServiceTypeInfo)2 AnnotationKey (com.navercorp.pinpoint.common.trace.AnnotationKey)1 AnnotationKeyMatcher (com.navercorp.pinpoint.common.trace.AnnotationKeyMatcher)1 AnnotationKeyRegistry (com.navercorp.pinpoint.common.trace.AnnotationKeyRegistry)1 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)1 ServiceTypeRegistry (com.navercorp.pinpoint.common.trace.ServiceTypeRegistry)1 DisplayArgumentMatcher (com.navercorp.pinpoint.common.util.DisplayArgumentMatcher)1 AnnotationKeyMatcherRegistry (com.navercorp.pinpoint.web.util.AnnotationKeyMatcherRegistry)1