Examples of Advice


Examples of org.aopalliance.aop.Advice

    throw new UnknownAdviceTypeException(advice);
  }

  public MethodInterceptor[] getInterceptors(Advisor advisor) throws UnknownAdviceTypeException {
    List interceptors = new ArrayList(3);
    Advice advice = advisor.getAdvice();
    if (advice instanceof MethodInterceptor) {
      interceptors.add(advice);
    }
    for (int i = 0; i < this.adapters.size(); i++) {
      AdvisorAdapter adapter = (AdvisorAdapter) this.adapters.get(i);
View Full Code Here

Examples of org.aopalliance.aop.Advice

   */
  public static AspectJPrecedenceInformation getAspectJPrecedenceInformationFor(Advisor anAdvisor) {
    if (anAdvisor instanceof AspectJPrecedenceInformation) {
      return (AspectJPrecedenceInformation) anAdvisor;
    }
    Advice advice = anAdvisor.getAdvice();
    if (advice instanceof AspectJPrecedenceInformation) {
      return (AspectJPrecedenceInformation) advice;
    }
    return null;
  }
View Full Code Here

Examples of org.aopalliance.aop.Advice

      }
      return true;
    }

    private boolean equalsAdviceClasses(Advisor a, Advisor b) {
      Advice aa = a.getAdvice();
      Advice ba = b.getAdvice();
      if (aa == null || ba == null) {
        return (aa == ba);
      }
      return aa.getClass().equals(ba.getClass());
    }
View Full Code Here

Examples of org.aopalliance.aop.Advice

    public int hashCode() {
      int hashCode = 0;
      Advisor[] advisors = this.advised.getAdvisors();
      for (int i = 0; i < advisors.length; i++) {
        Advice advice = advisors[i].getAdvice();
        if (advice != null) {
          hashCode = 13 * hashCode + advice.getClass().hashCode();
        }
      }
      hashCode = 13 * hashCode + (this.advised.isFrozen() ? 1 : 0);
      hashCode = 13 * hashCode + (this.advised.isExposeProxy() ? 1 : 0);
      hashCode = 13 * hashCode + (this.advised.isOptimize() ? 1 : 0);
View Full Code Here

Examples of org.aopalliance.aop.Advice

  }


  public void afterPropertiesSet() {
    Pointcut pointcut = new AnnotationMatchingPointcut(this.validatedAnnotationType, true);
    Advice advice = (this.validator != null ? new MethodValidationInterceptor(this.validator) :
        new MethodValidationInterceptor());
    this.advisor = new DefaultPointcutAdvisor(pointcut, advice);
  }
View Full Code Here

Examples of org.aopalliance.aop.Advice

      }
      return true;
    }

    private boolean equalsAdviceClasses(Advisor a, Advisor b) {
      Advice aa = a.getAdvice();
      Advice ba = b.getAdvice();
      if (aa == null || ba == null) {
        return (aa == ba);
      }
      return aa.getClass().equals(ba.getClass());
    }
View Full Code Here

Examples of org.aopalliance.aop.Advice

    @Override
    public int hashCode() {
      int hashCode = 0;
      Advisor[] advisors = this.advised.getAdvisors();
      for (Advisor advisor : advisors) {
        Advice advice = advisor.getAdvice();
        if (advice != null) {
          hashCode = 13 * hashCode + advice.getClass().hashCode();
        }
      }
      hashCode = 13 * hashCode + (this.advised.isFrozen() ? 1 : 0);
      hashCode = 13 * hashCode + (this.advised.isExposeProxy() ? 1 : 0);
      hashCode = 13 * hashCode + (this.advised.isOptimize() ? 1 : 0);
View Full Code Here

Examples of org.aopalliance.aop.Advice

    this.validator = validatorFactory.getValidator();
  }

  public void afterPropertiesSet() {
    Pointcut pointcut = new AnnotationMatchingPointcut(this.validatedAnnotationType, true);
    Advice advice = (this.validator != null ? new MethodValidationInterceptor(this.validator) :
        new MethodValidationInterceptor());
    this.advisor = new DefaultPointcutAdvisor(pointcut, advice);
  }
View Full Code Here

Examples of org.aopalliance.aop.Advice

    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      Advice advice = this.advisor.getAdvice();
      sb.append(ClassUtils.getShortName(advice.getClass()));
      sb.append(": ");
      if (this.advisor instanceof Ordered) {
        sb.append("order ").append(((Ordered) this.advisor).getOrder()).append(", ");
      }
      if (advice instanceof AbstractAspectJAdvice) {
View Full Code Here

Examples of org.aopalliance.aop.Advice

  public int getOrder() {
    if (this.order != null) {
      return this.order;
    }
    Advice advice = getAdvice();
    if (advice instanceof Ordered) {
      return ((Ordered) advice).getOrder();
    }
    return Ordered.LOWEST_PRECEDENCE;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.