@Override
        public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {

            InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);

            if (isAvailableDataSourceMonitor(target)) {
                target.addField(DataSourceMonitorAccessor.class);

                // closeMethod
                InstrumentMethod closeMethod = InstrumentUtils.findMethod(target, "close");
                closeMethod.addScopedInterceptor(DataSourceCloseInterceptor.class, DruidConstants.SCOPE);

                // constructor
                InstrumentMethod defaultConstructor = InstrumentUtils.findConstructor(target);
                defaultConstructor.addScopedInterceptor(DataSourceConstructorInterceptor.class, DruidConstants.SCOPE);
            }

            // getConnectionMethod
            InstrumentMethod getConnectionMethod = InstrumentUtils.findMethod(target, "getConnection");
            getConnectionMethod.addScopedInterceptor(DataSourceGetConnectionInterceptor.class, DruidConstants.SCOPE);
            getConnectionMethod = InstrumentUtils.findMethod(target, "getConnection", new String[]{"java.lang.String", "java.lang.String"});
            getConnectionMethod.addScopedInterceptor(DataSourceGetConnectionInterceptor.class, DruidConstants.SCOPE);

            return target.toBytecode();
        }
The type Druid plugin.

@author Victor.Zxy
@version 1.8.1
@since 2017/07/21
agent-module/plugins/druid/src/main/java/com/navercorp/pinpoint/plugin/druid/DruidPlugin.java