use of com.navercorp.pinpoint.agent.plugin.proxy.common.ProxyRequestMetadataSetupContext in project pinpoint by naver.
the class ProxyRequestTypeRegistryServiceImpl method init.
@PostConstruct
public void init() {
final ClassLoader classLoader = ClassUtils.getDefaultClassLoader();
final ServiceLoader<ProxyRequestMetadataProvider> serviceLoader = ServiceLoader.load(ProxyRequestMetadataProvider.class, classLoader);
final List<ProxyRequestType> proxyRequestTypeList = new ArrayList<ProxyRequestType>();
for (ProxyRequestMetadataProvider provider : serviceLoader) {
final ProxyRequestMetadataSetupContext context = new ProxyRequestMetadataSetupContext() {
@Override
public void addProxyHttpHeaderType(ProxyRequestType type) {
proxyRequestTypeList.add(type);
}
};
provider.setup(context);
}
logger.info("Loading ProxyRequestTypeProvider {}", proxyRequestTypeList);
for (ProxyRequestType type : proxyRequestTypeList) {
logger.info("Add ProxyRequestType {}", type);
final ProxyRequestType exist = this.codeLookupTable.put(type.getCode(), type);
if (exist != null) {
logger.warn("Duplicated ProxyRequestType {}/{}", type, exist);
}
}
}
Aggregations