Codota Logo
ReflectiveAspectJAdvisorFactory
Code IndexAdd Codota to your IDE (free)

How to use
ReflectiveAspectJAdvisorFactory
in
org.springframework.aop.aspectj.annotation

Best Java code snippets using org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory (Showing top 16 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-framework

/**
 * Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.
 * @param beanFactory the ListableBeanFactory to scan
 */
public BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory) {
  this(beanFactory, new ReflectiveAspectJAdvisorFactory(beanFactory));
}
origin: spring-projects/spring-framework

@Override
public List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory aspectInstanceFactory) {
  Class<?> aspectClass = aspectInstanceFactory.getAspectMetadata().getAspectClass();
  String aspectName = aspectInstanceFactory.getAspectMetadata().getAspectName();
  validate(aspectClass);
  // We need to wrap the MetadataAwareAspectInstanceFactory with a decorator
  // so that it will only instantiate once.
  MetadataAwareAspectInstanceFactory lazySingletonAspectInstanceFactory =
      new LazySingletonAspectInstanceFactoryDecorator(aspectInstanceFactory);
  List<Advisor> advisors = new ArrayList<>();
  for (Method method : getAdvisorMethods(aspectClass)) {
    Advisor advisor = getAdvisor(method, lazySingletonAspectInstanceFactory, advisors.size(), aspectName);
    if (advisor != null) {
      advisors.add(advisor);
    }
  }
  // If it's a per target aspect, emit the dummy instantiating aspect.
  if (!advisors.isEmpty() && lazySingletonAspectInstanceFactory.getAspectMetadata().isLazilyInstantiated()) {
    Advisor instantiationAdvisor = new SyntheticInstantiationAdvisor(lazySingletonAspectInstanceFactory);
    advisors.add(0, instantiationAdvisor);
  }
  // Find introduction fields.
  for (Field field : aspectClass.getDeclaredFields()) {
    Advisor advisor = getDeclareParentsAdvisor(field);
    if (advisor != null) {
      advisors.add(advisor);
    }
  }
  return advisors;
}
origin: spring-projects/spring-framework

@Override
@Nullable
public Advisor getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aspectInstanceFactory,
    int declarationOrderInAspect, String aspectName) {
  validate(aspectInstanceFactory.getAspectMetadata().getAspectClass());
  AspectJExpressionPointcut expressionPointcut = getPointcut(
      candidateAdviceMethod, aspectInstanceFactory.getAspectMetadata().getAspectClass());
  if (expressionPointcut == null) {
    return null;
  }
  return new InstantiationModelAwarePointcutAdvisorImpl(expressionPointcut, candidateAdviceMethod,
      this, aspectInstanceFactory, declarationOrderInAspect, aspectName);
}
origin: apache/servicemix-bundles

@Override
public List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory aspectInstanceFactory) {
  Class<?> aspectClass = aspectInstanceFactory.getAspectMetadata().getAspectClass();
  String aspectName = aspectInstanceFactory.getAspectMetadata().getAspectName();
  validate(aspectClass);
  // We need to wrap the MetadataAwareAspectInstanceFactory with a decorator
  // so that it will only instantiate once.
  MetadataAwareAspectInstanceFactory lazySingletonAspectInstanceFactory =
      new LazySingletonAspectInstanceFactoryDecorator(aspectInstanceFactory);
  List<Advisor> advisors = new ArrayList<Advisor>();
  for (Method method : getAdvisorMethods(aspectClass)) {
    Advisor advisor = getAdvisor(method, lazySingletonAspectInstanceFactory, advisors.size(), aspectName);
    if (advisor != null) {
      advisors.add(advisor);
    }
  }
  // If it's a per target aspect, emit the dummy instantiating aspect.
  if (!advisors.isEmpty() && lazySingletonAspectInstanceFactory.getAspectMetadata().isLazilyInstantiated()) {
    Advisor instantiationAdvisor = new SyntheticInstantiationAdvisor(lazySingletonAspectInstanceFactory);
    advisors.add(0, instantiationAdvisor);
  }
  // Find introduction fields.
  for (Field field : aspectClass.getDeclaredFields()) {
    Advisor advisor = getDeclareParentsAdvisor(field);
    if (advisor != null) {
      advisors.add(advisor);
    }
  }
  return advisors;
}
origin: spring-projects/spring-framework

validate(candidateAspectClass);
if (!isAspect(candidateAspectClass)) {
  throw new AopConfigException("Advice must be declared inside an aspect type: " +
      "Offending method '" + candidateAdviceMethod + "' in class [" +
origin: apache/servicemix-bundles

@Override
public Advisor getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aspectInstanceFactory,
    int declarationOrderInAspect, String aspectName) {
  validate(aspectInstanceFactory.getAspectMetadata().getAspectClass());
  AspectJExpressionPointcut expressionPointcut = getPointcut(
      candidateAdviceMethod, aspectInstanceFactory.getAspectMetadata().getAspectClass());
  if (expressionPointcut == null) {
    return null;
  }
  return new InstantiationModelAwarePointcutAdvisorImpl(expressionPointcut, candidateAdviceMethod,
      this, aspectInstanceFactory, declarationOrderInAspect, aspectName);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop

validate(candidateAspectClass);
if (!isAspect(candidateAspectClass)) {
  throw new AopConfigException("Advice must be declared inside an aspect type: " +
      "Offending method '" + candidateAdviceMethod + "' in class [" +
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop

@Override
public List<Advisor> getAdvisors(MetadataAwareAspectInstanceFactory aspectInstanceFactory) {
  Class<?> aspectClass = aspectInstanceFactory.getAspectMetadata().getAspectClass();
  String aspectName = aspectInstanceFactory.getAspectMetadata().getAspectName();
  validate(aspectClass);
  // We need to wrap the MetadataAwareAspectInstanceFactory with a decorator
  // so that it will only instantiate once.
  MetadataAwareAspectInstanceFactory lazySingletonAspectInstanceFactory =
      new LazySingletonAspectInstanceFactoryDecorator(aspectInstanceFactory);
  List<Advisor> advisors = new ArrayList<>();
  for (Method method : getAdvisorMethods(aspectClass)) {
    Advisor advisor = getAdvisor(method, lazySingletonAspectInstanceFactory, advisors.size(), aspectName);
    if (advisor != null) {
      advisors.add(advisor);
    }
  }
  // If it's a per target aspect, emit the dummy instantiating aspect.
  if (!advisors.isEmpty() && lazySingletonAspectInstanceFactory.getAspectMetadata().isLazilyInstantiated()) {
    Advisor instantiationAdvisor = new SyntheticInstantiationAdvisor(lazySingletonAspectInstanceFactory);
    advisors.add(0, instantiationAdvisor);
  }
  // Find introduction fields.
  for (Field field : aspectClass.getDeclaredFields()) {
    Advisor advisor = getDeclareParentsAdvisor(field);
    if (advisor != null) {
      advisors.add(advisor);
    }
  }
  return advisors;
}
origin: spring-projects/spring-framework

@Override
protected AspectJAdvisorFactory getFixture() {
  return new ReflectiveAspectJAdvisorFactory();
}
origin: apache/servicemix-bundles

validate(candidateAspectClass);
if (!isAspect(candidateAspectClass)) {
  throw new AopConfigException("Advice must be declared inside an aspect type: " +
      "Offending method '" + candidateAdviceMethod + "' in class [" +
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop

@Override
@Nullable
public Advisor getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aspectInstanceFactory,
    int declarationOrderInAspect, String aspectName) {
  validate(aspectInstanceFactory.getAspectMetadata().getAspectClass());
  AspectJExpressionPointcut expressionPointcut = getPointcut(
      candidateAdviceMethod, aspectInstanceFactory.getAspectMetadata().getAspectClass());
  if (expressionPointcut == null) {
    return null;
  }
  return new InstantiationModelAwarePointcutAdvisorImpl(expressionPointcut, candidateAdviceMethod,
      this, aspectInstanceFactory, declarationOrderInAspect, aspectName);
}
origin: spring-projects/spring-framework

@Override
protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory) {
  super.initBeanFactory(beanFactory);
  if (this.aspectJAdvisorFactory == null) {
    this.aspectJAdvisorFactory = new ReflectiveAspectJAdvisorFactory(beanFactory);
  }
  this.aspectJAdvisorsBuilder =
      new BeanFactoryAspectJAdvisorsBuilderAdapter(beanFactory, this.aspectJAdvisorFactory);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop

/**
 * Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.
 * @param beanFactory the ListableBeanFactory to scan
 */
public BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory) {
  this(beanFactory, new ReflectiveAspectJAdvisorFactory(beanFactory));
}
origin: apache/servicemix-bundles

/**
 * Create a new BeanFactoryAspectJAdvisorsBuilder for the given BeanFactory.
 * @param beanFactory the ListableBeanFactory to scan
 */
public BeanFactoryAspectJAdvisorsBuilder(ListableBeanFactory beanFactory) {
  this(beanFactory, new ReflectiveAspectJAdvisorFactory(beanFactory));
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop

@Override
protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory) {
  super.initBeanFactory(beanFactory);
  if (this.aspectJAdvisorFactory == null) {
    this.aspectJAdvisorFactory = new ReflectiveAspectJAdvisorFactory(beanFactory);
  }
  this.aspectJAdvisorsBuilder =
      new BeanFactoryAspectJAdvisorsBuilderAdapter(beanFactory, this.aspectJAdvisorFactory);
}
origin: apache/servicemix-bundles

@Override
protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory) {
  super.initBeanFactory(beanFactory);
  if (this.aspectJAdvisorFactory == null) {
    this.aspectJAdvisorFactory = new ReflectiveAspectJAdvisorFactory(beanFactory);
  }
  this.aspectJAdvisorsBuilder =
      new BeanFactoryAspectJAdvisorsBuilderAdapter(beanFactory, this.aspectJAdvisorFactory);
}
org.springframework.aop.aspectj.annotationReflectiveAspectJAdvisorFactory

Javadoc

Factory that can create Spring AOP Advisors given AspectJ classes from classes honoring the AspectJ 5 annotation syntax, using reflection to invoke the corresponding advice methods.

Most used methods

  • <init>
    Create a new ReflectiveAspectJAdvisorFactory, propagating the given BeanFactory to the created Aspec
  • getAdvisor
  • getAdvisorMethods
  • getDeclareParentsAdvisor
    Build a org.springframework.aop.aspectj.DeclareParentsAdvisorfor the given introduction field.Result
  • getPointcut
  • isAspect
  • validate

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now