org.jboss.aop.advice
Class GeneratedAdvisorInterceptor

java.lang.Object
  extended by org.jboss.aop.advice.GeneratedAdvisorInterceptor
All Implemented Interfaces:
Interceptor

public class GeneratedAdvisorInterceptor
extends Object
implements Interceptor

Special interceptor wrapping the interceptor factory, so that generated advisors have all the information they need about the contained advices for generating the invocation methods. If we are invoked upon dymamically we use vanilla invocations, i.e. the generated invocation code does not step in, so we generate the interceptor class as and when needed in our invoke() method. Old skool class advisors do not use this class

Version:
$Revision: 62366 $
Author:
Kabir Khan

Constructor Summary
GeneratedAdvisorInterceptor(InterceptorFactory factory, GeneratedClassAdvisor advisor, Joinpoint joinpoint)
           
GeneratedAdvisorInterceptor(InterceptorFactory factory, GeneratedClassAdvisor advisor, Joinpoint joinpoint, String cflowString, ASTCFlowExpression cflowExpr)
           
 
Method Summary
 Interceptor create(Advisor advisor, Joinpoint joinpoint)
           
 boolean equals(Object obj)
           
 String getAdviceName()
           
 AspectDefinition getAspect()
           
 Object getAspect(Advisor advisor, Joinpoint joinpoint)
          Used to obtain aspects from the generated code at runtime for joinpoints/aspects requiring an instance advisor
 Object getAspect(Advisor advisor, Joinpoint joinpoint, boolean forCodeGeneration)
          Also used as a convenience method to create aspect instances for the JoinPointGenerator in order to figure out what the class of the aspect should be when making the call from the generated joinpoint class.
 String getAspectClassName()
           
 ASTCFlowExpression getCflowExpression()
           
 String getCFlowString()
           
 InterceptorFactory getDelegate()
           
 String getName()
           
 Object getPerInstanceAspect(Advisor advisor, Joinpoint joinpoint, InstanceAdvisor ia)
          Used to obtain aspects from the generated code at runtime for joinpoints/aspects requiring an instance advisor
 String getRegisteredName()
           
 Scope getScope()
           
 Object invoke(Invocation invocation)
           
 boolean isAfter()
           
 boolean isAround()
           
 boolean isAspectFactory()
           
 boolean isBefore()
           
 boolean isInterceptor()
           
 boolean isThrowing()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratedAdvisorInterceptor

public GeneratedAdvisorInterceptor(InterceptorFactory factory,
                                   GeneratedClassAdvisor advisor,
                                   Joinpoint joinpoint,
                                   String cflowString,
                                   ASTCFlowExpression cflowExpr)

GeneratedAdvisorInterceptor

public GeneratedAdvisorInterceptor(InterceptorFactory factory,
                                   GeneratedClassAdvisor advisor,
                                   Joinpoint joinpoint)
Method Detail

create

public Interceptor create(Advisor advisor,
                          Joinpoint joinpoint)

getAspect

public Object getAspect(Advisor advisor,
                        Joinpoint joinpoint)
Used to obtain aspects from the generated code at runtime for joinpoints/aspects requiring an instance advisor


getAspect

public Object getAspect(Advisor advisor,
                        Joinpoint joinpoint,
                        boolean forCodeGeneration)
Also used as a convenience method to create aspect instances for the JoinPointGenerator in order to figure out what the class of the aspect should be when making the call from the generated joinpoint class. PER_INSTANCE or PER_JOINPOINT (for non-static fields) aspects cannot be created "properly" until at runtime, since that requires access to the instance advisor. If forCodeGeneration is true we create a temporary InstanceAdvisor to avoid NPEs in case we are calling an AspectFactory needing access to the instance advisor


getPerInstanceAspect

public Object getPerInstanceAspect(Advisor advisor,
                                   Joinpoint joinpoint,
                                   InstanceAdvisor ia)
Used to obtain aspects from the generated code at runtime for joinpoints/aspects requiring an instance advisor


isAspectFactory

public boolean isAspectFactory()

getDelegate

public InterceptorFactory getDelegate()

getAspect

public AspectDefinition getAspect()

getName

public String getName()
Specified by:
getName in interface Interceptor

getAspectClassName

public String getAspectClassName()

isBefore

public boolean isBefore()

isAfter

public boolean isAfter()

isThrowing

public boolean isThrowing()

isAround

public boolean isAround()

isInterceptor

public boolean isInterceptor()

getAdviceName

public String getAdviceName()

getScope

public Scope getScope()

getRegisteredName

public String getRegisteredName()

getCflowExpression

public ASTCFlowExpression getCflowExpression()

getCFlowString

public String getCFlowString()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

invoke

public Object invoke(Invocation invocation)
              throws Throwable
Specified by:
invoke in interface Interceptor
Throws:
Throwable


Copyright © 2004 JBoss Inc. All Rights Reserved.