com.caucho.config.gen
Class InterceptorGenerator<X>

java.lang.Object
  extended by com.caucho.config.gen.AbstractAspectGenerator<X>
      extended by com.caucho.config.gen.InterceptorGenerator<X>
All Implemented Interfaces:
AspectGenerator<X>

@Module
public class InterceptorGenerator<X>
extends AbstractAspectGenerator<X>

Represents the interception


Constructor Summary
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)
           
 
Method Summary
 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)
           
 
Methods inherited from class com.caucho.config.gen.AbstractAspectGenerator
generate, generateApplicationException, generateAsync, generateContent, generateDestroy, generatePostCall, generatePostConstruct, generatePostFinally, generatePreDestroy, generateSystemException, getAnnotation, getAnnotation, getAnnotation, getBeanFactory, getBeanType, getFactory, getJavaClass, getMethod, getThrowsExceptions, getTypeVariables, isApplicationExceptionThrown, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InterceptorGenerator

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)

InterceptorGenerator

public InterceptorGenerator(InterceptorFactory<X> factory,
                            java.util.HashSet<java.lang.Class<?>> lifecycleInterceptors,
                            InterceptionType type)
Method Detail

getInterceptors

public java.util.ArrayList<java.lang.Class<?>> getInterceptors()

generateClassPostConstruct

public void generateClassPostConstruct(JavaWriter out,
                                       java.util.HashMap<java.lang.String,java.lang.Object> map)
                                throws java.io.IOException
Throws:
java.io.IOException

generateClassPreDestroy

public void generateClassPreDestroy(JavaWriter out,
                                    java.util.HashMap<java.lang.String,java.lang.Object> map)
                             throws java.io.IOException
Throws:
java.io.IOException

generateEpilogue

public void generateEpilogue(JavaWriter out,
                             java.util.HashMap<java.lang.String,java.lang.Object> map)
                      throws java.io.IOException
Description copied from class: AbstractAspectGenerator
Generates epilogue

Specified by:
generateEpilogue in interface AspectGenerator<X>
Overrides:
generateEpilogue in class AbstractAspectGenerator<X>
Throws:
java.io.IOException

generateBeanPrologue

public void generateBeanPrologue(JavaWriter out,
                                 java.util.HashMap<java.lang.String,java.lang.Object> map)
                          throws java.io.IOException
Generates the prologue for the bean instance.

Specified by:
generateBeanPrologue in interface AspectGenerator<X>
Overrides:
generateBeanPrologue in class AbstractAspectGenerator<X>
Throws:
java.io.IOException

generateBeanConstructor

public void generateBeanConstructor(JavaWriter out,
                                    java.util.HashMap<java.lang.String,java.lang.Object> map)
                             throws java.io.IOException
Description copied from class: AbstractAspectGenerator
Generates initialization in the constructor

Specified by:
generateBeanConstructor in interface AspectGenerator<X>
Overrides:
generateBeanConstructor in class AbstractAspectGenerator<X>
Throws:
java.io.IOException

generateInject

public void generateInject(JavaWriter out,
                           java.util.HashMap<java.lang.String,java.lang.Object> map)
                    throws java.io.IOException
Description copied from class: AbstractAspectGenerator
Generates extra inject code

Specified by:
generateInject in interface AspectGenerator<X>
Overrides:
generateInject in class AbstractAspectGenerator<X>
Throws:
java.io.IOException

generateProxyConstructor

public void generateProxyConstructor(JavaWriter out,
                                     java.util.HashMap<java.lang.String,java.lang.Object> map)
                              throws java.io.IOException
Description copied from class: AbstractAspectGenerator
Generates initialization in the proxy constructor

Specified by:
generateProxyConstructor in interface AspectGenerator<X>
Overrides:
generateProxyConstructor in class AbstractAspectGenerator<X>
Throws:
java.io.IOException

generateMethodPrologue

public void generateMethodPrologue(JavaWriter out,
                                   java.util.HashMap<java.lang.String,java.lang.Object> map)
                            throws java.io.IOException
Generates the prologue for a method.

Specified by:
generateMethodPrologue in interface AspectGenerator<X>
Overrides:
generateMethodPrologue in class AbstractAspectGenerator<X>
Throws:
java.io.IOException

generatePreTry

public void generatePreTry(JavaWriter out)
                    throws java.io.IOException
Description copied from class: AbstractAspectGenerator
Generates code before the try block

Specified by:
generatePreTry in interface AspectGenerator<X>
Overrides:
generatePreTry in class AbstractAspectGenerator<X>
Throws:
java.io.IOException

generatePreCall

public void generatePreCall(JavaWriter out)
                     throws java.io.IOException
Description copied from class: AbstractAspectGenerator
Generates code before the call, in the try block.
 retType myMethod(...)
 {
   try {
     [pre-call]
     value = bean.myMethod(...);
     ...
 }
 

Specified by:
generatePreCall in interface AspectGenerator<X>
Overrides:
generatePreCall in class AbstractAspectGenerator<X>
Throws:
java.io.IOException

generateCall

public void generateCall(JavaWriter out)
                  throws java.io.IOException
Description copied from class: AbstractAspectGenerator
Generates the method interception code

Specified by:
generateCall in interface AspectGenerator<X>
Overrides:
generateCall in class AbstractAspectGenerator<X>
Throws:
java.io.IOException

generateFinally

public void generateFinally(JavaWriter out)
                     throws java.io.IOException
Description copied from class: AbstractAspectGenerator
Generates finally code for the method

Specified by:
generateFinally in interface AspectGenerator<X>
Overrides:
generateFinally in class AbstractAspectGenerator<X>
Throws:
java.io.IOException

getJavaMethod

protected java.lang.reflect.Method getJavaMethod()
Description copied from class: AbstractAspectGenerator
Returns the JavaMethod for this aspect.

Overrides:
getJavaMethod in class AbstractAspectGenerator<X>

generateTailCall

public void generateTailCall(JavaWriter out,
                             java.lang.String superVar)
                      throws java.io.IOException
Generates the call to the implementation bean.

Parameters:
superVar - java code to reference the implementation
Throws:
java.io.IOException

printCastClass

protected void printCastClass(JavaWriter out,
                              java.lang.reflect.Type type)
                       throws java.io.IOException
Throws:
java.io.IOException

nullMethod

public static void nullMethod()