public class GlobalCallbackEnhancerextends CallbackClassFileTransformer
Constructor and Description |
---|
GlobalCallbackEnhancer() |
Modifier and Type | Method and Description |
---|---|
protected void | enhanceMethod(javassist.CtMethod method) Responsible for method enhancing, writing service calls to method. |
protected boolean | isEnhanceable(javassist.CtMethod method) Checks if method is enhanceable. |
protected byte[] | transformClass(ClassLoader loader, byte[] clazzBytes) Actually transforms the class. |
protected String | writeAfterMethod(javassist.CtMethod method, int paramLength, String listenerFieldName) Writes code that will be inserted after method |
protected String | writeBeforeMethod(javassist.CtMethod method, int paramLength, String listenerFieldName) Code that is added in the begining of the method |
transform
protected byte[] transformClass(ClassLoader loader, byte[] clazzBytes) throws Exception
CallbackClassFileTransformer
transformClass
in class CallbackClassFileTransformer
loader
- class loader of this classclazzBytes
- class bytesException
- if something went wrongprotected void enhanceMethod(javassist.CtMethod method) throws javassist.CannotCompileException, javassist.NotFoundException, ClassNotFoundException
method
- Method that has to be editedjavassist.CannotCompileException
- if something went wrongjavassist.NotFoundException
- if something went wrongClassNotFoundException
protected String writeBeforeMethod(javassist.CtMethod method, int paramLength, String listenerFieldName) throws javassist.NotFoundException
method
- method that should be editedparamLength
- Lenght of methods parameterslistenerFieldName
- Listener class that is used for methodjavassist.NotFoundException
- if something went wrongprotected String writeAfterMethod(javassist.CtMethod method, int paramLength, String listenerFieldName) throws javassist.NotFoundException
method
- method to editparamLength
- lenght of method paramenterslistenerFieldName
- method listenerjavassist.NotFoundException
- if something went wrongprotected boolean isEnhanceable(javassist.CtMethod method)
GlobalCallback
annotation, be not native and not abstractmethod
- method to checkCopyright © 2014–2015. All rights reserved.