use of com.navercorp.pinpoint.profiler.instrument.classreading.SimpleClassMetadata in project pinpoint by naver.
the class PlainClassLoaderHandler method define0.
private void define0(final ClassLoader classLoader, ClassLoaderAttachment attachment, SimpleClassMetadata currentClass, Map<String, SimpleClassMetadata> classMetaMap, ClassLoadingChecker classLoadingChecker) {
if ("java.lang.Object".equals(currentClass.getClassName())) {
return;
}
if (attachment.containsClass(currentClass.getClassName())) {
return;
}
final String superName = currentClass.getSuperClassName();
if (isDebug) {
logger.debug("className:{} super:{}", currentClass.getClassName(), superName);
}
if (!"java.lang.Object".equals(superName)) {
if (!isSkipClass(superName, classLoadingChecker)) {
SimpleClassMetadata superClassBinary = classMetaMap.get(superName);
if (isDebug) {
logger.debug("superClass dependency define super:{} ori:{}", superClassBinary.getClassName(), currentClass.getClassName());
}
define0(classLoader, attachment, superClassBinary, classMetaMap, classLoadingChecker);
}
}
final List<String> interfaceList = currentClass.getInterfaceNames();
for (String interfaceName : interfaceList) {
if (!isSkipClass(interfaceName, classLoadingChecker)) {
SimpleClassMetadata interfaceClassBinary = classMetaMap.get(interfaceName);
if (interfaceClassBinary == null) {
throw new PinpointException(interfaceName + " not found");
}
if (isDebug) {
logger.debug("interface dependency define interface:{} ori:{}", interfaceClassBinary.getClassName(), interfaceClassBinary.getClassName());
}
define0(classLoader, attachment, interfaceClassBinary, classMetaMap, classLoadingChecker);
}
}
final Class<?> clazz = defineClass(classLoader, currentClass);
attachment.putClass(currentClass.getClassName(), clazz);
}
use of com.navercorp.pinpoint.profiler.instrument.classreading.SimpleClassMetadata in project pinpoint by naver.
the class PlainClassLoaderHandler method defineJarClass.
private void defineJarClass(ClassLoader classLoader, ClassLoaderAttachment attachment) {
if (isDebug) {
logger.debug("define Jar:{}", pluginConfig.getPluginJarURLExternalForm());
}
List<FileBinary> fileBinaryList = readJar();
Map<String, SimpleClassMetadata> classEntryMap = parse(fileBinaryList);
for (Map.Entry<String, SimpleClassMetadata> entry : classEntryMap.entrySet()) {
final SimpleClassMetadata classMetadata = entry.getValue();
ClassLoadingChecker classLoadingChecker = new ClassLoadingChecker();
classLoadingChecker.isFirstLoad(classMetadata.getClassName());
define0(classLoader, attachment, classMetadata, classEntryMap, classLoadingChecker);
}
}
use of com.navercorp.pinpoint.profiler.instrument.classreading.SimpleClassMetadata in project pinpoint by naver.
the class PlainClassLoaderHandler method parse.
private Map<String, SimpleClassMetadata> parse(List<FileBinary> fileBinaryList) {
Map<String, SimpleClassMetadata> parseMap = new HashMap<>();
for (FileBinary fileBinary : fileBinaryList) {
SimpleClassMetadata classNode = parseClass(fileBinary);
parseMap.put(classNode.getClassName(), classNode);
}
return parseMap;
}
use of com.navercorp.pinpoint.profiler.instrument.classreading.SimpleClassMetadata in project pinpoint by naver.
the class PlainClassLoaderHandler method parseClass.
private SimpleClassMetadata parseClass(FileBinary fileBinary) {
byte[] fileBinaryArray = fileBinary.getFileBinary();
SimpleClassMetadata classMetadata = SimpleClassMetadataReader.readSimpleClassMetadata(fileBinaryArray);
return classMetadata;
}
Aggregations