/usr/share/doc/libcommons-lang3-java/api/org/apache/commons/lang3/concurrent/ConcurrentUtils.html is in libcommons-lang3-java-doc 3.5-2ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html>
<head>
<!-- Generated by javadoc -->
<title>ConcurrentUtils (Apache Commons Lang 3.5 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ConcurrentUtils (Apache Commons Lang 3.5 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../";loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="fixedNav">
<!-- ========= 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="class-use/ConcurrentUtils.html">Use</a></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="../../../../../org/apache/commons/lang3/concurrent/ConcurrentRuntimeException.html" title="class in org.apache.commons.lang3.concurrent"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/lang3/concurrent/ConstantInitializer.html" title="class in org.apache.commons.lang3.concurrent"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/lang3/concurrent/ConcurrentUtils.html" target="_top">Frames</a></li>
<li><a href="ConcurrentUtils.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>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="../../../../../org/apache/commons/lang3/concurrent/package-summary.html">org.apache.commons.lang3.concurrent</a></div>
<h2 title="Class ConcurrentUtils" class="title">Class ConcurrentUtils</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.lang3.concurrent.ConcurrentUtils</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public class <span class="typeNameLabel">ConcurrentUtils</span>
extends <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></pre>
<div class="block"><p>
An utility class providing functionality related to the <code>
java.util.concurrent</code> package.
</p></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">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static <T> <a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">Future</a><T></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#constantFuture-T-">constantFuture</a></span>​(T value)</code></th>
<td class="colLast">
<div class="block">
Gets an implementation of <code>Future</code> that is immediately done
and returns the specified constant value.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <K,V> V</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#createIfAbsent-java.util.concurrent.ConcurrentMap-K-org.apache.commons.lang3.concurrent.ConcurrentInitializer-">createIfAbsent</a></span>​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ConcurrentMap</a><K,V> map,
K key,
<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent">ConcurrentInitializer</a><V> init)</code></th>
<td class="colLast">
<div class="block">Checks if a concurrent map contains a key and creates a corresponding
value if not.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static <K,V> V</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#createIfAbsentUnchecked-java.util.concurrent.ConcurrentMap-K-org.apache.commons.lang3.concurrent.ConcurrentInitializer-">createIfAbsentUnchecked</a></span>​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ConcurrentMap</a><K,V> map,
K key,
<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent">ConcurrentInitializer</a><V> init)</code></th>
<td class="colLast">
<div class="block">Checks if a concurrent map contains a key and creates a corresponding
value if not, suppressing checked exceptions.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentException</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#extractCause-java.util.concurrent.ExecutionException-">extractCause</a></span>​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ExecutionException</a> ex)</code></th>
<td class="colLast">
<div class="block">Inspects the cause of the specified <code>ExecutionException</code> and
creates a <code>ConcurrentException</code> with the checked cause if
necessary.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentRuntimeException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentRuntimeException</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#extractCauseUnchecked-java.util.concurrent.ExecutionException-">extractCauseUnchecked</a></span>​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ExecutionException</a> ex)</code></th>
<td class="colLast">
<div class="block">Inspects the cause of the specified <code>ExecutionException</code> and
creates a <code>ConcurrentRuntimeException</code> with the checked cause if
necessary.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#handleCause-java.util.concurrent.ExecutionException-">handleCause</a></span>​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ExecutionException</a> ex)</code></th>
<td class="colLast">
<div class="block">Handles the specified <code>ExecutionException</code>.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#handleCauseUnchecked-java.util.concurrent.ExecutionException-">handleCauseUnchecked</a></span>​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ExecutionException</a> ex)</code></th>
<td class="colLast">
<div class="block">Handles the specified <code>ExecutionException</code> and transforms it into a
runtime exception.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>static <T> T</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#initialize-org.apache.commons.lang3.concurrent.ConcurrentInitializer-">initialize</a></span>​(<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent">ConcurrentInitializer</a><T> initializer)</code></th>
<td class="colLast">
<div class="block">Invokes the specified <code>ConcurrentInitializer</code> and returns the
object produced by the initializer.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static <T> T</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#initializeUnchecked-org.apache.commons.lang3.concurrent.ConcurrentInitializer-">initializeUnchecked</a></span>​(<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent">ConcurrentInitializer</a><T> initializer)</code></th>
<td class="colLast">
<div class="block">Invokes the specified <code>ConcurrentInitializer</code> and transforms
occurring exceptions to runtime exceptions.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static <K,V> V</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#putIfAbsent-java.util.concurrent.ConcurrentMap-K-V-">putIfAbsent</a></span>​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ConcurrentMap</a><K,V> map,
K key,
V value)</code></th>
<td class="colLast">
<div class="block">
Puts a value in the specified <code>ConcurrentMap</code> if the key is not yet
present.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang" class="externalLink">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="extractCause-java.util.concurrent.ExecutionException-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>extractCause</h4>
<pre>public static <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentException</a> extractCause​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ExecutionException</a> ex)</pre>
<div class="block">Inspects the cause of the specified <code>ExecutionException</code> and
creates a <code>ConcurrentException</code> with the checked cause if
necessary. This method performs the following checks on the cause of the
passed in exception:
<ul>
<li>If the passed in exception is <b>null</b> or the cause is
<b>null</b>, this method returns <b>null</b>.</li>
<li>If the cause is a runtime exception, it is directly thrown.</li>
<li>If the cause is an error, it is directly thrown, too.</li>
<li>In any other case the cause is a checked exception. The method then
creates a <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent"><code>ConcurrentException</code></a>, initializes it with the cause, and
returns it.</li>
</ul></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>ex</code> - the exception to be processed</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <code>ConcurrentException</code> with the checked cause</dd>
</dl>
</li>
</ul>
<a name="extractCauseUnchecked-java.util.concurrent.ExecutionException-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>extractCauseUnchecked</h4>
<pre>public static <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentRuntimeException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentRuntimeException</a> extractCauseUnchecked​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ExecutionException</a> ex)</pre>
<div class="block">Inspects the cause of the specified <code>ExecutionException</code> and
creates a <code>ConcurrentRuntimeException</code> with the checked cause if
necessary. This method works exactly like
<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#extractCause-java.util.concurrent.ExecutionException-"><code>extractCause(ExecutionException)</code></a>. The only difference is that
the cause of the specified <code>ExecutionException</code> is extracted as a
runtime exception. This is an alternative for client code that does not
want to deal with checked exceptions.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>ex</code> - the exception to be processed</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <code>ConcurrentRuntimeException</code> with the checked cause</dd>
</dl>
</li>
</ul>
<a name="handleCause-java.util.concurrent.ExecutionException-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleCause</h4>
<pre>public static void handleCause​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ExecutionException</a> ex)
throws <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentException</a></pre>
<div class="block">Handles the specified <code>ExecutionException</code>. This method calls
<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#extractCause-java.util.concurrent.ExecutionException-"><code>extractCause(ExecutionException)</code></a> for obtaining the cause of the
exception - which might already cause an unchecked exception or an error
being thrown. If the cause is a checked exception however, it is wrapped
in a <code>ConcurrentException</code>, which is thrown. If the passed in
exception is <b>null</b> or has no cause, the method simply returns
without throwing an exception.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>ex</code> - the exception to be handled</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentException</a></code> - if the cause of the <code>
ExecutionException</code> is a checked exception</dd>
</dl>
</li>
</ul>
<a name="handleCauseUnchecked-java.util.concurrent.ExecutionException-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleCauseUnchecked</h4>
<pre>public static void handleCauseUnchecked​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ExecutionException</a> ex)</pre>
<div class="block">Handles the specified <code>ExecutionException</code> and transforms it into a
runtime exception. This method works exactly like
<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#handleCause-java.util.concurrent.ExecutionException-"><code>handleCause(ExecutionException)</code></a>, but instead of a
<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent"><code>ConcurrentException</code></a> it throws a
<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentRuntimeException.html" title="class in org.apache.commons.lang3.concurrent"><code>ConcurrentRuntimeException</code></a>. This is an alternative for client
code that does not want to deal with checked exceptions.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>ex</code> - the exception to be handled</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentRuntimeException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentRuntimeException</a></code> - if the cause of the <code>
ExecutionException</code> is a checked exception; this exception is then
wrapped in the thrown runtime exception</dd>
</dl>
</li>
</ul>
<a name="initialize-org.apache.commons.lang3.concurrent.ConcurrentInitializer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initialize</h4>
<pre>public static <T> T initialize​(<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent">ConcurrentInitializer</a><T> initializer)
throws <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentException</a></pre>
<div class="block">Invokes the specified <code>ConcurrentInitializer</code> and returns the
object produced by the initializer. This method just invokes the <code>
get()</code> method of the given <code>ConcurrentInitializer</code>. It is
<b>null</b>-safe: if the argument is <b>null</b>, result is also
<b>null</b>.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the type of the object produced by the initializer</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>initializer</code> - the <code>ConcurrentInitializer</code> to be invoked</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the object managed by the <code>ConcurrentInitializer</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentException</a></code> - if the <code>ConcurrentInitializer</code> throws
an exception</dd>
</dl>
</li>
</ul>
<a name="initializeUnchecked-org.apache.commons.lang3.concurrent.ConcurrentInitializer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initializeUnchecked</h4>
<pre>public static <T> T initializeUnchecked​(<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent">ConcurrentInitializer</a><T> initializer)</pre>
<div class="block">Invokes the specified <code>ConcurrentInitializer</code> and transforms
occurring exceptions to runtime exceptions. This method works like
<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#initialize-org.apache.commons.lang3.concurrent.ConcurrentInitializer-"><code>initialize(ConcurrentInitializer)</code></a>, but if the <code>
ConcurrentInitializer</code> throws a <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent"><code>ConcurrentException</code></a>, it is
caught, and the cause is wrapped in a <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentRuntimeException.html" title="class in org.apache.commons.lang3.concurrent"><code>ConcurrentRuntimeException</code></a>.
So client code does not have to deal with checked exceptions.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the type of the object produced by the initializer</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>initializer</code> - the <code>ConcurrentInitializer</code> to be invoked</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the object managed by the <code>ConcurrentInitializer</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentRuntimeException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentRuntimeException</a></code> - if the initializer throws an exception</dd>
</dl>
</li>
</ul>
<a name="putIfAbsent-java.util.concurrent.ConcurrentMap-java.lang.Object-java.lang.Object-">
<!-- -->
</a><a name="putIfAbsent-java.util.concurrent.ConcurrentMap-K-V-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putIfAbsent</h4>
<pre>public static <K,V> V putIfAbsent​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ConcurrentMap</a><K,V> map,
K key,
V value)</pre>
<div class="block"><p>
Puts a value in the specified <code>ConcurrentMap</code> if the key is not yet
present. This method works similar to the <code>putIfAbsent()</code> method of
the <code>ConcurrentMap</code> interface, but the value returned is different.
Basically, this method is equivalent to the following code fragment:
</p>
<pre>
if (!map.containsKey(key)) {
map.put(key, value);
return value;
} else {
return map.get(key);
}
</pre>
<p>
except that the action is performed atomically. So this method always
returns the value which is stored in the map.
</p>
<p>
This method is <b>null</b>-safe: It accepts a <b>null</b> map as input
without throwing an exception. In this case the return value is
<b>null</b>, too.
</p></div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>K</code> - the type of the keys of the map</dd>
<dd><code>V</code> - the type of the values of the map</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>map</code> - the map to be modified</dd>
<dd><code>key</code> - the key of the value to be added</dd>
<dd><code>value</code> - the value to be added</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value stored in the map after this operation</dd>
</dl>
</li>
</ul>
<a name="createIfAbsent-java.util.concurrent.ConcurrentMap-java.lang.Object-org.apache.commons.lang3.concurrent.ConcurrentInitializer-">
<!-- -->
</a><a name="createIfAbsent-java.util.concurrent.ConcurrentMap-K-org.apache.commons.lang3.concurrent.ConcurrentInitializer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createIfAbsent</h4>
<pre>public static <K,V> V createIfAbsent​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ConcurrentMap</a><K,V> map,
K key,
<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent">ConcurrentInitializer</a><V> init)
throws <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentException</a></pre>
<div class="block">Checks if a concurrent map contains a key and creates a corresponding
value if not. This method first checks the presence of the key in the
given map. If it is already contained, its value is returned. Otherwise
the <code>get()</code> method of the passed in <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent"><code>ConcurrentInitializer</code></a>
is called. With the resulting object
<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentUtils.html#putIfAbsent-java.util.concurrent.ConcurrentMap-K-V-"><code>putIfAbsent(ConcurrentMap, Object, Object)</code></a> is called. This
handles the case that in the meantime another thread has added the key to
the map. Both the map and the initializer can be <b>null</b>; in this
case this method simply returns <b>null</b>.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>K</code> - the type of the keys of the map</dd>
<dd><code>V</code> - the type of the values of the map</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>map</code> - the map to be modified</dd>
<dd><code>key</code> - the key of the value to be added</dd>
<dd><code>init</code> - the <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent"><code>ConcurrentInitializer</code></a> for creating the value</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value stored in the map after this operation; this may or may
not be the object created by the <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent"><code>ConcurrentInitializer</code></a></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentException</a></code> - if the initializer throws an exception</dd>
</dl>
</li>
</ul>
<a name="createIfAbsentUnchecked-java.util.concurrent.ConcurrentMap-java.lang.Object-org.apache.commons.lang3.concurrent.ConcurrentInitializer-">
<!-- -->
</a><a name="createIfAbsentUnchecked-java.util.concurrent.ConcurrentMap-K-org.apache.commons.lang3.concurrent.ConcurrentInitializer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createIfAbsentUnchecked</h4>
<pre>public static <K,V> V createIfAbsentUnchecked​(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">ConcurrentMap</a><K,V> map,
K key,
<a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent">ConcurrentInitializer</a><V> init)</pre>
<div class="block">Checks if a concurrent map contains a key and creates a corresponding
value if not, suppressing checked exceptions. This method calls
<code>createIfAbsent()</code>. If a <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentException.html" title="class in org.apache.commons.lang3.concurrent"><code>ConcurrentException</code></a> is thrown, it
is caught and re-thrown as a <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentRuntimeException.html" title="class in org.apache.commons.lang3.concurrent"><code>ConcurrentRuntimeException</code></a>.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>K</code> - the type of the keys of the map</dd>
<dd><code>V</code> - the type of the values of the map</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>map</code> - the map to be modified</dd>
<dd><code>key</code> - the key of the value to be added</dd>
<dd><code>init</code> - the <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent"><code>ConcurrentInitializer</code></a> for creating the value</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value stored in the map after this operation; this may or may
not be the object created by the <a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentInitializer.html" title="interface in org.apache.commons.lang3.concurrent"><code>ConcurrentInitializer</code></a></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/lang3/concurrent/ConcurrentRuntimeException.html" title="class in org.apache.commons.lang3.concurrent">ConcurrentRuntimeException</a></code> - if the initializer throws an exception</dd>
</dl>
</li>
</ul>
<a name="constantFuture-java.lang.Object-">
<!-- -->
</a><a name="constantFuture-T-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>constantFuture</h4>
<pre>public static <T> <a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink">Future</a><T> constantFuture​(T value)</pre>
<div class="block"><p>
Gets an implementation of <code>Future</code> that is immediately done
and returns the specified constant value.
</p>
<p>
This can be useful to return a simple constant immediately from the
concurrent processing, perhaps as part of avoiding nulls.
A constant future can also be useful in testing.
</p></div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the type of the value used by this <code>Future</code> object</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - the constant value to return, may be null</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an instance of Future that will return the value, never null</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="class-use/ConcurrentUtils.html">Use</a></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="../../../../../org/apache/commons/lang3/concurrent/ConcurrentRuntimeException.html" title="class in org.apache.commons.lang3.concurrent"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/lang3/concurrent/ConstantInitializer.html" title="class in org.apache.commons.lang3.concurrent"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/lang3/concurrent/ConcurrentUtils.html" target="_top">Frames</a></li>
<li><a href="ConcurrentUtils.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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2001–2018. All rights reserved.</small></p>
</body>
</html>
|