001/* 002 * Trident - A Multithreaded Server Alternative 003 * Copyright 2014 The TridentSDK Team 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package net.tridentsdk.docs; 018 019import java.lang.annotation.Documented; 020 021/** 022 * Use to document usage of esoteric or difficult/subtle to understand portions of code 023 * 024 * @author The TridentSDK Team 025 */ 026@Documented 027public @interface Policy { 028 /** 029 * The policy of which to abide by when using the particular member 030 * 031 * @return the policy 032 */ 033 String value(); 034 035 /** 036 * Denotes a volatile array whose elements should not be mutated singularly 037 * 038 * <p>Possible solutions include: 039 * <ul> 040 * <li>Use an {@link java.util.concurrent.atomic.AtomicReferenceArray} instead</li> 041 * <li>Modify the array as a whole instead of the single element</li> 042 * <li>Contact the concurrency supervisor</li> 043 * </ul></p> 044 * 045 * <p>Justification: Volatile arrays entail a volatile reference to the whole memory block; 046 * not each individual element. Mutations of a point along the block is a violation of object consistency</p> 047 */ 048 String VOLATILE_ARRAY = ""; 049}