001/* 002 * ============================================================================ 003 * Copyright © 2002-2026 by Thomas Thrien. 004 * All Rights Reserved. 005 * ============================================================================ 006 * Licensed to the public under the agreements of the GNU Lesser General Public 007 * License, version 3.0 (the "License"). You may obtain a copy of the License at 008 * 009 * http://www.gnu.org/licenses/lgpl.html 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, WITHOUT 013 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 014 * License for the specific language governing permissions and limitations 015 * under the License. 016 */ 017 018package org.tquadrat.foundation.annotation; 019 020import static java.lang.annotation.ElementType.METHOD; 021import static java.lang.annotation.RetentionPolicy.SOURCE; 022import static org.apiguardian.api.API.Status.STABLE; 023 024import java.lang.annotation.Documented; 025import java.lang.annotation.Retention; 026import java.lang.annotation.Target; 027 028import org.apiguardian.api.API; 029 030/** 031 * <p>{@summary The marker annotation for methods that will be executed inside 032 * a dedicated thread, either as explicit implementations of 033 * {@link Runnable} 034 * or inside a 035 * {@link Runnable#run()} 036 * method.}</p> 037 * <p>This can look like this</p> 038 * <div class="source-container"><pre> 039 * public final class MyClass 040 * { 041 * @ThreadBody 042 * private static final void worker() {…} 043 * 044 * public static final void main( final String... args ) 045 * { 046 * new Thread( MyClass::worker ).start(); 047 * } // main() 048 * } 049 * // class MyClass 050 * </pre></div> 051 * 052 * @extauthor Thomas Thrien - thomas.thrien@tquadrat.org 053 * @version $Id: ThreadBody.java 1259 2026-06-05 20:29:42Z tquadrat $ 054 * @since 0.25.12 055 */ 056@ClassVersion( sourceVersion = "$Id: ThreadBody.java 1259 2026-06-05 20:29:42Z tquadrat $" ) 057@API( status = STABLE, since = "0.25.12" ) 058@Documented 059@Retention( SOURCE ) 060@Target( METHOD ) 061public @interface ThreadBody 062{} 063// @interface ThreadBody 064 065/* 066 * End of File 067 */