@Module public class InterceptorGenerator<X> extends AbstractAspectGenerator<X>
Constructor and Description |
---|
InterceptorGenerator(InterceptorFactory<X> factory,
AnnotatedMethod<? super X> method,
AspectGenerator<X> next,
InterceptionType type,
java.util.HashSet<java.lang.Class<?>> methodInterceptors,
java.util.HashMap<java.lang.Class<?>,java.lang.annotation.Annotation> methodInterceptorMap,
java.util.HashSet<java.lang.Class<?>> decoratorSet,
boolean isExcludeClassInterceptors) |
InterceptorGenerator(InterceptorFactory<X> factory,
java.util.HashSet<java.lang.Class<?>> lifecycleInterceptors,
InterceptionType type) |
Modifier and Type | Method and Description |
---|---|
void |
generateBeanConstructor(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates initialization in the constructor
|
void |
generateBeanPrologue(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates the prologue for the bean instance.
|
void |
generateCall(JavaWriter out)
Generates the method interception code
|
void |
generateClassPostConstruct(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map) |
void |
generateClassPreDestroy(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map) |
void |
generateEpilogue(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates epilogue
|
void |
generateFinally(JavaWriter out)
Generates finally code for the method
|
void |
generateInject(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates extra inject code
|
void |
generateMethodPrologue(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates the prologue for a method.
|
void |
generatePreCall(JavaWriter out)
Generates code before the call, in the try block.
|
void |
generatePreTry(JavaWriter out)
Generates code before the try block
|
void |
generateProxyConstructor(JavaWriter out,
java.util.HashMap<java.lang.String,java.lang.Object> map)
Generates initialization in the proxy constructor
|
void |
generateTailCall(JavaWriter out,
java.lang.String superVar)
Generates the call to the implementation bean.
|
java.util.ArrayList<java.lang.Class<?>> |
getInterceptors() |
protected java.lang.reflect.Method |
getJavaMethod()
Returns the JavaMethod for this aspect.
|
static void |
nullMethod() |
protected void |
printCastClass(JavaWriter out,
java.lang.reflect.Type type) |
generate, generateApplicationException, generateAsync, generateContent, generateDestroy, generatePostCall, generatePostConstruct, generatePostFinally, generatePreDestroy, generateSystemException, getAnnotation, getAnnotation, getAnnotation, getBeanFactory, getBeanType, getFactory, getInstanceName, getJavaClass, getMethod, getThrowsExceptions, getTypeVariables, isApplicationExceptionThrown, toString
public InterceptorGenerator(InterceptorFactory<X> factory, AnnotatedMethod<? super X> method, AspectGenerator<X> next, InterceptionType type, java.util.HashSet<java.lang.Class<?>> methodInterceptors, java.util.HashMap<java.lang.Class<?>,java.lang.annotation.Annotation> methodInterceptorMap, java.util.HashSet<java.lang.Class<?>> decoratorSet, boolean isExcludeClassInterceptors)
public InterceptorGenerator(InterceptorFactory<X> factory, java.util.HashSet<java.lang.Class<?>> lifecycleInterceptors, InterceptionType type)
public java.util.ArrayList<java.lang.Class<?>> getInterceptors()
public void generateClassPostConstruct(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
java.io.IOException
public void generateClassPreDestroy(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
java.io.IOException
public void generateEpilogue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
AbstractAspectGenerator
generateEpilogue
in interface AspectGenerator<X>
generateEpilogue
in class AbstractAspectGenerator<X>
java.io.IOException
public void generateBeanPrologue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
generateBeanPrologue
in interface AspectGenerator<X>
generateBeanPrologue
in class AbstractAspectGenerator<X>
java.io.IOException
public void generateBeanConstructor(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
AbstractAspectGenerator
generateBeanConstructor
in interface AspectGenerator<X>
generateBeanConstructor
in class AbstractAspectGenerator<X>
java.io.IOException
public void generateInject(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
AbstractAspectGenerator
generateInject
in interface AspectGenerator<X>
generateInject
in class AbstractAspectGenerator<X>
java.io.IOException
public void generateProxyConstructor(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
AbstractAspectGenerator
generateProxyConstructor
in interface AspectGenerator<X>
generateProxyConstructor
in class AbstractAspectGenerator<X>
java.io.IOException
public void generateMethodPrologue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map) throws java.io.IOException
generateMethodPrologue
in interface AspectGenerator<X>
generateMethodPrologue
in class AbstractAspectGenerator<X>
java.io.IOException
public void generatePreTry(JavaWriter out) throws java.io.IOException
AbstractAspectGenerator
generatePreTry
in interface AspectGenerator<X>
generatePreTry
in class AbstractAspectGenerator<X>
java.io.IOException
public void generatePreCall(JavaWriter out) throws java.io.IOException
AbstractAspectGenerator
retType myMethod(...)
{
try {
[pre-call]
value = bean.myMethod(...);
...
}
generatePreCall
in interface AspectGenerator<X>
generatePreCall
in class AbstractAspectGenerator<X>
java.io.IOException
public void generateCall(JavaWriter out) throws java.io.IOException
AbstractAspectGenerator
generateCall
in interface AspectGenerator<X>
generateCall
in class AbstractAspectGenerator<X>
java.io.IOException
public void generateFinally(JavaWriter out) throws java.io.IOException
AbstractAspectGenerator
generateFinally
in interface AspectGenerator<X>
generateFinally
in class AbstractAspectGenerator<X>
java.io.IOException
protected java.lang.reflect.Method getJavaMethod()
AbstractAspectGenerator
getJavaMethod
in class AbstractAspectGenerator<X>
public void generateTailCall(JavaWriter out, java.lang.String superVar) throws java.io.IOException
superVar
- java code to reference the implementationjava.io.IOException
protected void printCastClass(JavaWriter out, java.lang.reflect.Type type) throws java.io.IOException
java.io.IOException
public static void nullMethod()