blob: b06ef7fd53956a148c97e514b158a339f301f88d [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>ManagedScheduledExecutorDefinition</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="ManagedScheduledExecutorDefinition";
}
}
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/enterprise/concurrent/ManagedExecutorService.html" title="interface in jakarta.enterprise.concurrent"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../jakarta/enterprise/concurrent/ManagedScheduledExecutorDefinition.List.html" title="annotation in jakarta.enterprise.concurrent"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?jakarta/enterprise/concurrent/ManagedScheduledExecutorDefinition.html" target="_top">Frames</a></li>
<li><a href="ManagedScheduledExecutorDefinition.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><a href="#annotation.type.required.element.summary">Required</a>&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.element.detail">Element</a></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.enterprise.concurrent</div>
<h2 title="Annotation Type ManagedScheduledExecutorDefinition" class="title">Annotation Type ManagedScheduledExecutorDefinition</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>@Repeatable(value=<a href="../../../jakarta/enterprise/concurrent/ManagedScheduledExecutorDefinition.List.html" title="annotation in jakarta.enterprise.concurrent">ManagedScheduledExecutorDefinition.List.class</a>)
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface <span class="memberNameLabel">ManagedScheduledExecutorDefinition</span></pre>
<div class="block"><p>Defines a <a href="../../../jakarta/enterprise/concurrent/ManagedScheduledExecutorService.html" title="interface in jakarta.enterprise.concurrent"><code>ManagedScheduledExecutorService</code></a>
to be registered in JNDI by the container
under the JNDI name that is specified in the
<a href="../../../jakarta/enterprise/concurrent/ManagedScheduledExecutorDefinition.html#name--"><code>name()</code></a> attribute.</p>
<p>Application components can refer to this JNDI name in the
<a href="../../../jakarta/annotation/Resource.html#lookup--"><code>lookup</code></a> attribute of a
<a href="../../../jakarta/annotation/Resource.html" title="annotation in jakarta.annotation"><code>Resource</code></a> annotation,</p>
<pre>
@ManagedScheduledExecutorDefinition(
name = "java:comp/concurrent/MyScheduledExecutor",
context = "java:comp/concurrent/MyScheduledExecutorContext",
hungTaskThreshold = 30000,
maxAsync = 3)
@ContextServiceDefinition(
name = "java:comp/concurrent/MyScheduledExecutorContext",
propagated = APPLICATION)
public class MyServlet extends HttpServlet {
@Resource(lookup = "java:comp/concurrent/MyScheduledExecutor",
name = "java:comp/concurrent/env/MyScheduledExecutorRef")
ManagedScheduledExecutorService myScheduledExecutor;
</pre>
<p>Resource environment references in a deployment descriptor
can similarly specify the <code>lookup-name</code>,</p>
<pre>
&lt;resource-env-ref&gt;
&lt;resource-env-ref-name&gt;java:comp/env/concurrent/MyScheduledExecutorRef&lt;/resource-env-ref-name&gt;
&lt;resource-env-ref-type&gt;jakarta.enterprise.concurrent.ManagedScheduledExecutorService&lt;/resource-env-ref-type&gt;
&lt;lookup-name&gt;java:comp/concurrent/MyScheduledExecutor&lt;/lookup-name&gt;
&lt;/resource-env-ref&gt;
</pre>
You can also define a <code>ManagedScheduledExecutorService</code> with the
<code>&lt;managed-scheduled-executor&gt;</code> deployment descriptor element.
For example,
<pre>
&lt;managed-scheduled-executor&gt;
&lt;name&gt;java:module/concurrent/MyExecutor&lt;/name&gt;
&lt;context-service-ref&gt;java:module/concurrent/MyExecutorContext&lt;/context-service-ref&gt;
&lt;hung-task-threshold&gt;120000&lt;/hung-task-threshold&gt;
&lt;max-async&gt;5&lt;/max-async&gt;
&lt;/managed-scheduled-executor&gt;
</pre>
If a <code>managed-scheduled-executor</code> and <code>ManagedScheduledExecutorDefinition</code>
have the same name, their attributes are merged to define a single
<code>ManagedScheduledExecutorService</code> definition, with each attribute that is specified
in the <code>managed-scheduled-executor</code> deployment descriptor entry taking
precedence over the corresponding attribute of the annotation.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>3.0</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation.type.required.element.summary">
<!-- -->
</a>
<h3>Required Element Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Required Element Summary table, listing required elements, and an explanation">
<caption><span>Required Elements</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Required Element and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../jakarta/enterprise/concurrent/ManagedScheduledExecutorDefinition.html#name--">name</a></span></code>
<div class="block">JNDI name of the <a href="../../../jakarta/enterprise/concurrent/ManagedScheduledExecutorService.html" title="interface in jakarta.enterprise.concurrent"><code>ManagedScheduledExecutorService</code></a> instance.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation.type.optional.element.summary">
<!-- -->
</a>
<h3>Optional Element Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation">
<caption><span>Optional Elements</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Optional Element and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../jakarta/enterprise/concurrent/ManagedScheduledExecutorDefinition.html#context--">context</a></span></code>
<div class="block">The name of a <a href="../../../jakarta/enterprise/concurrent/ContextService.html" title="interface in jakarta.enterprise.concurrent"><code>ContextService</code></a> instance which
determines how context is applied to tasks and actions that
run on this executor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../jakarta/enterprise/concurrent/ManagedScheduledExecutorDefinition.html#hungTaskThreshold--">hungTaskThreshold</a></span></code>
<div class="block">The amount of time in milliseconds that a task or action
can execute before it is considered hung.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../jakarta/enterprise/concurrent/ManagedScheduledExecutorDefinition.html#maxAsync--">maxAsync</a></span></code>
<div class="block">Upper bound on contextual tasks and actions that this executor
will simultaneously execute asynchronously.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation.type.element.detail">
<!-- -->
</a>
<h3>Element Detail</h3>
<a name="name--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>name</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;name</pre>
<div class="block">JNDI name of the <a href="../../../jakarta/enterprise/concurrent/ManagedScheduledExecutorService.html" title="interface in jakarta.enterprise.concurrent"><code>ManagedScheduledExecutorService</code></a> instance.
The JNDI name must be in a valid Jakarta EE namespace,
such as,
<ul>
<li>java:comp</li>
<li>java:module</li>
<li>java:app</li>
<li>java:global</li>
</ul></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>ManagedScheduledExecutorService</code> JNDI name.</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="context--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>context</h4>
<pre>public abstract&nbsp;java.lang.String&nbsp;context</pre>
<div class="block">The name of a <a href="../../../jakarta/enterprise/concurrent/ContextService.html" title="interface in jakarta.enterprise.concurrent"><code>ContextService</code></a> instance which
determines how context is applied to tasks and actions that
run on this executor.
<p>
The name can be the name of a <a href="../../../jakarta/enterprise/concurrent/ContextServiceDefinition.html" title="annotation in jakarta.enterprise.concurrent"><code>ContextServiceDefinition</code></a> or
the name of a <code>context-service</code> deployment descriptor element
or the JNDI name of the Jakarta EE default <code>ContextService</code>
instance, <code>java:comp/DefaultContextService</code>.
<p>
The name of the <code>ContextService</code> must be no more granular
than the name of this <code>ManagedScheduledExecutorDefinition</code>. For example,
if this <code>ManagedScheduledExecutorDefinition</code> has a name in <code>java:app</code>,
the <code>ContextService</code> can be in <code>java:app</code> or <code>java:global</code>,
but not in <code>java:module</code> which would be ambiguous as to which
module's <code>ContextService</code> definition should be used.
<p>
The default value, <code>java:comp/DefaultContextService</code>, is the
JNDI name of the Jakarta EE default <code>ContextService</code>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>name of the <code>ContextService</code> for
capturing and propagating or clearing context.</dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>"java:comp/DefaultContextService"</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="hungTaskThreshold--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hungTaskThreshold</h4>
<pre>public abstract&nbsp;long&nbsp;hungTaskThreshold</pre>
<div class="block"><p>The amount of time in milliseconds that a task or action
can execute before it is considered hung.</p>
<p>The default value of <code>-1</code> indicates unlimited.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>number of milliseconds after which a task or action
is considered hung.</dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>-1L</dd>
</dl>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="maxAsync--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>maxAsync</h4>
<pre>public abstract&nbsp;int&nbsp;maxAsync</pre>
<div class="block"><p>Upper bound on contextual tasks and actions that this executor
will simultaneously execute asynchronously. This constraint does
not apply to tasks and actions that the executor runs inline,
such as when a thread requests
<code>CompletableFuture.join()</code> and the
action runs inline if it has not yet started.
This constraint also does not apply to tasks that are scheduled
via the <code>schedule*</code> methods.</p>
<p>The default value of <code>-1</code> indicates unbounded,
although still subject to resource constraints of the system.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>upper limit on asynchronous execution.</dd>
</dl>
<dl>
<dt>Default:</dt>
<dd>-1</dd>
</dl>
</li>
</ul>
</li>
</ul>
</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/enterprise/concurrent/ManagedExecutorService.html" title="interface in jakarta.enterprise.concurrent"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../jakarta/enterprise/concurrent/ManagedScheduledExecutorDefinition.List.html" title="annotation in jakarta.enterprise.concurrent"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?jakarta/enterprise/concurrent/ManagedScheduledExecutorDefinition.html" target="_top">Frames</a></li>
<li><a href="ManagedScheduledExecutorDefinition.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><a href="#annotation.type.required.element.summary">Required</a>&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.optional.element.summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#annotation.type.element.detail">Element</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>