com.inteligr8.alfresco.annotations.Threaded Maven / Gradle / Ivy
The newest version!
package com.inteligr8.alfresco.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This annotation tells the framework to execute the annotated method inside a
* pool of threads.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Threaded {
/**
* @return A name for the thread pool.
*/
String name() default "";
/**
* @return A number of threads to execute.
*/
int threads() default 1;
/**
* @return A maximum number of threads to execute at any one time; the thread pool size.
*/
int concurrency() default 0;
/**
* @return A Java thread priority for all the threads.
*/
int priority() default Thread.NORM_PRIORITY;
/**
* Whether or not the calling thread should wait for all the threads to complete.
*
* @return `true` to wait; `false` to return immediately.
*/
boolean join() default false;
/**
* How long the calling thread should wait before returning. If a timeout
* is reached, a TimeoutException will be thrown. If this is not desired,
* then `join()` should return `false`.
*
* @return A number of milliseconds to wait; 0 waits indefinitely
*/
long joinWaitMillis() default 0L;
}