Package org.aopalliance.aop

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


    }

    @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

  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

      return (Advisor) adviceObject;
    }
    if (!(adviceObject instanceof Advice)) {
      throw new UnknownAdviceTypeException(adviceObject);
    }
    Advice advice = (Advice) adviceObject;
    if (advice instanceof MethodInterceptor) {
      // So well-known it doesn't even need an adapter.
      return new DefaultPointcutAdvisor(advice);
    }
    for (AdvisorAdapter adapter : this.adapters) {
View Full Code Here

    throw new UnknownAdviceTypeException(advice);
  }

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

      }
      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

    @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

      }
      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

    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

      return this.advisor;
    }

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

TOP

Related Classes of org.aopalliance.aop.Advice

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.