blob: 1f598211b5f1560c0600bcce2770ee67b5872f4f [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>WorkManager</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="WorkManager";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</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/resource/spi/work/WorkListener.html" title="interface in jakarta.resource.spi.work"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../jakarta/resource/spi/work/WorkRejectedException.html" title="class in jakarta.resource.spi.work"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?jakarta/resource/spi/work/WorkManager.html" target="_top">Frames</a></li>
<li><a href="WorkManager.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>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</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.resource.spi.work</div>
<h2 title="Interface WorkManager" class="title">Interface WorkManager</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Subinterfaces:</dt>
<dd><a href="../../../../jakarta/resource/spi/work/DistributableWorkManager.html" title="interface in jakarta.resource.spi.work">DistributableWorkManager</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">WorkManager</span></pre>
<div class="block">This interface models a <code>WorkManager</code> which provides a facility
to submit <code>Work</code> instances for execution. This frees the user
from having to create Java&trade; threads directly to do work. Further, this
allows efficient pooling of thread resources and more control over thread
usage.
The various stages in <code>Work</code> processing are:
<ul>
<li> work submit: A <code>Work</code> instance is being submitted for
execution. The <code>Work</code> instance could either be accepted or
rejected with a <code>WorkRejectedException</code> set to an appropriate
error code. </li>
<li> work accepted: The submitted <code>Work</code> instance has been
accepted. The accepted <code>Work</code> instance could either start
execution or could be rejected again with a
<code>WorkRejectedException</code> set to an appropriate error code.
There is no guarantee on when the execution would start unless a start
timeout duration is specified. When a start timeout is specified, the
<code>Work</code> execution must be started within the specified
duration (not a real-time guarantee), failing which a
<code>WorkRejectedException</code> set to an error code
(<code>WorkRejected.TIMED_OUT</code>) is thrown. </li>
<li> work rejected: The <code>Work</code> instance has been rejected.
The <code>Work</code> instance could be rejected during <code>Work</code>
submittal or after the <code>Work</code> instance has been accepted
(but before Work instance starts execution). The rejection could be due
to internal factors or start timeout expiration. A
<code>WorkRejectedException</code> with an appropriate error code
(indicates the reason) is thrown in both cases. </li>
<li> work started: The execution of the <code>Work</code>
instance has started. This means that a thread
has been allocated for its execution. But this
does not guarantee that the allocated thread has been scheduled to run
on a CPU resource. Once execution is started, the allocated thread
sets up an appropriate execution context (transaction , security, etc)
and calls Work.run(). Note, any exception thrown during execution context
setup or Work.run() leads to completion of processing. </li>
<li> work completed: The execution of the <code>Work</code> has been
completed. The execution could complete with or without an exception.
The <code>WorkManager</code> catches any exception thrown during
<code>Work</code> processing (which includes execution context setup),
and wraps it with a <code>WorkCompletedException</code>. </li>
</ul></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/resource/spi/work/WorkManager.html#IMMEDIATE">IMMEDIATE</a></span></code>
<div class="block">A constant to indicate timeout duration.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/resource/spi/work/WorkManager.html#INDEFINITE">INDEFINITE</a></span></code>
<div class="block">A constant to indicate timeout duration.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/resource/spi/work/WorkManager.html#UNKNOWN">UNKNOWN</a></span></code>
<div class="block">A constant to indicate an unknown start delay duration or other unknown
values.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/resource/spi/work/WorkManager.html#doWork-jakarta.resource.spi.work.Work-">doWork</a></span>(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work)</code>
<div class="block">Accepts a <code>Work</code> instance for processing.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/resource/spi/work/WorkManager.html#doWork-jakarta.resource.spi.work.Work-long-jakarta.resource.spi.work.ExecutionContext-jakarta.resource.spi.work.WorkListener-">doWork</a></span>(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work,
long&nbsp;startTimeout,
<a href="../../../../jakarta/resource/spi/work/ExecutionContext.html" title="class in jakarta.resource.spi.work">ExecutionContext</a>&nbsp;execContext,
<a href="../../../../jakarta/resource/spi/work/WorkListener.html" title="interface in jakarta.resource.spi.work">WorkListener</a>&nbsp;workListener)</code>
<div class="block">Accepts a <code>Work</code> instance for processing.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/resource/spi/work/WorkManager.html#scheduleWork-jakarta.resource.spi.work.Work-">scheduleWork</a></span>(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work)</code>
<div class="block">Accepts a <code>Work</code> instance for processing.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/resource/spi/work/WorkManager.html#scheduleWork-jakarta.resource.spi.work.Work-long-jakarta.resource.spi.work.ExecutionContext-jakarta.resource.spi.work.WorkListener-">scheduleWork</a></span>(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work,
long&nbsp;startTimeout,
<a href="../../../../jakarta/resource/spi/work/ExecutionContext.html" title="class in jakarta.resource.spi.work">ExecutionContext</a>&nbsp;execContext,
<a href="../../../../jakarta/resource/spi/work/WorkListener.html" title="interface in jakarta.resource.spi.work">WorkListener</a>&nbsp;workListener)</code>
<div class="block">Accepts a <code>Work</code> instance for processing.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/resource/spi/work/WorkManager.html#startWork-jakarta.resource.spi.work.Work-">startWork</a></span>(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work)</code>
<div class="block">Accepts a <code>Work</code> instance for processing.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../jakarta/resource/spi/work/WorkManager.html#startWork-jakarta.resource.spi.work.Work-long-jakarta.resource.spi.work.ExecutionContext-jakarta.resource.spi.work.WorkListener-">startWork</a></span>(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work,
long&nbsp;startTimeout,
<a href="../../../../jakarta/resource/spi/work/ExecutionContext.html" title="class in jakarta.resource.spi.work">ExecutionContext</a>&nbsp;execContext,
<a href="../../../../jakarta/resource/spi/work/WorkListener.html" title="interface in jakarta.resource.spi.work">WorkListener</a>&nbsp;workListener)</code>
<div class="block">Accepts a <code>Work</code> instance for processing.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="IMMEDIATE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>IMMEDIATE</h4>
<pre>static final&nbsp;long IMMEDIATE</pre>
<div class="block">A constant to indicate timeout duration. A zero timeout value indicates
an action be performed immediately. The WorkManager implementation
must timeout the action as soon as possible.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#jakarta.resource.spi.work.WorkManager.IMMEDIATE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="INDEFINITE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>INDEFINITE</h4>
<pre>static final&nbsp;long INDEFINITE</pre>
<div class="block">A constant to indicate timeout duration. A maximum timeout value
indicates that an action be performed arbitrarily without any time
constraint.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#jakarta.resource.spi.work.WorkManager.INDEFINITE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="UNKNOWN">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>UNKNOWN</h4>
<pre>static final&nbsp;long UNKNOWN</pre>
<div class="block">A constant to indicate an unknown start delay duration or other unknown
values.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#jakarta.resource.spi.work.WorkManager.UNKNOWN">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="doWork-jakarta.resource.spi.work.Work-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doWork</h4>
<pre>void&nbsp;doWork(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work)
throws <a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></pre>
<div class="block">Accepts a <code>Work</code> instance for processing. This call
blocks until the <code>Work</code> instance completes execution.
There is no guarantee on when the accepted <code>Work</code>
instance would start execution ie., there is no time constraint
to start execution. (that is, startTimeout=INDEFINITE)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>work</code> - The unit of work to be done.
Could be long or short-lived.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkRejectedException.html" title="class in jakarta.resource.spi.work">WorkRejectedException</a></code> - indicates that a
<code>Work</code> instance has been rejected from further processing.
This can occur due to internal factors.</dd>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkCompletedException.html" title="class in jakarta.resource.spi.work">WorkCompletedException</a></code> - indicates that a
<code>Work</code> instance has completed execution with an exception.</dd>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></code></dd>
</dl>
</li>
</ul>
<a name="doWork-jakarta.resource.spi.work.Work-long-jakarta.resource.spi.work.ExecutionContext-jakarta.resource.spi.work.WorkListener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doWork</h4>
<pre>void&nbsp;doWork(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work,
long&nbsp;startTimeout,
<a href="../../../../jakarta/resource/spi/work/ExecutionContext.html" title="class in jakarta.resource.spi.work">ExecutionContext</a>&nbsp;execContext,
<a href="../../../../jakarta/resource/spi/work/WorkListener.html" title="interface in jakarta.resource.spi.work">WorkListener</a>&nbsp;workListener)
throws <a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></pre>
<div class="block">Accepts a <code>Work</code> instance for processing. This call
blocks until the <code>Work</code> instance completes execution.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>work</code> - The unit of work to be done.
Could be long or short-lived.</dd>
<dd><code>startTimeout</code> - a time duration (in milliseconds)
within which the execution of the <code>Work</code> instance must
start. Otherwise, the <code>Work</code> instance is rejected with a
<code>WorkRejectedException</code> set to an appropriate error code
(<code>WorkRejectedException.TIMED_OUT</code>). Note, this
does not offer real-time guarantees.</dd>
<dd><code>execContext</code> - an object containing the execution
context with which the submitted <code>Work</code> instance must
be executed.</dd>
<dd><code>workListener</code> - an object which would be notified
when the various <code>Work</code> processing events (work accepted,
work rejected, work started, work completed) occur.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkRejectedException.html" title="class in jakarta.resource.spi.work">WorkRejectedException</a></code> - indicates that a
<code>Work</code> instance has been rejected from further processing.
This can occur due to internal factors or start timeout expiration.</dd>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkCompletedException.html" title="class in jakarta.resource.spi.work">WorkCompletedException</a></code> - indicates that a
<code>Work</code> instance has completed execution with an exception.</dd>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></code></dd>
</dl>
</li>
</ul>
<a name="startWork-jakarta.resource.spi.work.Work-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>startWork</h4>
<pre>long&nbsp;startWork(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work)
throws <a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></pre>
<div class="block">Accepts a <code>Work</code> instance for processing. This call
blocks until the <code>Work</code> instance starts execution
but not until its completion. There is no guarantee on when
the accepted <code>Work</code> instance would start
execution ie., there is no time constraint to start execution.
(that is, startTimeout=INDEFINITE)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>work</code> - The unit of work to be done.
Could be long or short-lived.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the time elapsed (in milliseconds) from <code>Work</code>
acceptance until start of execution. Note, this does not offer
real-time guarantees. It is valid to return -1, if the actual start
delay duration is unknown.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkRejectedException.html" title="class in jakarta.resource.spi.work">WorkRejectedException</a></code> - indicates that a
<code>Work</code> instance has been rejected from further processing.
This can occur due to internal factors.</dd>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></code></dd>
</dl>
</li>
</ul>
<a name="startWork-jakarta.resource.spi.work.Work-long-jakarta.resource.spi.work.ExecutionContext-jakarta.resource.spi.work.WorkListener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>startWork</h4>
<pre>long&nbsp;startWork(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work,
long&nbsp;startTimeout,
<a href="../../../../jakarta/resource/spi/work/ExecutionContext.html" title="class in jakarta.resource.spi.work">ExecutionContext</a>&nbsp;execContext,
<a href="../../../../jakarta/resource/spi/work/WorkListener.html" title="interface in jakarta.resource.spi.work">WorkListener</a>&nbsp;workListener)
throws <a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></pre>
<div class="block">Accepts a <code>Work</code> instance for processing. This call
blocks until the <code>Work</code> instance starts execution
but not until its completion. There is no guarantee on when
the accepted <code>Work</code> instance would start
execution ie., there is no time constraint to start execution.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>work</code> - The unit of work to be done.
Could be long or short-lived.</dd>
<dd><code>startTimeout</code> - a time duration (in milliseconds)
within which the execution of the <code>Work</code> instance must
start. Otherwise, the <code>Work</code> instance is rejected with a
<code>WorkRejectedException</code> set to an appropriate error code
(<code>WorkRejectedException.TIMED_OUT</code>). Note, this
does not offer real-time guarantees.</dd>
<dd><code>execContext</code> - an object containing the execution
context with which the submitted <code>Work</code> instance must
be executed.</dd>
<dd><code>workListener</code> - an object which would be notified
when the various <code>Work</code> processing events (work accepted,
work rejected, work started, work completed) occur.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the time elapsed (in milliseconds) from <code>Work</code>
acceptance until start of execution. Note, this does not offer
real-time guarantees. It is valid to return -1, if the actual start
delay duration is unknown.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkRejectedException.html" title="class in jakarta.resource.spi.work">WorkRejectedException</a></code> - indicates that a
<code>Work</code> instance has been rejected from further processing.
This can occur due to internal factors or start timeout expiration.</dd>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></code></dd>
</dl>
</li>
</ul>
<a name="scheduleWork-jakarta.resource.spi.work.Work-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scheduleWork</h4>
<pre>void&nbsp;scheduleWork(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work)
throws <a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></pre>
<div class="block">Accepts a <code>Work</code> instance for processing. This call
does not block and returns immediately once a <code>Work</code>
instance has been accepted for processing. There is no guarantee
on when the submitted <code>Work</code> instance would start
execution ie., there is no time constraint to start execution.
(that is, startTimeout=INDEFINITE).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>work</code> - The unit of work to be done.
Could be long or short-lived.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkRejectedException.html" title="class in jakarta.resource.spi.work">WorkRejectedException</a></code> - indicates that a
<code>Work</code> instance has been rejected from further processing.
This can occur due to internal factors.</dd>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></code></dd>
</dl>
</li>
</ul>
<a name="scheduleWork-jakarta.resource.spi.work.Work-long-jakarta.resource.spi.work.ExecutionContext-jakarta.resource.spi.work.WorkListener-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>scheduleWork</h4>
<pre>void&nbsp;scheduleWork(<a href="../../../../jakarta/resource/spi/work/Work.html" title="interface in jakarta.resource.spi.work">Work</a>&nbsp;work,
long&nbsp;startTimeout,
<a href="../../../../jakarta/resource/spi/work/ExecutionContext.html" title="class in jakarta.resource.spi.work">ExecutionContext</a>&nbsp;execContext,
<a href="../../../../jakarta/resource/spi/work/WorkListener.html" title="interface in jakarta.resource.spi.work">WorkListener</a>&nbsp;workListener)
throws <a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></pre>
<div class="block">Accepts a <code>Work</code> instance for processing. This call
does not block and returns immediately once a <code>Work</code>
instance has been accepted for processing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>work</code> - The unit of work to be done.
Could be long or short-lived.</dd>
<dd><code>startTimeout</code> - a time duration (in milliseconds)
within which the execution of the <code>Work</code> instance must
start. Otherwise, the <code>Work</code> instance is rejected with a
<code>WorkRejectedException</code> set to an appropriate error code
(<code>WorkRejectedException.TIMED_OUT</code>). Note, this
does not offer real-time guarantees.</dd>
<dd><code>execContext</code> - an object containing the execution
context with which the submitted <code>Work</code> instance must
be executed.</dd>
<dd><code>workListener</code> - an object which would be notified
when the various <code>Work</code> processing events (work accepted,
work rejected, work started, work completed) occur.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkRejectedException.html" title="class in jakarta.resource.spi.work">WorkRejectedException</a></code> - indicates that a
<code>Work</code> instance has been rejected from further processing.
This can occur due to internal factors.</dd>
<dd><code><a href="../../../../jakarta/resource/spi/work/WorkException.html" title="class in jakarta.resource.spi.work">WorkException</a></code></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/resource/spi/work/WorkListener.html" title="interface in jakarta.resource.spi.work"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../jakarta/resource/spi/work/WorkRejectedException.html" title="class in jakarta.resource.spi.work"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?jakarta/resource/spi/work/WorkManager.html" target="_top">Frames</a></li>
<li><a href="WorkManager.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>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>