@Override
        public byte[] doInTransform(Instrumentor instrumentor, ClassLoader classLoader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {
            final InstrumentClass target = instrumentor.getInstrumentClass(classLoader, className, classfileBuffer);

            final InstrumentMethod doInvokeRecordListenerMethod = target.getDeclaredMethod("doInvokeRecordListener", "org.apache.kafka.clients.consumer.ConsumerRecord", "java.util.Iterator");
            if (doInvokeRecordListenerMethod != null) {
                doInvokeRecordListenerMethod.addScopedInterceptor(ConsumerRecordEntryPointInterceptor.class, va(0), KafkaConstants.SCOPE, ExecutionPolicy.BOUNDARY);
            }
            final InstrumentMethod invokeErrorHandlerMethod = target.getDeclaredMethod("invokeErrorHandler", "org.apache.kafka.clients.consumer.ConsumerRecord", "java.util.Iterator", "java.lang.RuntimeException");
            if (invokeErrorHandlerMethod != null) {
                invokeErrorHandlerMethod.addInterceptor(ListenerConsumerInvokeErrorHandlerInterceptor.class);
            }
            final InstrumentMethod doInvokeBatchListenerMethod = target.getDeclaredMethod("doInvokeBatchListener", "org.apache.kafka.clients.consumer.ConsumerRecord", "java.util.List");
            if (doInvokeBatchListenerMethod != null) {
                doInvokeBatchListenerMethod.addScopedInterceptor(ConsumerMultiRecordEntryPointInterceptor.class, va(1), KafkaConstants.SCOPE, ExecutionPolicy.BOUNDARY);
            }
            final InstrumentMethod invokeBatchErrorHandlerMethod = target.getDeclaredMethod("invokeBatchErrorHandler", "org.apache.kafka.clients.consumer.ConsumerRecord", "java.util.List", "java.lang.RuntimeException");
            if (invokeBatchErrorHandlerMethod != null) {
                invokeBatchErrorHandlerMethod.addInterceptor(ListenerConsumerInvokeErrorHandlerInterceptor.class);
            }

            return target.toBytecode();
        }
@author Harris Gwag (gwagdalf)
@author Taejin Koo
agent-module/plugins/kafka/src/main/java/com/navercorp/pinpoint/plugin/kafka/KafkaPlugin.java