| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <title>PreDestroy</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="PreDestroy"; |
| } |
| } |
| 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/PostConstruct.html" title="annotation in jakarta.annotation"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../jakarta/annotation/Priority.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/PreDestroy.html" target="_top">Frames</a></li> |
| <li><a href="PreDestroy.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 PreDestroy" class="title">Annotation Type PreDestroy</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">PreDestroy</span></pre> |
| <div class="block">The <code>PreDestroy</code> annotation is used on a method as a |
| callback notification to signal that the instance is in the |
| process of being removed by the container. The method annotated |
| with <code>PreDestroy</code> is typically used to |
| release resources that it has been holding. This annotation must be |
| supported by all container-managed objects that support the use of |
| the <code>PostConstruct</code> annotation except the Jakarta EE application |
| client. The method on which the <code>PreDestroy</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 PreDestroy 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 |
| PreDestroy 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 PreDestroy is applied may be public, protected, |
| package private or private.</li> |
| <li>The method must not be static.</li> |
| <li>The method should not be final.</li> |
| <li>If the method throws an unchecked exception it is ignored by |
| the container.</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/PostConstruct.html" title="annotation in jakarta.annotation"><code>PostConstruct</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/websocket-jms.html">websocket-jms</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/resources-jmx-example.html">resources-jmx-example</a>, <a href="../../../../../tomee-9.0/examples/javamail-velocity.html">javamail-velocity</a>, <a href="../../../../../tomee-9.0/examples/dynamic-proxy-to-access-mbean.html">dynamic-proxy-to-access-mbean</a></dd> |
| <dt><span class="simpleTagLabel">Examples (es):</span></dt> |
| <dd><a href="../../../../../tomee-9.0/es/examples/simple-singleton.html">simple-singleton</a></dd> |
| <dt><span class="simpleTagLabel">Examples (pt):</span></dt> |
| <dd><a href="../../../../../tomee-9.0/pt/examples/simple-singleton.html">simple-singleton</a>, <a href="../../../../../tomee-9.0/pt/examples/resources-jmx-example.html">resources-jmx-example</a>, <a href="../../../../../tomee-9.0/pt/examples/dynamic-proxy-to-access-mbean.html">dynamic-proxy-to-access-mbean</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/PostConstruct.html" title="annotation in jakarta.annotation"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../jakarta/annotation/Priority.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/PreDestroy.html" target="_top">Frames</a></li> |
| <li><a href="PreDestroy.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> |