source: javadoc/genius/core/session/ExecutorWithTimeout.html@ 1

Last change on this file since 1 was 1, checked in by Wouter Pasman, 7 years ago

Initial import : Genius 9.0.0

File size: 11.3 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!-- NewPage -->
3<html lang="en">
4<head>
5<!-- Generated by javadoc (1.8.0_112) on Thu Jun 21 12:05:58 CEST 2018 -->
6<title>ExecutorWithTimeout (Genius Core Documentation)</title>
7<meta name="date" content="2018-06-21">
8<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
9<script type="text/javascript" src="../../../script.js"></script>
10</head>
11<body>
12<script type="text/javascript"><!--
13 try {
14 if (location.href.indexOf('is-external=true') == -1) {
15 parent.document.title="ExecutorWithTimeout (Genius Core Documentation)";
16 }
17 }
18 catch(err) {
19 }
20//-->
21var methods = {"i0":10};
22var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
23var altColor = "altColor";
24var rowColor = "rowColor";
25var tableTab = "tableTab";
26var activeTableTab = "activeTableTab";
27</script>
28<noscript>
29<div>JavaScript is disabled on your browser.</div>
30</noscript>
31<!-- ========= START OF TOP NAVBAR ======= -->
32<div class="topNav"><a name="navbar.top">
33<!-- -->
34</a>
35<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
36<a name="navbar.top.firstrow">
37<!-- -->
38</a>
39<ul class="navList" title="Navigation">
40<li><a href="../../../overview-summary.html">Overview</a></li>
41<li><a href="package-summary.html">Package</a></li>
42<li class="navBarCell1Rev">Class</li>
43<li><a href="class-use/ExecutorWithTimeout.html">Use</a></li>
44<li><a href="package-tree.html">Tree</a></li>
45<li><a href="../../../deprecated-list.html">Deprecated</a></li>
46<li><a href="../../../index-all.html">Index</a></li>
47<li><a href="../../../help-doc.html">Help</a></li>
48</ul>
49</div>
50<div class="subNav">
51<ul class="navList">
52<li><a href="../../../genius/core/session/ActionException.html" title="class in genius.core.session"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
53<li><a href="../../../genius/core/session/InvalidActionContentsError.html" title="class in genius.core.session"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
54</ul>
55<ul class="navList">
56<li><a href="../../../index.html?genius/core/session/ExecutorWithTimeout.html" target="_top">Frames</a></li>
57<li><a href="ExecutorWithTimeout.html" target="_top">No&nbsp;Frames</a></li>
58</ul>
59<ul class="navList" id="allclasses_navbar_top">
60<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
61</ul>
62<div>
63<script type="text/javascript"><!--
64 allClassesLink = document.getElementById("allclasses_navbar_top");
65 if(window==top) {
66 allClassesLink.style.display = "block";
67 }
68 else {
69 allClassesLink.style.display = "none";
70 }
71 //-->
72</script>
73</div>
74<div>
75<ul class="subNavList">
76<li>Summary:&nbsp;</li>
77<li>Nested&nbsp;|&nbsp;</li>
78<li>Field&nbsp;|&nbsp;</li>
79<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
80<li><a href="#method.summary">Method</a></li>
81</ul>
82<ul class="subNavList">
83<li>Detail:&nbsp;</li>
84<li>Field&nbsp;|&nbsp;</li>
85<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
86<li><a href="#method.detail">Method</a></li>
87</ul>
88</div>
89<a name="skip.navbar.top">
90<!-- -->
91</a></div>
92<!-- ========= END OF TOP NAVBAR ========= -->
93<!-- ======== START OF CLASS DATA ======== -->
94<div class="header">
95<div class="subTitle">genius.core.session</div>
96<h2 title="Class ExecutorWithTimeout" class="title">Class ExecutorWithTimeout</h2>
97</div>
98<div class="contentContainer">
99<ul class="inheritance">
100<li>java.lang.Object</li>
101<li>
102<ul class="inheritance">
103<li>genius.core.session.ExecutorWithTimeout</li>
104</ul>
105</li>
106</ul>
107<div class="description">
108<ul class="blockList">
109<li class="blockList">
110<hr>
111<br>
112<pre>public class <span class="typeNameLabel">ExecutorWithTimeout</span>
113extends java.lang.Object</pre>
114<div class="block">execute commands within the set timout limits. Compute and keeps remaining
115 time for further calls. This executor can be called multiple times with
116 different <code>Callable</code>s so that the total accumulated time will stay
117 within the total timeoutms that is given in the constructor.
118
119 This executor will run a separate timer and kill the <code>Callable</code> with
120 thread.stop() to make a pretty hard kill attempt if the time runs out.</div>
121<dl>
122<dt><span class="simpleTagLabel">Author:</span></dt>
123<dd>W.Pasman, David Festen 1apr15</dd>
124</dl>
125</li>
126</ul>
127</div>
128<div class="summary">
129<ul class="blockList">
130<li class="blockList">
131<!-- ======== CONSTRUCTOR SUMMARY ======== -->
132<ul class="blockList">
133<li class="blockList"><a name="constructor.summary">
134<!-- -->
135</a>
136<h3>Constructor Summary</h3>
137<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
138<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
139<tr>
140<th class="colOne" scope="col">Constructor and Description</th>
141</tr>
142<tr class="altColor">
143<td class="colOne"><code><span class="memberNameLink"><a href="../../../genius/core/session/ExecutorWithTimeout.html#ExecutorWithTimeout-long-">ExecutorWithTimeout</a></span>(long&nbsp;timeoutms)</code>
144<div class="block">Construct an executor with a total available amount of time.</div>
145</td>
146</tr>
147</table>
148</li>
149</ul>
150<!-- ========== METHOD SUMMARY =========== -->
151<ul class="blockList">
152<li class="blockList"><a name="method.summary">
153<!-- -->
154</a>
155<h3>Method Summary</h3>
156<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
157<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="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
158<tr>
159<th class="colFirst" scope="col">Modifier and Type</th>
160<th class="colLast" scope="col">Method and Description</th>
161</tr>
162<tr id="i0" class="altColor">
163<td class="colFirst"><code>&lt;V&gt;&nbsp;V</code></td>
164<td class="colLast"><code><span class="memberNameLink"><a href="../../../genius/core/session/ExecutorWithTimeout.html#execute-java.lang.String-java.util.concurrent.Callable-">execute</a></span>(java.lang.String&nbsp;name,
165 java.util.concurrent.Callable&lt;V&gt;&nbsp;command)</code>
166<div class="block">Execute the command within the remaining time of this executor.</div>
167</td>
168</tr>
169</table>
170<ul class="blockList">
171<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
172<!-- -->
173</a>
174<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
175<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
176</ul>
177</li>
178</ul>
179</li>
180</ul>
181</div>
182<div class="details">
183<ul class="blockList">
184<li class="blockList">
185<!-- ========= CONSTRUCTOR DETAIL ======== -->
186<ul class="blockList">
187<li class="blockList"><a name="constructor.detail">
188<!-- -->
189</a>
190<h3>Constructor Detail</h3>
191<a name="ExecutorWithTimeout-long-">
192<!-- -->
193</a>
194<ul class="blockListLast">
195<li class="blockList">
196<h4>ExecutorWithTimeout</h4>
197<pre>public&nbsp;ExecutorWithTimeout(long&nbsp;timeoutms)</pre>
198<div class="block">Construct an executor with a total available amount of time.</div>
199<dl>
200<dt><span class="paramLabel">Parameters:</span></dt>
201<dd><code>timeoutms</code> - the total available time that this executor can spend.</dd>
202</dl>
203</li>
204</ul>
205</li>
206</ul>
207<!-- ============ METHOD DETAIL ========== -->
208<ul class="blockList">
209<li class="blockList"><a name="method.detail">
210<!-- -->
211</a>
212<h3>Method Detail</h3>
213<a name="execute-java.lang.String-java.util.concurrent.Callable-">
214<!-- -->
215</a>
216<ul class="blockListLast">
217<li class="blockList">
218<h4>execute</h4>
219<pre>public&nbsp;&lt;V&gt;&nbsp;V&nbsp;execute(java.lang.String&nbsp;name,
220 java.util.concurrent.Callable&lt;V&gt;&nbsp;command)
221 throws java.util.concurrent.ExecutionException,
222 java.util.concurrent.TimeoutException</pre>
223<div class="block">Execute the command within the remaining time of this executor. Blocking
224 call. Used time will be subtracted from the quotum of this Executor. This
225 function is synchronized and can execute only 1 Callable at any time.</div>
226<dl>
227<dt><span class="paramLabel">Parameters:</span></dt>
228<dd><code>name</code> - the name of the thread/process/agent for which we are
229 executing. Used for error reporting.</dd>
230<dd><code>command</code> - the <code>Callable</code> to execute</dd>
231<dt><span class="returnLabel">Returns:</span></dt>
232<dd>the result V</dd>
233<dt><span class="throwsLabel">Throws:</span></dt>
234<dd><code>java.util.concurrent.ExecutionException</code> - if the <code>Callable</code> threw an exception. The
235 <code>ExecutionException</code> will contain the exception from
236 the <code>Callable</code>.</dd>
237<dd><code>java.util.concurrent.TimeoutException</code> - if the <code>Callable</code> did not finish in time.</dd>
238</dl>
239</li>
240</ul>
241</li>
242</ul>
243</li>
244</ul>
245</div>
246</div>
247<!-- ========= END OF CLASS DATA ========= -->
248<!-- ======= START OF BOTTOM NAVBAR ====== -->
249<div class="bottomNav"><a name="navbar.bottom">
250<!-- -->
251</a>
252<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
253<a name="navbar.bottom.firstrow">
254<!-- -->
255</a>
256<ul class="navList" title="Navigation">
257<li><a href="../../../overview-summary.html">Overview</a></li>
258<li><a href="package-summary.html">Package</a></li>
259<li class="navBarCell1Rev">Class</li>
260<li><a href="class-use/ExecutorWithTimeout.html">Use</a></li>
261<li><a href="package-tree.html">Tree</a></li>
262<li><a href="../../../deprecated-list.html">Deprecated</a></li>
263<li><a href="../../../index-all.html">Index</a></li>
264<li><a href="../../../help-doc.html">Help</a></li>
265</ul>
266</div>
267<div class="subNav">
268<ul class="navList">
269<li><a href="../../../genius/core/session/ActionException.html" title="class in genius.core.session"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
270<li><a href="../../../genius/core/session/InvalidActionContentsError.html" title="class in genius.core.session"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
271</ul>
272<ul class="navList">
273<li><a href="../../../index.html?genius/core/session/ExecutorWithTimeout.html" target="_top">Frames</a></li>
274<li><a href="ExecutorWithTimeout.html" target="_top">No&nbsp;Frames</a></li>
275</ul>
276<ul class="navList" id="allclasses_navbar_bottom">
277<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
278</ul>
279<div>
280<script type="text/javascript"><!--
281 allClassesLink = document.getElementById("allclasses_navbar_bottom");
282 if(window==top) {
283 allClassesLink.style.display = "block";
284 }
285 else {
286 allClassesLink.style.display = "none";
287 }
288 //-->
289</script>
290</div>
291<div>
292<ul class="subNavList">
293<li>Summary:&nbsp;</li>
294<li>Nested&nbsp;|&nbsp;</li>
295<li>Field&nbsp;|&nbsp;</li>
296<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
297<li><a href="#method.summary">Method</a></li>
298</ul>
299<ul class="subNavList">
300<li>Detail:&nbsp;</li>
301<li>Field&nbsp;|&nbsp;</li>
302<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
303<li><a href="#method.detail">Method</a></li>
304</ul>
305</div>
306<a name="skip.navbar.bottom">
307<!-- -->
308</a></div>
309<!-- ======== END OF BOTTOM NAVBAR ======= -->
310</body>
311</html>
Note: See TracBrowser for help on using the repository browser.