blob: b6f3f11f9b5176657220f301848e76b2e681ad5c [file] [log] [blame]
<!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>
</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="../../javax/annotation/PostConstruct.html" title="annotation in javax.annotation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../javax/annotation/Priority.html" title="annotation in javax.annotation"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?javax/annotation/PreDestroy.html" target="_top">Frames</a></li>
<li><a href="PreDestroy.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Required&nbsp;|&nbsp;</li>
<li>Optional</li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</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">javax.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 Java 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 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 &#060;METHOD&#062;(InvocationContext)
<p>
Object &#060;METHOD&#062;(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 &#060;METHOD&#062;()
</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="../../javax/annotation/PostConstruct.html" title="annotation in javax.annotation"><code>PostConstruct</code></a>,
<a href="../../javax/annotation/Resource.html" title="annotation in javax.annotation"><code>Resource</code></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="../../javax/annotation/PostConstruct.html" title="annotation in javax.annotation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../javax/annotation/Priority.html" title="annotation in javax.annotation"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?javax/annotation/PreDestroy.html" target="_top">Frames</a></li>
<li><a href="PreDestroy.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Required&nbsp;|&nbsp;</li>
<li>Optional</li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Element</li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>