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

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

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

Represents the XA interception


Constructor Summary
CacheGenerator(CacheFactory<X> factory, AnnotatedMethod<? super X> method, AspectGenerator<X> next, CacheResult cache)
           
 
Method Summary
 void generateMethodPrologue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
          Generates the static class prologue
 void generatePostCall(JavaWriter out)
          Generates the interceptor code after invocation and before the call.
 void generatePreCall(JavaWriter out)
          Generates the interceptor code after the try-block and before the call.
 
Methods inherited from class com.caucho.config.gen.AbstractAspectGenerator
generate, generateApplicationException, generateAsync, generateBeanConstructor, generateBeanPrologue, generateCall, generateContent, generateDestroy, generateEpilogue, generateFinally, generateInject, generatePostConstruct, generatePostFinally, generatePreDestroy, generatePreTry, generateProxyConstructor, generateSystemException, getAnnotation, getAnnotation, getAnnotation, getBeanFactory, getBeanType, getFactory, getJavaClass, getJavaMethod, getMethod, getThrowsExceptions, getTypeVariables, isApplicationExceptionThrown, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheGenerator

public CacheGenerator(CacheFactory<X> factory,
                      AnnotatedMethod<? super X> method,
                      AspectGenerator<X> next,
                      CacheResult cache)
Method Detail

generateMethodPrologue

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

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

generatePreCall

public void generatePreCall(JavaWriter out)
                     throws java.io.IOException
Generates the interceptor code after the try-block and before the call.
 retType myMethod(...)
 {
   try {
     [pre-call]
     retValue = super.myMethod(...);
 }
 

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

generatePostCall

public void generatePostCall(JavaWriter out)
                      throws java.io.IOException
Generates the interceptor code after invocation and before the call.
 retType myMethod(...)
 {
   try {
     retValue = super.myMethod(...);
     [post-call]
     return retValue;
   } finally {
     ...
   }
 }
 

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