org.jboss.aop.advice
Class AdviceFactory

java.lang.Object
  extended by org.jboss.aop.advice.AdviceFactory
All Implemented Interfaces:
InterceptorFactory

public class AdviceFactory
extends Object
implements InterceptorFactory

Comment

Version:
$Revision: 71763 $
Author:
Bill Burke

Constructor Summary
AdviceFactory(AspectDefinition aspect, String adviceName)
          Creates a factory that generates advice interceptors.
AdviceFactory(AspectDefinition aspect, String adviceName, AdviceType type)
          Creates a factory that generates advice interceptors.
 
Method Summary
 Interceptor create(Advisor advisor, Joinpoint joinpoint)
          Creates an interceptor that represents this advice and that delegates execution to this advice.
 boolean equals(Object obj)
           
 String getAdvice()
          Returns the name of the advice method.
 AspectDefinition getAspect()
          Returns the definition of the aspect that contains this advice method.
 String getName()
          Returns the name that identifies this interceptor/advice.
 AdviceType getType()
          Returns the type of the advice.
 boolean isDeployed()
          Indicates whether this interceptor/advice is deployed.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdviceFactory

public AdviceFactory(AspectDefinition aspect,
                     String adviceName)
Creates a factory that generates advice interceptors. Use this constructor if you want to record an advice of the (@link default type.

Parameters:
aspect - definition of the aspect that contains the advice method
adviceName - name of the advice method

AdviceFactory

public AdviceFactory(AspectDefinition aspect,
                     String adviceName,
                     AdviceType type)
Creates a factory that generates advice interceptors. Use this constructor if you want specify the advice type.

Parameters:
aspect - definition of the aspect that contains the advice method
adviceName - name of the advice method
type - the type of the advice
Method Detail

getAspect

public AspectDefinition getAspect()
Returns the definition of the aspect that contains this advice method.

Specified by:
getAspect in interface InterceptorFactory

getAdvice

public String getAdvice()
Returns the name of the advice method.

Specified by:
getAdvice in interface InterceptorFactory

getType

public AdviceType getType()
Returns the type of the advice.

Specified by:
getType in interface InterceptorFactory

isDeployed

public boolean isDeployed()
Description copied from interface: InterceptorFactory
Indicates whether this interceptor/advice is deployed.

Specified by:
isDeployed in interface InterceptorFactory

create

public Interceptor create(Advisor advisor,
                          Joinpoint joinpoint)
Description copied from interface: InterceptorFactory
Creates an interceptor that represents this advice and that delegates execution to this advice.

Specified by:
create in interface InterceptorFactory
Parameters:
advisor - advisor, indicates an instance or class where the interception will occur
joinpoint - the joinpoint that will be intercepted
Returns:
an interceptor. Notice this can be an instance of the aspect class itself, if this class is an interceptor.

getName

public String getName()
Description copied from interface: InterceptorFactory
Returns the name that identifies this interceptor/advice.

Specified by:
getName in interface InterceptorFactory
Returns:

equals

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


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