Package org.springframework.aop

Examples of org.springframework.aop.Advisor


        if (this.beanFactory == null) {
          throw new IllegalStateException("No BeanFactory available anymore (probably due to serialization) " +
              "- cannot resolve prototype advisor '" + pa.getBeanName() + "'");
        }
        Object bean = this.beanFactory.getBean(pa.getBeanName());
        Advisor refreshedAdvisor = namedBeanToAdvisor(bean);
        freshAdvisors.add(refreshedAdvisor);
      }
      else {
        // Add the shared instance.
        freshAdvisors.add(advisor);
View Full Code Here


   * bean factory
   */
  private void addAdvisorOnChainCreation(Object next, String name) {
    // We need to convert to an Advisor if necessary so that our source reference
    // matches what we find from superclass interceptors.
    Advisor advisor = namedBeanToAdvisor(next);
    if (logger.isTraceEnabled()) {
      logger.trace("Adding advisor with name '" + name + "'");
    }     
    addAdvisor(advisor);
  }
View Full Code Here

      this.advisor = advisor;
      this.comparator = comparator;
    }

    public int compareTo(Object obj) {
      Advisor otherAdvisor = ((PartiallyComparableAdvisorHolder) obj).advisor;
      return this.comparator.compare(this.advisor, otherAdvisor);
    }
View Full Code Here

      throw new IllegalArgumentException(
          "AspectJPrecedenceComparator can only compare the order of Advisors, " +
          "but was passed [" + o1 + "] and [" + o2 + "]");
    }

    Advisor advisor1 = (Advisor) o1;
    Advisor advisor2 = (Advisor) o2;

    boolean oneOrOtherIsAfterAdvice =
        (AspectJAopUtils.isAfterAdvice(advisor1) || AspectJAopUtils.isAfterAdvice(advisor2));
    boolean oneOrOtherIsBeforeAdvice =
        (AspectJAopUtils.isBeforeAdvice(advisor1) || AspectJAopUtils.isBeforeAdvice(advisor2));
View Full Code Here

  /**
   * Determine whether the Advisors contain matching introductions.
   */
  private static boolean hasMatchingIntroductions(Advised config, Class targetClass) {
    for (int i = 0; i < config.getAdvisors().length; i++) {
      Advisor advisor = config.getAdvisors()[i];
      if (advisor instanceof IntroductionAdvisor) {
        IntroductionAdvisor ia = (IntroductionAdvisor) advisor;
        if (ia.getClassFilter().matches(targetClass)) {
          return true;
        }
View Full Code Here

      Advisor[] thatAdvisors = otherAdvised.getAdvisors();
      if (thisAdvisors.length != thatAdvisors.length) {
        return false;
      }
      for (int i = 0; i < thisAdvisors.length; i++) {
        Advisor thisAdvisor = thisAdvisors[i];
        Advisor thatAdvisor = thatAdvisors[i];
        if (!equalsAdviceClasses(thisAdvisor, thatAdvisor)) {
          return false;
        }
        if (!equalsPointcuts(thisAdvisor, thatAdvisor)) {
          return false;
View Full Code Here

    if (index < 0 || index > this.advisors.size() - 1) {
      throw new AopConfigException("Advisor index " + index + " is out of bounds: " +
          "This configuration only has " + this.advisors.size() + " advisors.");
    }

    Advisor advisor = this.advisors.get(index);
    if (advisor instanceof IntroductionAdvisor) {
      IntroductionAdvisor ia = (IntroductionAdvisor) advisor;
      // We need to remove introduction interfaces.
      for (int j = 0; j < ia.getInterfaces().length; j++) {
        removeInterface(ia.getInterfaces()[j]);
View Full Code Here

  }

  public int indexOf(Advice advice) {
    Assert.notNull(advice, "Advice must not be null");
    for (int i = 0; i < this.advisors.size(); i++) {
      Advisor advisor = this.advisors.get(i);
      if (advisor.getAdvice() == advice) {
        return i;
      }
    }
    return -1;
  }
View Full Code Here

      Advisor[] thatAdvisors = otherAdvised.getAdvisors();
      if (thisAdvisors.length != thatAdvisors.length) {
        return false;
      }
      for (int i = 0; i < thisAdvisors.length; i++) {
        Advisor thisAdvisor = thisAdvisors[i];
        Advisor thatAdvisor = thatAdvisors[i];
        if (!equalsAdviceClasses(thisAdvisor, thatAdvisor)) {
          return false;
        }
        if (!equalsPointcuts(thisAdvisor, thatAdvisor)) {
          return false;
View Full Code Here

        if (this.beanFactory == null) {
          throw new IllegalStateException("No BeanFactory available anymore (probably due to serialization) " +
              "- cannot resolve prototype advisor '" + pa.getBeanName() + "'");
        }
        Object bean = this.beanFactory.getBean(pa.getBeanName());
        Advisor refreshedAdvisor = namedBeanToAdvisor(bean);
        freshAdvisors.add(refreshedAdvisor);
      }
      else {
        // Add the shared instance.
        freshAdvisors.add(advisors[i]);
View Full Code Here

TOP

Related Classes of org.springframework.aop.Advisor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.