| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (17) on Thu Sep 15 14:13:16 CDT 2022 --> |
| <title>Callback (Eclipse Jetty API Doc - v11.0.12)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2022-09-15"> |
| <meta name="description" content="declaration: package: org.eclipse.jetty.util, interface: Callback"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-3.5.1.min.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var evenRowColor = "even-row-color"; |
| var oddRowColor = "odd-row-color"; |
| var tableTab = "table-tab"; |
| var activeTableTab = "active-table-tab"; |
| var pathtoroot = "../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="class-use/Callback.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#class">Help</a></li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li><a href="#nested-class-summary">Nested</a> | </li> |
| <li><a href="#field-summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li><a href="#field-detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><label for="search-input">SEARCH:</label> |
| <input type="text" id="search-input" value="search" disabled="disabled"> |
| <input type="reset" id="reset-button" value="reset" disabled="disabled"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.eclipse.jetty.util</a></div> |
| <h1 title="Interface Callback" class="title">Interface Callback</h1> |
| </div> |
| <section class="class-description" id="class-description"> |
| <dl class="notes"> |
| <dt>All Superinterfaces:</dt> |
| <dd><code><a href="thread/Invocable.html" title="interface in org.eclipse.jetty.util.thread">Invocable</a></code></dd> |
| </dl> |
| <dl class="notes"> |
| <dt>All Known Implementing Classes:</dt> |
| <dd><code><a href="../proxy/AsyncMiddleManServlet.ProxyReader.html" title="class in org.eclipse.jetty.proxy">AsyncMiddleManServlet.ProxyReader</a></code>, <code><a href="../proxy/AsyncMiddleManServlet.ProxyResponseListener.html" title="class in org.eclipse.jetty.proxy">AsyncMiddleManServlet.ProxyResponseListener</a></code>, <code><a href="../proxy/AsyncProxyServlet.StreamReader.html" title="class in org.eclipse.jetty.proxy">AsyncProxyServlet.StreamReader</a></code>, <code><a href="Callback.Completable.html" title="class in org.eclipse.jetty.util">Callback.Completable</a></code>, <code><a href="Callback.Completing.html" title="class in org.eclipse.jetty.util">Callback.Completing</a></code>, <code><a href="Callback.Nested.html" title="class in org.eclipse.jetty.util">Callback.Nested</a></code>, <code><a href="CountingCallback.html" title="class in org.eclipse.jetty.util">CountingCallback</a></code>, <code><a href="../client/util/DeferredContentProvider.html" title="class in org.eclipse.jetty.client.util">DeferredContentProvider</a></code>, <code><a href="../websocket/core/internal/DemandingFlusher.html" title="class in org.eclipse.jetty.websocket.core.internal">DemandingFlusher</a></code>, <code><a href="../client/DuplexHttpDestination.html" title="class in org.eclipse.jetty.client">DuplexHttpDestination</a></code>, <code><a href="../websocket/core/internal/FragmentExtension.FragmentingDemandingFlusher.html" title="class in org.eclipse.jetty.websocket.core.internal">FragmentExtension.FragmentingDemandingFlusher</a></code>, <code><a href="../websocket/core/internal/FrameFlusher.html" title="class in org.eclipse.jetty.websocket.core.internal">FrameFlusher</a></code>, <code><a href="FutureCallback.html" title="class in org.eclipse.jetty.util">FutureCallback</a></code>, <code><a href="../fcgi/generator/Generator.Result.html" title="class in org.eclipse.jetty.fcgi.generator">Generator.Result</a></code>, <code><a href="../http2/HTTP2Flusher.html" title="class in org.eclipse.jetty.http2">HTTP2Flusher</a></code>, <code><a href="../http2/HTTP2Flusher.Entry.html" title="class in org.eclipse.jetty.http2">HTTP2Flusher.Entry</a></code>, <code><a href="../http2/HTTP2Stream.html" title="class in org.eclipse.jetty.http2">HTTP2Stream</a></code>, <code><a href="../client/HttpDestination.html" title="class in org.eclipse.jetty.client">HttpDestination</a></code>, <code><a href="../server/HttpInput.Content.html" title="class in org.eclipse.jetty.server">HttpInput.Content</a></code>, <code><a href="../server/HttpInput.EofContent.html" title="class in org.eclipse.jetty.server">HttpInput.EofContent</a></code>, <code><a href="../server/HttpInput.ErrorContent.html" title="class in org.eclipse.jetty.server">HttpInput.ErrorContent</a></code>, <code><a href="../server/HttpInput.SpecialContent.html" title="class in org.eclipse.jetty.server">HttpInput.SpecialContent</a></code>, <code><a href="../server/HttpInput.WrappingContent.html" title="class in org.eclipse.jetty.server">HttpInput.WrappingContent</a></code>, <code><a href="../client/util/InputStreamContentProvider.html" title="class in org.eclipse.jetty.client.util">InputStreamContentProvider</a></code>, <code><a href="IteratingCallback.html" title="class in org.eclipse.jetty.util">IteratingCallback</a></code>, <code><a href="IteratingNestedCallback.html" title="class in org.eclipse.jetty.util">IteratingNestedCallback</a></code>, <code><a href="../client/MultiplexHttpDestination.html" title="class in org.eclipse.jetty.client">MultiplexHttpDestination</a></code>, <code><a href="../client/util/OutputStreamContentProvider.html" title="class in org.eclipse.jetty.client.util">OutputStreamContentProvider</a></code>, <code><a href="../client/ProxyProtocolClientConnectionFactory.ProxyProtocolConnection.html" title="class in org.eclipse.jetty.client">ProxyProtocolClientConnectionFactory.ProxyProtocolConnection</a></code>, <code><a href="../client/internal/RequestContentAdapter.html" title="class in org.eclipse.jetty.client.internal">RequestContentAdapter</a></code>, <code><a href="../websocket/jakarta/common/SendHandlerCallback.html" title="class in org.eclipse.jetty.websocket.jakarta.common">SendHandlerCallback</a></code>, <code><a href="SharedBlockingCallback.Blocker.html" title="class in org.eclipse.jetty.util">SharedBlockingCallback.Blocker</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public interface </span><span class="element-name type-name-label">Callback</span><span class="extends-implements"> |
| extends <a href="thread/Invocable.html" title="interface in org.eclipse.jetty.util.thread">Invocable</a></span></div> |
| <div class="block"><p>A callback abstraction that handles completed/failed events of asynchronous operations.</p> |
| |
| <p>Semantically this is equivalent to an optimise Promise<Void>, but callback is a more meaningful |
| name than EmptyPromise</p></div> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <li> |
| <section class="nested-class-summary" id="nested-class-summary"> |
| <h2>Nested Class Summary</h2> |
| <div class="caption"><span>Nested Classes</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Interface</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>static class </code></div> |
| <div class="col-second even-row-color"><code><a href="Callback.Completable.html" class="type-name-link" title="class in org.eclipse.jetty.util">Callback.Completable</a></code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">A CompletableFuture that is also a Callback.</div> |
| </div> |
| <div class="col-first odd-row-color"><code>static class </code></div> |
| <div class="col-second odd-row-color"><code><a href="Callback.Completing.html" class="type-name-link" title="class in org.eclipse.jetty.util">Callback.Completing</a></code></div> |
| <div class="col-last odd-row-color"> |
| <div class="block">A Callback implementation that calls the <a href="Callback.Completing.html#completed()"><code>Callback.Completing.completed()</code></a> method when it either succeeds or fails.</div> |
| </div> |
| <div class="col-first even-row-color"><code>static class </code></div> |
| <div class="col-second even-row-color"><code><a href="Callback.Nested.html" class="type-name-link" title="class in org.eclipse.jetty.util">Callback.Nested</a></code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Nested Completing Callback that completes after |
| completing the nested callback</div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h2 id="nested-classes-inherited-from-class-org.eclipse.jetty.util.thread.Invocable">Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.<a href="thread/Invocable.html" title="interface in org.eclipse.jetty.util.thread">Invocable</a></h2> |
| <code><a href="thread/Invocable.InvocationType.html" title="enum in org.eclipse.jetty.util.thread">Invocable.InvocationType</a>, <a href="thread/Invocable.ReadyTask.html" title="class in org.eclipse.jetty.util.thread">Invocable.ReadyTask</a>, <a href="thread/Invocable.Task.html" title="interface in org.eclipse.jetty.util.thread">Invocable.Task</a></code></div> |
| </section> |
| </li> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <li> |
| <section class="field-summary" id="field-summary"> |
| <h2>Field Summary</h2> |
| <div class="caption"><span>Fields</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Field</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>static final <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second even-row-color"><code><a href="#NOOP" class="member-name-link">NOOP</a></code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Instance of Adapter that can be used when the callback methods need an empty |
| implementation without incurring in the cost of allocating a new Adapter object.</div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="fields-inherited-from-class-org.eclipse.jetty.util.thread.Invocable">Fields inherited from interface org.eclipse.jetty.util.thread.<a href="thread/Invocable.html" title="interface in org.eclipse.jetty.util.thread">Invocable</a></h3> |
| <code><a href="thread/Invocable.html#__nonBlocking">__nonBlocking</a></code></div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab5" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab5', 3)" class="table-tab">Default Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1"><code>static <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1"><code><a href="#combine(org.eclipse.jetty.util.Callback,org.eclipse.jetty.util.Callback)" class="member-name-link">combine</a><wbr>(<a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> cb1, |
| <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> cb2)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1"> </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#completeWith(java.util.concurrent.CompletableFuture)" class="member-name-link">completeWith</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CompletableFuture.html" title="class or interface in java.util.concurrent" class="external-link">CompletableFuture</a><?> completable)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"> |
| <div class="block">Completes this callback with the given <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CompletableFuture.html" title="class or interface in java.util.concurrent" class="external-link"><code>CompletableFuture</code></a>.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#failed(java.lang.Throwable)" class="member-name-link">failed</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Throwable.html" title="class or interface in java.lang" class="external-link">Throwable</a> x)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"> |
| <div class="block">Callback invoked when the operation fails.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1"><code>static <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1"><code><a href="#from(java.lang.Runnable)" class="member-name-link">from</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> completed)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1"> |
| <div class="block">Creates a callback that runs completed when it succeeds or fails</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1"><code>static <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1"><code><a href="#from(java.lang.Runnable,java.util.function.Consumer)" class="member-name-link">from</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> success, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Throwable.html" title="class or interface in java.lang" class="external-link">Throwable</a>> failure)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1"> |
| <div class="block">Creates a callback from the given success and failure lambdas.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1"><code>static <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1"><code><a href="#from(java.lang.Runnable,org.eclipse.jetty.util.Callback)" class="member-name-link">from</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> completed, |
| <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> callback)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1"> |
| <div class="block">Creates a nested callback that runs completed before |
| completing the nested callback.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1"><code>static <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1"><code><a href="#from(java.util.concurrent.CompletableFuture)" class="member-name-link">from</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CompletableFuture.html" title="class or interface in java.util.concurrent" class="external-link">CompletableFuture</a><?> completable)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1"> |
| <div class="block">Creates a non-blocking callback from the given incomplete CompletableFuture.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1"><code>static <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1"><code><a href="#from(java.util.concurrent.CompletableFuture,org.eclipse.jetty.util.thread.Invocable.InvocationType)" class="member-name-link">from</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CompletableFuture.html" title="class or interface in java.util.concurrent" class="external-link">CompletableFuture</a><?> completable, |
| <a href="thread/Invocable.InvocationType.html" title="enum in org.eclipse.jetty.util.thread">Invocable.InvocationType</a> invocation)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1"> |
| <div class="block">Creates a callback from the given incomplete CompletableFuture, |
| with the given <code>blocking</code> characteristic.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1"><code>static <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1"><code><a href="#from(org.eclipse.jetty.util.Callback,java.lang.Runnable)" class="member-name-link">from</a><wbr>(<a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> callback, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> completed)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1"> |
| <div class="block">Creates a nested callback that runs completed after |
| completing the nested callback.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1"><code>static <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1"><code><a href="#from(org.eclipse.jetty.util.Callback,java.lang.Throwable)" class="member-name-link">from</a><wbr>(<a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> callback, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Throwable.html" title="class or interface in java.lang" class="external-link">Throwable</a> cause)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1"> |
| <div class="block">Creates a nested callback which always fails the nested callback on completion.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1"><code>static <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1"><code><a href="#from(org.eclipse.jetty.util.Callback,org.eclipse.jetty.util.Callback)" class="member-name-link">from</a><wbr>(<a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> callback1, |
| <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> callback2)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1"> |
| <div class="block">Creates a callback which combines two other callbacks and will succeed or fail them both.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1"><code>static <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1"><code><a href="#from(org.eclipse.jetty.util.thread.Invocable.InvocationType,java.lang.Runnable)" class="member-name-link">from</a><wbr>(<a href="thread/Invocable.InvocationType.html" title="enum in org.eclipse.jetty.util.thread">Invocable.InvocationType</a> invocationType, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> completed)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1"> |
| <div class="block">Creates a Callback with the given <code>invocationType</code>, |
| that runs the given <code>Runnable</code> when it succeeds or fails.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1"><code>static <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1"><code><a href="#from(org.eclipse.jetty.util.thread.Invocable.InvocationType,java.lang.Runnable,java.util.function.Consumer)" class="member-name-link">from</a><wbr>(<a href="thread/Invocable.InvocationType.html" title="enum in org.eclipse.jetty.util.thread">Invocable.InvocationType</a> invocationType, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> success, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Throwable.html" title="class or interface in java.lang" class="external-link">Throwable</a>> failure)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1"> |
| <div class="block">Creates a callback with the given InvocationType from the given success and failure lambdas.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code>default void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"><code><a href="#succeeded()" class="member-name-link">succeeded</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab5"> |
| <div class="block">Callback invoked when the operation completes.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-org.eclipse.jetty.util.thread.Invocable">Methods inherited from interface org.eclipse.jetty.util.thread.<a href="thread/Invocable.html" title="interface in org.eclipse.jetty.util.thread">Invocable</a></h3> |
| <code><a href="thread/Invocable.html#getInvocationType()">getInvocationType</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <li> |
| <section class="field-details" id="field-detail"> |
| <h2>Field Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="NOOP"> |
| <h3>NOOP</h3> |
| <div class="member-signature"><span class="modifiers">static final</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">NOOP</span></div> |
| <div class="block">Instance of Adapter that can be used when the callback methods need an empty |
| implementation without incurring in the cost of allocating a new Adapter object.</div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="completeWith(java.util.concurrent.CompletableFuture)"> |
| <h3>completeWith</h3> |
| <div class="member-signature"><span class="modifiers">default</span> <span class="return-type">void</span> <span class="element-name">completeWith</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CompletableFuture.html" title="class or interface in java.util.concurrent" class="external-link">CompletableFuture</a><?> completable)</span></div> |
| <div class="block"><p>Completes this callback with the given <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CompletableFuture.html" title="class or interface in java.util.concurrent" class="external-link"><code>CompletableFuture</code></a>.</p> |
| <p>When the CompletableFuture completes normally, this callback is succeeded; |
| when the CompletableFuture completes exceptionally, this callback is failed.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>completable</code> - the CompletableFuture that completes this callback</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="succeeded()"> |
| <h3>succeeded</h3> |
| <div class="member-signature"><span class="modifiers">default</span> <span class="return-type">void</span> <span class="element-name">succeeded</span>()</div> |
| <div class="block"><p>Callback invoked when the operation completes.</p></div> |
| <dl class="notes"> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#failed(java.lang.Throwable)"><code>failed(Throwable)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="failed(java.lang.Throwable)"> |
| <h3>failed</h3> |
| <div class="member-signature"><span class="modifiers">default</span> <span class="return-type">void</span> <span class="element-name">failed</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Throwable.html" title="class or interface in java.lang" class="external-link">Throwable</a> x)</span></div> |
| <div class="block"><p>Callback invoked when the operation fails.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>x</code> - the reason for the operation failure</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="from(java.util.concurrent.CompletableFuture)"> |
| <h3>from</h3> |
| <div class="member-signature"><span class="modifiers">static</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">from</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CompletableFuture.html" title="class or interface in java.util.concurrent" class="external-link">CompletableFuture</a><?> completable)</span></div> |
| <div class="block"><p>Creates a non-blocking callback from the given incomplete CompletableFuture.</p> |
| <p>When the callback completes, either succeeding or failing, the |
| CompletableFuture is also completed, respectively via |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CompletableFuture.html#complete(T)" title="class or interface in java.util.concurrent" class="external-link"><code>CompletableFuture.complete(Object)</code></a> or |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CompletableFuture.html#completeExceptionally(java.lang.Throwable)" title="class or interface in java.util.concurrent" class="external-link"><code>CompletableFuture.completeExceptionally(Throwable)</code></a>.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>completable</code> - the CompletableFuture to convert into a callback</dd> |
| <dt>Returns:</dt> |
| <dd>a callback that when completed, completes the given CompletableFuture</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="from(java.util.concurrent.CompletableFuture,org.eclipse.jetty.util.thread.Invocable.InvocationType)"> |
| <h3>from</h3> |
| <div class="member-signature"><span class="modifiers">static</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">from</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/CompletableFuture.html" title="class or interface in java.util.concurrent" class="external-link">CompletableFuture</a><?> completable, |
| <a href="thread/Invocable.InvocationType.html" title="enum in org.eclipse.jetty.util.thread">Invocable.InvocationType</a> invocation)</span></div> |
| <div class="block"><p>Creates a callback from the given incomplete CompletableFuture, |
| with the given <code>blocking</code> characteristic.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>completable</code> - the CompletableFuture to convert into a callback</dd> |
| <dd><code>invocation</code> - whether the callback is blocking</dd> |
| <dt>Returns:</dt> |
| <dd>a callback that when completed, completes the given CompletableFuture</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="from(java.lang.Runnable,java.util.function.Consumer)"> |
| <h3>from</h3> |
| <div class="member-signature"><span class="modifiers">static</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">from</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> success, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Throwable.html" title="class or interface in java.lang" class="external-link">Throwable</a>> failure)</span></div> |
| <div class="block">Creates a callback from the given success and failure lambdas.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>success</code> - Called when the callback succeeds</dd> |
| <dd><code>failure</code> - Called when the callback fails</dd> |
| <dt>Returns:</dt> |
| <dd>a new Callback</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="from(org.eclipse.jetty.util.thread.Invocable.InvocationType,java.lang.Runnable,java.util.function.Consumer)"> |
| <h3>from</h3> |
| <div class="member-signature"><span class="modifiers">static</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">from</span><wbr><span class="parameters">(<a href="thread/Invocable.InvocationType.html" title="enum in org.eclipse.jetty.util.thread">Invocable.InvocationType</a> invocationType, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> success, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Throwable.html" title="class or interface in java.lang" class="external-link">Throwable</a>> failure)</span></div> |
| <div class="block">Creates a callback with the given InvocationType from the given success and failure lambdas.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>invocationType</code> - the Callback invocation type</dd> |
| <dd><code>success</code> - Called when the callback succeeds</dd> |
| <dd><code>failure</code> - Called when the callback fails</dd> |
| <dt>Returns:</dt> |
| <dd>a new Callback</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="from(java.lang.Runnable)"> |
| <h3>from</h3> |
| <div class="member-signature"><span class="modifiers">static</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">from</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> completed)</span></div> |
| <div class="block">Creates a callback that runs completed when it succeeds or fails</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>completed</code> - The completion to run on success or failure</dd> |
| <dt>Returns:</dt> |
| <dd>a new callback</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="from(org.eclipse.jetty.util.thread.Invocable.InvocationType,java.lang.Runnable)"> |
| <h3>from</h3> |
| <div class="member-signature"><span class="modifiers">static</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">from</span><wbr><span class="parameters">(<a href="thread/Invocable.InvocationType.html" title="enum in org.eclipse.jetty.util.thread">Invocable.InvocationType</a> invocationType, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> completed)</span></div> |
| <div class="block"><p>Creates a Callback with the given <code>invocationType</code>, |
| that runs the given <code>Runnable</code> when it succeeds or fails.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>invocationType</code> - the invocation type of the returned Callback</dd> |
| <dd><code>completed</code> - the Runnable to run when the callback either succeeds or fails</dd> |
| <dt>Returns:</dt> |
| <dd>a new Callback with the given invocation type</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="from(org.eclipse.jetty.util.Callback,java.lang.Runnable)"> |
| <h3>from</h3> |
| <div class="member-signature"><span class="modifiers">static</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">from</span><wbr><span class="parameters">(<a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> callback, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> completed)</span></div> |
| <div class="block">Creates a nested callback that runs completed after |
| completing the nested callback.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>callback</code> - The nested callback</dd> |
| <dd><code>completed</code> - The completion to run after the nested callback is completed</dd> |
| <dt>Returns:</dt> |
| <dd>a new callback.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="from(java.lang.Runnable,org.eclipse.jetty.util.Callback)"> |
| <h3>from</h3> |
| <div class="member-signature"><span class="modifiers">static</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">from</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> completed, |
| <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> callback)</span></div> |
| <div class="block">Creates a nested callback that runs completed before |
| completing the nested callback.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>callback</code> - The nested callback</dd> |
| <dd><code>completed</code> - The completion to run before the nested callback is completed. Any exceptions thrown |
| from completed will result in a callback failure.</dd> |
| <dt>Returns:</dt> |
| <dd>a new callback.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="from(org.eclipse.jetty.util.Callback,java.lang.Throwable)"> |
| <h3>from</h3> |
| <div class="member-signature"><span class="modifiers">static</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">from</span><wbr><span class="parameters">(<a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> callback, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Throwable.html" title="class or interface in java.lang" class="external-link">Throwable</a> cause)</span></div> |
| <div class="block">Creates a nested callback which always fails the nested callback on completion.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>callback</code> - The nested callback</dd> |
| <dd><code>cause</code> - The cause to fail the nested callback, if the new callback is failed the reason |
| will be added to this cause as a suppressed exception.</dd> |
| <dt>Returns:</dt> |
| <dd>a new callback.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="from(org.eclipse.jetty.util.Callback,org.eclipse.jetty.util.Callback)"> |
| <h3>from</h3> |
| <div class="member-signature"><span class="modifiers">static</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">from</span><wbr><span class="parameters">(<a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> callback1, |
| <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> callback2)</span></div> |
| <div class="block">Creates a callback which combines two other callbacks and will succeed or fail them both.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>callback1</code> - The first callback</dd> |
| <dd><code>callback2</code> - The second callback</dd> |
| <dt>Returns:</dt> |
| <dd>a new callback.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="combine(org.eclipse.jetty.util.Callback,org.eclipse.jetty.util.Callback)"> |
| <h3>combine</h3> |
| <div class="member-signature"><span class="modifiers">static</span> <span class="return-type"><a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a></span> <span class="element-name">combine</span><wbr><span class="parameters">(<a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> cb1, |
| <a href="Callback.html" title="interface in org.eclipse.jetty.util">Callback</a> cb2)</span></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small>Copyright © 1995–2022 <a href="https://webtide.com">Webtide</a>. All rights reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |