use of org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache in project incubator-skywalking by apache.
the class ControllerConstructorInterceptor method onConstruct.
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
String basePath = "";
RequestMapping basePathRequestMapping = objInst.getClass().getAnnotation(RequestMapping.class);
if (basePathRequestMapping != null) {
if (basePathRequestMapping.value().length > 0) {
basePath = basePathRequestMapping.value()[0];
}
}
EnhanceRequireObjectCache enhanceCache = new EnhanceRequireObjectCache();
enhanceCache.setPathMappingCache(new PathMappingCache(basePath));
objInst.setSkyWalkingDynamicField(enhanceCache);
}
use of org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache in project incubator-skywalking by apache.
the class ControllerConstructorInterceptor method onConstruct.
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
String basePath = "";
RequestMapping basePathRequestMapping = objInst.getClass().getAnnotation(RequestMapping.class);
if (basePathRequestMapping != null) {
if (basePathRequestMapping.value().length > 0) {
basePath = basePathRequestMapping.value()[0];
} else if (basePathRequestMapping.path().length > 0) {
basePath = basePathRequestMapping.path()[0];
}
}
EnhanceRequireObjectCache enhanceRequireObjectCache = new EnhanceRequireObjectCache();
enhanceRequireObjectCache.setPathMappingCache(new PathMappingCache(basePath));
objInst.setSkyWalkingDynamicField(enhanceRequireObjectCache);
}
Aggregations