001package ca.cdr.api.fhir.interceptor;
002
003import ca.uhn.fhir.interceptor.api.Interceptor;
004
005import java.lang.annotation.ElementType;
006import java.lang.annotation.Retention;
007import java.lang.annotation.RetentionPolicy;
008import java.lang.annotation.Target;
009
010/**
011 * This annotation should be placed on interceptor methods. The
012 * {@link CdrPointcut value=Pointcut} property determines which event
013 * is actually being invoked. See the Pointcut JavaDoc for information
014 * on available method parameters for a given hook.
015 *
016 * @see Interceptor
017 */
018@Target(ElementType.METHOD)
019@Retention(RetentionPolicy.RUNTIME)
020public @interface CdrHook {
021
022        /**
023         * Provides the specific point where this method should be invoked
024         */
025        CdrPointcut value();
026
027        /**
028         * The order that interceptors should be called in. Lower numbers happen before higher numbers. Default is 0
029         * and allowable values can be positive or negative or 0.
030         * <p>
031         * If no order is specified, or the order is set to <code>0</code> (the default order),
032         * the order specified at the interceptor type level will take precedence.
033         * </p>
034         */
035        int order() default Interceptor.DEFAULT_ORDER;
036}