Created
April 9, 2016 13:05
-
-
Save heipacker/dc219bff58e614a091cf0f989fe28d65 to your computer and use it in GitHub Desktop.
SimpleClassFileTransformer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dlmu.agent.server; | |
import java.lang.instrument.ClassFileTransformer; | |
import java.lang.instrument.IllegalClassFormatException; | |
import java.security.ProtectionDomain; | |
/** | |
* Created by fupan on 16-4-9. | |
*/ | |
public class SimpleClassFileTransformer implements ClassFileTransformer { | |
@Override | |
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException { | |
System.out.println("啊哈."); | |
return classfileBuffer; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment