001    package edu.rice.cs.cunit.threadCheck;
002    
003    import java.lang.annotation.*;
004    
005    /**
006     * Annotation for a class or method signaling that it should not be run by the designated threads.
007     *
008     * The preferred method is using value and an array of @ThreadDesc annotations. This, however,
009     * can be mixed with the other ways of specifying threads, although they may not support more advanced
010     * features. The thread and thread group names are treated as regular expressions. You may not specify
011     * eventThread=true in a @ThreadDesc annotation used in this class.
012     *
013     * @author Mathias Ricken
014     */
015    @Retention(RetentionPolicy.CLASS)
016    @Target({ElementType.CONSTRUCTOR,ElementType.METHOD,ElementType.TYPE})
017    public @interface NotRunBy {
018        /** @return array of thread descriptions. */
019        ThreadDesc[] value() default {};
020    
021        /** @return array of regular expressions for thread names that may not run the annotated class or method. */
022        String[] threadNames() default {};
023    
024        /** @return array of thread ID numbers as returned by Thread.getID(), designating the threads
025          * that may not run the annotated class or method. */
026        long[] threadIds() default {};
027    
028        /** @return array of regular expressions for thread group names that may not run the annotated class or method. */
029        String[] threadGroups() default {};
030    }