public interface Advisor
Spring AOP is based around around advice delivered via method interception, compliant with the AOP Alliance interception API. The Advisor interface allows support for different types of advice, such as before and after advice, which need not be implemented using interception.
Modifier and Type | Field and Description |
---|---|
static Advice |
EMPTY_ADVICE
Common placeholder for an empty
Advice to be returned from
getAdvice() if no proper advice has been configured (yet). |
Modifier and Type | Method and Description |
---|---|
Advice |
getAdvice()
Return the advice part of this aspect.
|
boolean |
isPerInstance()
Return whether this advice is associated with a particular instance
(for example, creating a mixin) or shared with all instances of
the advised class obtained from the same Spring bean factory.
|
static final Advice EMPTY_ADVICE
Advice
to be returned from
getAdvice()
if no proper advice has been configured (yet).Advice getAdvice()
MethodInterceptor
,
BeforeAdvice
,
ThrowsAdvice
,
AfterReturningAdvice
boolean isPerInstance()
Note that this method is not currently used by the framework.
Typical Advisor implementations always return true
.
Use singleton/prototype bean definitions or appropriate programmatic
proxy creation to ensure that Advisors have the correct lifecycle model.