| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <title>PostConstruct</title> |
| <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../script.js"></script> |
| |
| <link rel="shortcut icon" href="/img/jakarta-favicon.ico"> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="PostConstruct"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../index-all.html">Index</a></li> |
| <li><a href="../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../jakarta/annotation/Nullable.html" title="annotation in jakarta.annotation"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../jakarta/annotation/PreDestroy.html" title="annotation in jakarta.annotation"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../index.html?jakarta/annotation/PostConstruct.html" target="_top">Frames</a></li> |
| <li><a href="PostConstruct.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Field | </li> |
| <li>Required | </li> |
| <li>Optional</li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Element</li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">jakarta.annotation</div> |
| <h2 title="Annotation Type PostConstruct" class="title">Annotation Type PostConstruct</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>@Documented |
| @Retention(value=RUNTIME) |
| @Target(value=METHOD) |
| public @interface <span class="memberNameLabel">PostConstruct</span></pre> |
| <div class="block">The <code>PostConstruct</code> annotation is used on a method that |
| needs to be executed after dependency injection is done to perform |
| any initialization. This method must be invoked before the class |
| is put into service. This annotation must be supported on all classes |
| that support dependency injection. The method annotated with |
| <code>PostConstruct</code> must be invoked even if the class does |
| not request any resources to be injected. Only one |
| method in a given class can be annotated with this annotation. |
| The method on which the <code>PostConstruct</code> annotation is |
| applied must fulfill all of the following criteria: |
| <ul> |
| <li>The method must not have any parameters except in the case of |
| interceptors in which case it takes an <code>InvocationContext</code> |
| object as defined by the Jakarta Interceptors specification.</li> |
| <li>The method defined on an interceptor class or superclass of an |
| interceptor class must have one of the following signatures: |
| <p> |
| void <METHOD>(InvocationContext) |
| <p> |
| Object <METHOD>(InvocationContext) throws Exception |
| <p> |
| <i>Note: A PostConstruct interceptor method must not throw application |
| exceptions, but it may be declared to throw checked exceptions including |
| the java.lang.Exception if the same interceptor method interposes on |
| business or timeout methods in addition to lifecycle events. If a |
| PostConstruct interceptor method returns a value, it is ignored by |
| the container.</i> |
| </li> |
| <li>The method defined on a non-interceptor class must have the |
| following signature: |
| <p> |
| void <METHOD>() |
| </li> |
| <li>The method on which the <code>PostConstruct</code> annotation |
| is applied may be public, protected, package private or private.</li> |
| <li>The method must not be static except for the application client.</li> |
| <li>The method should not be final.</li> |
| <li>If the method throws an unchecked exception the class must not be put into |
| service except in the case where the exception is handled by an |
| interceptor.</li></ul></div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.6, Common Annotations 1.0</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../jakarta/annotation/PreDestroy.html" title="annotation in jakarta.annotation"><code>PreDestroy</code></a>, |
| <a href="../../jakarta/annotation/Resource.html" title="annotation in jakarta.annotation"><code>Resource</code></a></dd> |
| <dt><span class="simpleTagLabel">Examples (en):</span></dt> |
| <dd><a href="../../../../../tomee-9.0/examples/xa-datasource.html">xa-datasource</a>, <a href="../../../../../tomee-9.0/examples/tomee-jersey-eclipselink.html">tomee-jersey-eclipselink</a>, <a href="../../../../../tomee-9.0/examples/singleton-startup-ordering.html">singleton-startup-ordering</a>, <a href="../../../../../tomee-9.0/examples/simple-stateless-callbacks.html">simple-stateless-callbacks</a>, <a href="../../../../../tomee-9.0/examples/simple-stateful-callbacks.html">simple-stateful-callbacks</a>, <a href="../../../../../tomee-9.0/examples/simple-singleton.html">simple-singleton</a>, <a href="../../../../../tomee-9.0/examples/serverless-tomee-webprofile.html">serverless-tomee-webprofile</a>, <a href="../../../../../tomee-9.0/examples/serverless-tomee-plus.html">serverless-tomee-plus</a>, <a href="../../../../../tomee-9.0/examples/serverless-tomee-plume.html">serverless-tomee-plume</a>, <a href="../../../../../tomee-9.0/examples/serverless-tomee-microprofile.html">serverless-tomee-microprofile</a>, <a href="../../../../../tomee-9.0/examples/serverless-builder.html">serverless-builder</a>, <a href="../../../../../tomee-9.0/examples/security-tomcat-user-identitystore.html">security-tomcat-user-identitystore</a>, <a href="../../../../../tomee-9.0/examples/schedule-expression.html">schedule-expression</a>, <a href="../../../../../tomee-9.0/examples/rest-example.html">rest-example</a>, <a href="../../../../../tomee-9.0/examples/resources-jmx-example.html">resources-jmx-example</a>, <a href="../../../../../tomee-9.0/examples/myfaces-codi-demo.html">myfaces-codi-demo</a>, <a href="../../../../../tomee-9.0/examples/mp-rest-jwt.html">mp-rest-jwt</a>, <a href="../../../../../tomee-9.0/examples/mp-rest-jwt-principal.html">mp-rest-jwt-principal</a>, <a href="../../../../../tomee-9.0/examples/mp-rest-jwt-jwk.html">mp-rest-jwt-jwk</a>, <a href="../../../../../tomee-9.0/examples/mp-rest-client.html">mp-rest-client</a>, <a href="../../../../../tomee-9.0/examples/interceptors.html">interceptors</a>, <a href="../../../../../tomee-9.0/examples/injection-of-datasource.html">injection-of-datasource</a>, <a href="../../../../../tomee-9.0/examples/dynamic-datasource-routing.html">dynamic-datasource-routing</a>, <a href="../../../../../tomee-9.0/examples/deltaspike-fullstack.html">deltaspike-fullstack</a>, <a href="../../../../../tomee-9.0/examples/cdi-session-scope.html">cdi-session-scope</a>, <a href="../../../../../tomee-9.0/examples/cdi-request-scope.html">cdi-request-scope</a>, <a href="../../../../../tomee-9.0/examples/cdi-dynamic-inject.html">cdi-dynamic-inject</a>, <a href="../../../../../tomee-9.0/examples/cdi-basic.html">cdi-basic</a>, <a href="../../../../../tomee-9.0/examples/cdi-application-scope.html">cdi-application-scope</a>, <a href="../../../../../tomee-9.0/examples/async-postconstruct.html">async-postconstruct</a></dd> |
| <dt><span class="simpleTagLabel">Examples (es):</span></dt> |
| <dd><a href="../../../../../tomee-9.0/es/examples/xa-datasource.html">xa-datasource</a>, <a href="../../../../../tomee-9.0/es/examples/simple-singleton.html">simple-singleton</a>, <a href="../../../../../tomee-9.0/es/examples/myfaces-codi-demo.html">myfaces-codi-demo</a>, <a href="../../../../../tomee-9.0/es/examples/mp-rest-jwt.html">mp-rest-jwt</a>, <a href="../../../../../tomee-9.0/es/examples/mp-rest-client.html">mp-rest-client</a>, <a href="../../../../../tomee-9.0/es/examples/cdi-application-scope.html">cdi-application-scope</a></dd> |
| <dt><span class="simpleTagLabel">Examples (pt):</span></dt> |
| <dd><a href="../../../../../tomee-9.0/pt/examples/xa-datasource.html">xa-datasource</a>, <a href="../../../../../tomee-9.0/pt/examples/tomee-jersey-eclipselink.html">tomee-jersey-eclipselink</a>, <a href="../../../../../tomee-9.0/pt/examples/singleton-startup-ordering.html">singleton-startup-ordering</a>, <a href="../../../../../tomee-9.0/pt/examples/simple-singleton.html">simple-singleton</a>, <a href="../../../../../tomee-9.0/pt/examples/serverless-tomee-webprofile.html">serverless-tomee-webprofile</a>, <a href="../../../../../tomee-9.0/pt/examples/serverless-tomee-plus.html">serverless-tomee-plus</a>, <a href="../../../../../tomee-9.0/pt/examples/serverless-tomee-plume.html">serverless-tomee-plume</a>, <a href="../../../../../tomee-9.0/pt/examples/serverless-tomee-microprofile.html">serverless-tomee-microprofile</a>, <a href="../../../../../tomee-9.0/pt/examples/serverless-builder.html">serverless-builder</a>, <a href="../../../../../tomee-9.0/pt/examples/schedule-expression.html">schedule-expression</a>, <a href="../../../../../tomee-9.0/pt/examples/resources-jmx-example.html">resources-jmx-example</a>, <a href="../../../../../tomee-9.0/pt/examples/myfaces-codi-demo.html">myfaces-codi-demo</a>, <a href="../../../../../tomee-9.0/pt/examples/mp-rest-jwt.html">mp-rest-jwt</a>, <a href="../../../../../tomee-9.0/pt/examples/mp-rest-jwt-principal.html">mp-rest-jwt-principal</a>, <a href="../../../../../tomee-9.0/pt/examples/mp-rest-jwt-jwk.html">mp-rest-jwt-jwk</a>, <a href="../../../../../tomee-9.0/pt/examples/mp-rest-client.html">mp-rest-client</a>, <a href="../../../../../tomee-9.0/pt/examples/dynamic-datasource-routing.html">dynamic-datasource-routing</a>, <a href="../../../../../tomee-9.0/pt/examples/deltaspike-fullstack.html">deltaspike-fullstack</a>, <a href="../../../../../tomee-9.0/pt/examples/cdi-session-scope.html">cdi-session-scope</a>, <a href="../../../../../tomee-9.0/pt/examples/cdi-request-scope.html">cdi-request-scope</a>, <a href="../../../../../tomee-9.0/pt/examples/cdi-dynamic-inject.html">cdi-dynamic-inject</a>, <a href="../../../../../tomee-9.0/pt/examples/cdi-basic.html">cdi-basic</a>, <a href="../../../../../tomee-9.0/pt/examples/cdi-application-scope.html">cdi-application-scope</a>, <a href="../../../../../tomee-9.0/pt/examples/async-postconstruct.html">async-postconstruct</a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../index-all.html">Index</a></li> |
| <li><a href="../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../jakarta/annotation/Nullable.html" title="annotation in jakarta.annotation"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../jakarta/annotation/PreDestroy.html" title="annotation in jakarta.annotation"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../index.html?jakarta/annotation/PostConstruct.html" target="_top">Frames</a></li> |
| <li><a href="PostConstruct.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Field | </li> |
| <li>Required | </li> |
| <li>Optional</li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Element</li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |