Package jodd.proxetta

Source Code of jodd.proxetta.ProxyAspect

// Copyright (c) 2003-2014, Jodd Team (jodd.org). All Rights Reserved.

package jodd.proxetta;

import jodd.proxetta.pointcuts.AllMethodsPointcut;

/**
* Proxy aspect contains advice and pointcut rules for applying advice.
*/
public class ProxyAspect {

  protected final Class<? extends ProxyAdvice> advice;
  protected final ProxyPointcut pointcut;

  /**
   * Creates aspect defined with provided advice and pointcut for all class methods.
   */
  public ProxyAspect(Class<? extends ProxyAdvice> advice) {
    this(advice, new AllMethodsPointcut());
  }

  /**
   * Creates aspect defined with provided advice and pointcut.
   */
  public ProxyAspect(Class<? extends ProxyAdvice> advice, ProxyPointcut pointcut) {
    this.advice = advice;
    this.pointcut = pointcut;
  }

  /**
   * Returns proxy advice class.
   */
  public Class<? extends ProxyAdvice> getAdvice() {
    return advice;
  }

  /**
   * Returns proxy pointcut.
   */
  public ProxyPointcut getPointcut() {
    return pointcut;
  }


  @Override
  public String toString() {
    return "ProxyAspect{" +
        "advice=" + advice.getName() +
        ", pointcut=" + pointcut.getClass().getName() +
        '}';
  }
}
TOP

Related Classes of jodd.proxetta.ProxyAspect

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.