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