001package org.modeshape.common.annotation;
002
003import java.lang.annotation.ElementType;
004import java.lang.annotation.Retention;
005import java.lang.annotation.RetentionPolicy;
006import java.lang.annotation.Target;
007
008/**
009 * Copyright (c) 2005 Brian Goetz and Tim Peierls.<br />
010 * Released under the Creative Commons Attribution License<br />
011 * (http://creativecommons.org/licenses/by/2.5)<br />
012 * Official home: http://www.jcip.net<br />
013 * Adopted from Java Concurrency in Practice.
014 * <p>
015 * An annotation that describes the monitor protecting the annotated field or method. For example, <code>@GuardedBy("this")</code>
016 * specifies that the lock is the object in whose class the field or method is defined, while <code>@GuardedBy("lock")</code>
017 * specifies that the method or field is guarded by a lock held in the "lock" field.
018 * </p>
019 * 
020 * @see ThreadSafe
021 * @see NotThreadSafe
022 * @see Immutable
023 */
024@Target( {ElementType.FIELD, ElementType.METHOD} )
025@Retention( RetentionPolicy.SOURCE )
026public @interface GuardedBy {
027    String value();
028}