001    package edu.rice.cs.cunit.threadCheck.predicates;
002    
003    import edu.rice.cs.cunit.threadCheck.PredicateLink;
004    
005    import java.lang.annotation.Retention;
006    import java.lang.annotation.RetentionPolicy;
007    import java.lang.annotation.Target;
008    import java.lang.annotation.ElementType;
009    
010    /**
011     * An annotation used to designate methods that are only allowed to be run by the event thread.
012     * @author Mathias Ricken
013     */
014    @Retention(RetentionPolicy.RUNTIME)
015    @Target({ElementType.CONSTRUCTOR,ElementType.METHOD,ElementType.TYPE})
016    
017    @PredicateLink(value = ThreadCheckPredicates.class, method = "checkEventThread")
018    public @interface OnlyEventThread {
019    
020    
021        //
022        // nested interfaces
023        //
024    
025        /**
026         * An annotation used to designate methods that are only allowed to be run by the event thread
027         * after the component has been realized. Before that, any thread is allowed.
028         * @author Mathias Ricken
029         */
030        @Retention(RetentionPolicy.RUNTIME)
031        @Target({ElementType.CONSTRUCTOR,ElementType.METHOD,ElementType.TYPE})
032    
033        @PredicateLink(value = ThreadCheckPredicates.class, method = "checkEventThreadAfterRealized")
034        public @interface AfterRealized {
035        }
036    }