Class PerInstanceAdvice

  extended by org.jboss.aop.advice.AbstractAdvice
      extended by org.jboss.aop.advice.PerInstanceAdvice
All Implemented Interfaces:
Interceptor, Untransformable

public class PerInstanceAdvice
extends AbstractAdvice


$Revision: 73173 $
Bill Burke

Field Summary
Fields inherited from class org.jboss.aop.advice.AbstractAdvice
adviceName, aspectClass, conCalledByConstructorAdvice, conCalledByMethodAdvice, constructionAdvice, constructorAdvice, fieldAdvice, fieldReadAdvice, fieldWriteAdvice, invocationAdvice, methodAdvice, methodCalledByConstructorAdvice, methodCalledByMethodAdvice
Constructor Summary
PerInstanceAdvice(String adviceName, AspectDefinition a, Advisor advisor)
Method Summary
 Object getAspectInstance()
 Object getAspectInstance(InstanceAdvisor instanceAdvisor)
 String getName()
          Returns the name of this interceptor.
 Object invoke(Invocation invocation)
          The single advice contained in the Interceptor.
Methods inherited from class org.jboss.aop.advice.AbstractAdvice
findByConstructionInvocation, findByConstructorCalledByConstructorInvocation, findByConstructorCalledByMethodInvocation, findByConstructorInvocation, findByFieldInvocation, findByFieldReadInvocation, findByFieldWriteInvocation, findByInvocation, findByMethodCalledByConstructorInvocation, findByMethodCalledByMethodInvocation, findByMethodInvocation, getAdviceName, init, resolveAdvice
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public PerInstanceAdvice(String adviceName,
                         AspectDefinition a,
                         Advisor advisor)
Method Detail


public String getName()
Description copied from interface: Interceptor
Returns the name of this interceptor. This name is unique inside the domain.

name the name that identifies this interceptor in its domain


public Object invoke(Invocation invocation)
              throws Throwable
Description copied from interface: Interceptor
The single advice contained in the Interceptor.
To call the next interceptor or advice in the chain, this method must call invocation.invokeNext() method (if there are not elements left to be called in the chain, this method invokes the joinpoint itself). Not doing so means halting the execution of the interceptor chain and, hence, avoiding the execution of the joinpoint. This should be done only when the interceptor must replace the joinpoint execution.

invocation - represents the joinpoint to be intercepted
the result value. This value will be returned to the previous interceptor/advice as a result of Invocation.invokeNext(). In case this is the first interceptor in the chain, this value will replace the joinpoint return value in the basis system.
Throwable - may throw any exceptions declared by the joinpoint itself. If this exception is not declared and is not a runtime exception, it will be encapsulated in a RuntimeException before being thrown to the basis system.


public Object getAspectInstance()
Specified by:
getAspectInstance in class AbstractAdvice


public Object getAspectInstance(InstanceAdvisor instanceAdvisor)

Copyright © 2008 JBoss, a division of Red Hat, Inc.. All Rights Reserved.