|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Documented
@Target(value={CONSTRUCTOR,METHOD})
public @interface Starts
Declares what threads, if any, are started, i.e., by Thread.start(),
during the execution of the method or constructor to which this annotation is
applied. We refer to this as the thread effects of the method or constructor.
Presently this annotation has only one legal form,
@Starts("nothing"), that indicates that the
method/constructor does not cause any threads to be started. It is a modeling
error if value() is not "nothing".
init that promises to start no threads. Because
init() calls the method internalInit() that method must also
promise to start no threads.
class Example {
@Starts("nothing")
public void init() {
internalInit();
}
@Starts("nothing")
private void internalInit() {
state = new Object();
}
private Object state;
}
@annotate tag.
class Example {
/**
* @annotate Starts("nothing")
*/
public void init() {
internalInit();
}
/**
* @annotate Starts("nothing")
*/
private void internalInit() {
state = new Object();
}
private Object state;
}
| Required Element Summary | |
|---|---|
String |
value
Must be "nothing". |
| Element Detail |
|---|
public abstract String value
"nothing". Additional values are reserved for future use.
The value of this attribute must conform to the following grammar (in Augmented Backus–Naur Form):
value = "nothing"
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||