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