001    /**
002     * $Id: GuardedBy.java,v 1.1 2010/01/05 13:26:17 oboehm Exp $
003     *
004     * Copyright (c) 2008 by Oliver Boehm
005     *
006     * Licensed under the Apache License, Version 2.0 (the "License");
007     * you may not use this file except in compliance with the License.
008     * You may obtain a copy of the License at
009     *
010     *   http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     *
018     * (c)reated 16.01.2009 by oliver (ob@oasd.de)
019     */
020    package patterntesting.annotation.concurrent;
021    
022    import java.lang.annotation.*;
023    
024    /**
025     * With this annotation you can document the lock which guards the field or
026     * method. This annotation is only for documentation - there is no aspect
027     * available which uses it.
028     *
029     * @{link "http://www.jcip.net/annotations/doc/net/jcip/annotations/GuardedBy.html"}
030     * @author <a href="boehm@javatux.de">oliver</a>
031     * @since 16.01.2009
032     * @version $Revision: 1.1 $
033     */
034    @Documented
035    @Target({ElementType.FIELD, ElementType.METHOD})
036    @Retention(RetentionPolicy.RUNTIME)
037    public @interface GuardedBy {
038        /** use the object (e.g. "myLock") which guardes the lock */
039        String value() default "this";
040    }
041    
042    /*
043     * $Log: GuardedBy.java,v $
044     * Revision 1.1  2010/01/05 13:26:17  oboehm
045     * begin with 1.0
046     *
047     * Revision 1.4  2009/12/19 22:34:08  oboehm
048     * trailing spaces removed
049     *
050     * Revision 1.3  2009/09/18 13:54:52  oboehm
051     * javadoc warnings fixed
052     *
053     * Revision 1.2  2009/09/11 17:27:24  oboehm
054     * checkstyle errors removed
055     *
056     * Revision 1.1  2009/03/24 08:38:26  oboehm
057     * concurrent package moved to patterntesting-concurrent
058     */