use of com.navercorp.pinpoint.bootstrap.instrument.NotFoundInstrumentException in project pinpoint by naver.
the class ASMEngine method getClass.
@Override
public InstrumentClass getClass(InstrumentContext instrumentContext, ClassLoader classLoader, String className, byte[] classFileBuffer) throws NotFoundInstrumentException {
if (className == null) {
throw new NullPointerException("class name must not be null.");
}
try {
if (classFileBuffer == null) {
ASMClassNodeAdapter classNode = ASMClassNodeAdapter.get(instrumentContext, classLoader, JavaAssistUtils.javaNameToJvmName(className));
if (classNode == null) {
return null;
}
ApiMetaDataService apiMetaDataService = this.apiMetaDataService.get();
return new ASMClass(objectBinderFactory, instrumentContext, interceptorRegistryBinder, apiMetaDataService, classLoader, classNode);
}
// Use ASM tree api.
final ClassReader classReader = new ClassReader(classFileBuffer);
final ClassNode classNode = new ClassNode();
classReader.accept(classNode, 0);
ApiMetaDataService apiMetaDataService = this.apiMetaDataService.get();
return new ASMClass(objectBinderFactory, instrumentContext, interceptorRegistryBinder, apiMetaDataService, classLoader, classNode);
} catch (Exception e) {
throw new NotFoundInstrumentException(e);
}
}
Aggregations