com.caucho.config.gen
Interface AspectGenerator<X>

All Known Implementing Classes:
AbstractAspectGenerator, AsyncHeadGenerator, AsynchronousGenerator, CacheGenerator, CandiMethodHeadGenerator, InterceptorGenerator, LifecycleMethodHeadGenerator, LifecycleMethodTailGenerator, LockGenerator, MessageMethodHeadGenerator, MessageMethodTailGenerator, MessageXaCallChain, MethodHeadGenerator, MethodTailGenerator, NonBusinessMethodGenerator, NullGenerator, SecurityGenerator, SingletonMethodHeadGenerator, StatefulMethodHeadGenerator, StatelessMethodHeadGenerator, StatelessMethodTailGenerator, StatelessScheduledMethodHeadGenerator, StatelessScheduledMethodTailGenerator, XaGenerator

@Module
public interface AspectGenerator<X>

Represents a filter for invoking a method

 [method-prologue]
 MyType foo(args)
 {
   [pre-try]
   try {
     [pre-call]
     value = [call]
     [post-call]
     return value;
   } catch (ApplicationException e) {
     [application-exception]
     throw e;
   } catch (RuntimeException e) {
     [system-exception]
     throw e;
   } finally {
     [finally]
   }
   [post-finally]
 }
 


Method Summary
 void generate(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> prologueMap)
          Top-level generator.
 void generateApplicationException(JavaWriter out, java.lang.Class<?> exn)
          Generates application (checked) exception code for the method.
 void generateAsync(JavaWriter out)
           
 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 static class prologue
 void generateCall(JavaWriter out)
          Generates the method interception code
 void generateDestroy(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
          Generates any destroy lifecycle code.
 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 inject code after the constructor
 void generateMethodPrologue(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
          Generates the static class prologue
 void generatePostCall(JavaWriter out)
          Generates code after the call, before the return.
 void generatePostConstruct(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
          Generates @PostConstruct code
 void generatePostFinally(JavaWriter out)
          Generates finally code for the method
 void generatePreCall(JavaWriter out)
          Generates code before the call, in the try block.
 void generatePreDestroy(JavaWriter out, java.util.HashMap<java.lang.String,java.lang.Object> map)
          Generates @PreDestroy code
 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 generateSystemException(JavaWriter out, java.lang.Class<?> exn)
          Generates system (runtime) exception code for the method.
 AnnotatedMethod<? super X> getMethod()
          Returns the underlying method.
 boolean isApplicationExceptionThrown()
          Returns true if the application exception can be thrown.
 

Method Detail

getMethod

AnnotatedMethod<? super X> getMethod()
Returns the underlying method.


generate

void generate(JavaWriter out,
              java.util.HashMap<java.lang.String,java.lang.Object> prologueMap)
              throws java.io.IOException
Top-level generator.

Throws:
java.io.IOException

generateBeanPrologue

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

Throws:
java.io.IOException

generateBeanConstructor

void generateBeanConstructor(JavaWriter out,
                             java.util.HashMap<java.lang.String,java.lang.Object> map)
                             throws java.io.IOException
Generates initialization in the constructor

Throws:
java.io.IOException

generateProxyConstructor

void generateProxyConstructor(JavaWriter out,
                              java.util.HashMap<java.lang.String,java.lang.Object> map)
                              throws java.io.IOException
Generates initialization in the proxy constructor

Throws:
java.io.IOException

generateInject

void generateInject(JavaWriter out,
                    java.util.HashMap<java.lang.String,java.lang.Object> map)
                    throws java.io.IOException
Generates inject code after the constructor

Throws:
java.io.IOException

generatePostConstruct

void generatePostConstruct(JavaWriter out,
                           java.util.HashMap<java.lang.String,java.lang.Object> map)
                           throws java.io.IOException
Generates @PostConstruct code

Throws:
java.io.IOException

generatePreDestroy

void generatePreDestroy(JavaWriter out,
                        java.util.HashMap<java.lang.String,java.lang.Object> map)
                        throws java.io.IOException
Generates @PreDestroy code

Throws:
java.io.IOException

generateEpilogue

void generateEpilogue(JavaWriter out,
                      java.util.HashMap<java.lang.String,java.lang.Object> map)
                      throws java.io.IOException
Generates epilogue

Throws:
java.io.IOException

generateDestroy

void generateDestroy(JavaWriter out,
                     java.util.HashMap<java.lang.String,java.lang.Object> map)
                     throws java.io.IOException
Generates any destroy lifecycle code.

Throws:
java.io.IOException

generateMethodPrologue

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

Throws:
java.io.IOException

generateAsync

void generateAsync(JavaWriter out)
                   throws java.io.IOException
Throws:
java.io.IOException

generatePreTry

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

Throws:
java.io.IOException

generatePreCall

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

Throws:
java.io.IOException

generateCall

void generateCall(JavaWriter out)
                  throws java.io.IOException
Generates the method interception code

Throws:
java.io.IOException

generatePostCall

void generatePostCall(JavaWriter out)
                      throws java.io.IOException
Generates code after the call, before the return.
 retType myMethod(...)
 {
   try {
     ...
     value = bean.myMethod(...);
     [post-call]
     return value;
   } finally {
     ...
   }
 }
 

Throws:
java.io.IOException

isApplicationExceptionThrown

boolean isApplicationExceptionThrown()
Returns true if the application exception can be thrown.


generateApplicationException

void generateApplicationException(JavaWriter out,
                                  java.lang.Class<?> exn)
                                  throws java.io.IOException
Generates application (checked) exception code for the method.

Throws:
java.io.IOException

generateSystemException

void generateSystemException(JavaWriter out,
                             java.lang.Class<?> exn)
                             throws java.io.IOException
Generates system (runtime) exception code for the method.

Throws:
java.io.IOException

generateFinally

void generateFinally(JavaWriter out)
                     throws java.io.IOException
Generates finally code for the method
 retType myMethod(...)
 {
   try {
     ...
     value = bean.myMethod(...);
     ...
     return value;
   } finally {
     [finally]
   }
 }
 

Throws:
java.io.IOException

generatePostFinally

void generatePostFinally(JavaWriter out)
                         throws java.io.IOException
Generates finally code for the method
 retType myMethod(...)
 {
   try {
     ...
     value = bean.myMethod(...);
     ...
     return value;
   } finally {
     ...
   }
   [post-finally]
 }
 

Throws:
java.io.IOException