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

java.lang.Object
  extended by com.caucho.config.gen.AbstractAspectGenerator<X>
      extended by com.caucho.config.gen.XaGenerator<X>
All Implemented Interfaces:
AspectGenerator<X>
Direct Known Subclasses:
MessageXaCallChain

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

Represents the XA interception


Constructor Summary
XaGenerator(XaFactory<X> factory, AnnotatedMethod<? super X> method, AspectGenerator<X> next, TransactionAttributeType xa, boolean isBeanManaged)
           
 
Method Summary
 void generateApplicationException(JavaWriter out, java.lang.Class<?> exception)
          Generates aspect code for an application exception
 void generateFinally(JavaWriter out)
          Generates the aspect code in the finally block.
 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.
 void generatePreTry(JavaWriter out)
          Generates code before the "try" block
 void generateSystemException(JavaWriter out, java.lang.Class<?> exn)
          Generates system (runtime) exception code for the method.
 TransactionAttributeType getTransactionType()
          Returns the transaction type
 
Methods inherited from class com.caucho.config.gen.AbstractAspectGenerator
generate, generateAsync, generateBeanConstructor, generateBeanPrologue, generateCall, generateContent, generateDestroy, generateEpilogue, generateInject, generatePostConstruct, generatePostFinally, generatePreDestroy, generateProxyConstructor, 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

XaGenerator

public XaGenerator(XaFactory<X> factory,
                   AnnotatedMethod<? super X> method,
                   AspectGenerator<X> next,
                   TransactionAttributeType xa,
                   boolean isBeanManaged)
Method Detail

getTransactionType

public TransactionAttributeType getTransactionType()
Returns the transaction type


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

generatePreTry

public void generatePreTry(JavaWriter out)
                    throws java.io.IOException
Generates code before the "try" block
 retType myMethod(...)
 {
   [pre-try]
   try {
     ...
 }
 

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
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

generateApplicationException

public void generateApplicationException(JavaWriter out,
                                         java.lang.Class<?> exception)
                                  throws java.io.IOException
Generates aspect code for an application exception

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

generateSystemException

public void generateSystemException(JavaWriter out,
                                    java.lang.Class<?> exn)
                             throws java.io.IOException
Description copied from class: AbstractAspectGenerator
Generates system (runtime) exception code for the method.

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

generateFinally

public void generateFinally(JavaWriter out)
                     throws java.io.IOException
Generates the aspect code in the finally block.
 retType myMethod(...)
 {
   try {
     ...
   } finally {
     [finally]
   }
 }
 

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