001package io.avaje.inject.aop;
002
003import java.lang.annotation.ElementType;
004import java.lang.annotation.Retention;
005import java.lang.annotation.RetentionPolicy;
006import java.lang.annotation.Target;
007
008/**
009 * Meta annotation used to define an Aspect.
010 * <p>
011 * Create an annotation and annotate with {@code @Aspect} to define an aspect annotation. The
012 * {@link Aspect#target()} specifies the associated type that implements {@link AspectProvider}.
013 * The aspect provider should be a {@code @Singleton} such that registers with <em>avaje-inject</em>.
014 * <p>
015 */
016@Target(ElementType.ANNOTATION_TYPE)
017@Retention(RetentionPolicy.RUNTIME)
018public @interface Aspect {
019
020  /**
021   * Deprecated - the target() attribute is no longer required and should be removed.
022   */
023  @Deprecated
024  Class<?> target() default Void.class;
025
026  /**
027   * Specify the priority ordering when multiple aspects are on a method.
028   * <p>
029   * When multiple aspects are on a method they are nested. The highest
030   * ordering value will be the outer-most aspect, the lowest ordering will
031   * be the inner-most aspect.
032   * <p>
033   * The outer-most aspect will have it's <em>before</em> executed first,
034   * followed by the <em>before</em> of the inner nested aspects ultimately
035   * down the invocation of the target method.
036   * <p>
037   * The reverse ordering occurs for <em>after</em> with the outer-most aspect
038   * having it's <em>after</em> executed last.
039   *
040   * @return The ordering of this aspect. High value for outer-most aspect.
041   */
042  int ordering() default 1000;
043
044}