src/share/jaxws_classes/javax/annotation/PostConstruct.java

changeset 408
b0610cd08440
parent 368
0989ad8c0860
child 637
9c07ef4934dd
equal deleted inserted replaced
405:cc682329886b 408:b0610cd08440
36 * annotation MUST be supported on all classes that support dependency 36 * annotation MUST be supported on all classes that support dependency
37 * injection. The method annotated with PostConstruct MUST be invoked even 37 * injection. The method annotated with PostConstruct MUST be invoked even
38 * if the class does not request any resources to be injected. Only one 38 * if the class does not request any resources to be injected. Only one
39 * method can be annotated with this annotation. The method on which the 39 * method can be annotated with this annotation. The method on which the
40 * PostConstruct annotation is applied MUST fulfill all of the following 40 * PostConstruct annotation is applied MUST fulfill all of the following
41 * criteria:<ul> 41 * criteria:
42 * <li>The method MUST NOT have any parameters except in the case of EJB 42 * <p>
43 * <ul>
44 * <li>The method MUST NOT have any parameters except in the case of
43 * interceptors in which case it takes an InvocationContext object as 45 * interceptors in which case it takes an InvocationContext object as
44 * defined by the EJB specification.</li> 46 * defined by the Interceptors specification.</li>
45 * <li>The return type of the method MUST be void.</li> 47 * <li>The method defined on an interceptor class MUST HAVE one of the
46 * <li>The method MUST NOT throw a checked exception.</li> 48 * following signatures:
49 * <p>
50 * void &#060;METHOD&#062;(InvocationContext)
51 * <p>
52 * Object &#060;METHOD&#062;(InvocationContext) throws Exception
53 * <p>
54 * <i>Note: A PostConstruct interceptor method must not throw application
55 * exceptions, but it may be declared to throw checked exceptions including
56 * the java.lang.Exception if the same interceptor method interposes on
57 * business or timeout methods in addition to lifecycle events. If a
58 * PostConstruct interceptor method returns a value, it is ignored by
59 * the container.</i>
60 * </li>
61 * <li>The method defined on a non-interceptor class MUST HAVE the
62 * following signature:
63 * <p>
64 * void &#060;METHOD&#062;()
65 * </li>
47 * <li>The method on which PostConstruct is applied MAY be public, protected, 66 * <li>The method on which PostConstruct is applied MAY be public, protected,
48 * package private or private.</li> 67 * package private or private.</li>
49 * <li>The method MUST NOT be static except for the application client.</li> 68 * <li>The method MUST NOT be static except for the application client.</li>
50 * <li>The method MAY be final.</li> 69 * <li>The method MAY be final.</li>
51 * <li>If the method throws an unchecked exception the class MUST NOT be put into 70 * <li>If the method throws an unchecked exception the class MUST NOT be put into

mercurial