Example usage for org.springframework.aop.aspectj.annotation MetadataAwareAspectInstanceFactory getAspectInstance

List of usage examples for org.springframework.aop.aspectj.annotation MetadataAwareAspectInstanceFactory getAspectInstance

Introduction

In this page you can find the example usage for org.springframework.aop.aspectj.annotation MetadataAwareAspectInstanceFactory getAspectInstance.

Prototype

Object getAspectInstance();

Source Link

Document

Create an instance of this factory's aspect.

Usage

From source file:org.jdal.aop.DeclareMixinAspectJAdvisorFactory.java

@Override
public Advisor getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aif,
        int declarationOrderInAspect, String aspectName) {

    Advisor advisor = super.getAdvisor(candidateAdviceMethod, aif, declarationOrderInAspect, aspectName);

    // test declare mixin annotation
    if (advisor == null) {

        DeclareMixin declareMixin = AnnotationUtils.findAnnotation(candidateAdviceMethod, DeclareMixin.class);

        if (declareMixin != null) {
            advisor = new DeclareMixinAdvisor(candidateAdviceMethod, aif.getAspectInstance(),
                    declareMixin.value());
        }//from   w  ww  .  j  a  v  a  2s .c o m
    }

    return advisor;
}