blob: bd5224aa386cf9774b2c4b6670abaa13db2102d8 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>RemoteEndpoint.Async</title>
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="RemoteEndpoint.Async";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../jakarta/websocket/RemoteEndpoint.html" title="interface in jakarta.websocket"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../jakarta/websocket/RemoteEndpoint.Basic.html" title="interface in jakarta.websocket"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?jakarta/websocket/RemoteEndpoint.Async.html" target="_top">Frames</a></li>
<li><a href="RemoteEndpoint.Async.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">jakarta.websocket</div>
<h2 title="Interface RemoteEndpoint.Async" class="title">Interface RemoteEndpoint.Async</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="../../jakarta/websocket/RemoteEndpoint.html" title="interface in jakarta.websocket">RemoteEndpoint</a></dd>
</dl>
<dl>
<dt>Enclosing interface:</dt>
<dd><a href="../../jakarta/websocket/RemoteEndpoint.html" title="interface in jakarta.websocket">RemoteEndpoint</a></dd>
</dl>
<hr>
<br>
<pre>public static interface <span class="typeNameLabel">RemoteEndpoint.Async</span>
extends <a href="../../jakarta/websocket/RemoteEndpoint.html" title="interface in jakarta.websocket">RemoteEndpoint</a></pre>
<div class="block">This representation of the peer of a web socket conversation has the ability to send messages asynchronously. The
point of completion of the send is defined when all the supplied data has been written to the underlying
connection. The completion handlers for the asynchronous methods may be called with a different thread from that
which initiated the send.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.jakarta.websocket.RemoteEndpoint">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;jakarta.websocket.<a href="../../jakarta/websocket/RemoteEndpoint.html" title="interface in jakarta.websocket">RemoteEndpoint</a></h3>
<code><a href="../../jakarta/websocket/RemoteEndpoint.Async.html" title="interface in jakarta.websocket">RemoteEndpoint.Async</a>, <a href="../../jakarta/websocket/RemoteEndpoint.Basic.html" title="interface in jakarta.websocket">RemoteEndpoint.Basic</a></code></li>
</ul>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Async.html#getSendTimeout--">getSendTimeout</a></span>()</code>
<div class="block">Return the number of milliseconds the implementation will timeout attempting to send a websocket message.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.util.concurrent.Future&lt;java.lang.Void&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Async.html#sendBinary-java.nio.ByteBuffer-">sendBinary</a></span>(java.nio.ByteBuffer&nbsp;data)</code>
<div class="block">Initiates the asynchronous transmission of a binary message.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Async.html#sendBinary-java.nio.ByteBuffer-jakarta.websocket.SendHandler-">sendBinary</a></span>(java.nio.ByteBuffer&nbsp;data,
<a href="../../jakarta/websocket/SendHandler.html" title="interface in jakarta.websocket">SendHandler</a>&nbsp;handler)</code>
<div class="block">Initiates the asynchronous transmission of a binary message.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.util.concurrent.Future&lt;java.lang.Void&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Async.html#sendObject-java.lang.Object-">sendObject</a></span>(java.lang.Object&nbsp;data)</code>
<div class="block">Initiates the asynchronous transmission of a custom developer object.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Async.html#sendObject-java.lang.Object-jakarta.websocket.SendHandler-">sendObject</a></span>(java.lang.Object&nbsp;data,
<a href="../../jakarta/websocket/SendHandler.html" title="interface in jakarta.websocket">SendHandler</a>&nbsp;handler)</code>
<div class="block">Initiates the asynchronous transmission of a custom developer object.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>java.util.concurrent.Future&lt;java.lang.Void&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Async.html#sendText-java.lang.String-">sendText</a></span>(java.lang.String&nbsp;text)</code>
<div class="block">Initiates the asynchronous transmission of a text message.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Async.html#sendText-java.lang.String-jakarta.websocket.SendHandler-">sendText</a></span>(java.lang.String&nbsp;text,
<a href="../../jakarta/websocket/SendHandler.html" title="interface in jakarta.websocket">SendHandler</a>&nbsp;handler)</code>
<div class="block">Initiates the asynchronous transmission of a text message.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Async.html#setSendTimeout-long-">setSendTimeout</a></span>(long&nbsp;timeoutmillis)</code>
<div class="block">Sets the number of milliseconds the implementation will timeout attempting to send a websocket message.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.jakarta.websocket.RemoteEndpoint">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;jakarta.websocket.<a href="../../jakarta/websocket/RemoteEndpoint.html" title="interface in jakarta.websocket">RemoteEndpoint</a></h3>
<code><a href="../../jakarta/websocket/RemoteEndpoint.html#flushBatch--">flushBatch</a>, <a href="../../jakarta/websocket/RemoteEndpoint.html#getBatchingAllowed--">getBatchingAllowed</a>, <a href="../../jakarta/websocket/RemoteEndpoint.html#sendPing-java.nio.ByteBuffer-">sendPing</a>, <a href="../../jakarta/websocket/RemoteEndpoint.html#sendPong-java.nio.ByteBuffer-">sendPong</a>, <a href="../../jakarta/websocket/RemoteEndpoint.html#setBatchingAllowed-boolean-">setBatchingAllowed</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="getSendTimeout--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSendTimeout</h4>
<pre>long&nbsp;getSendTimeout()</pre>
<div class="block">Return the number of milliseconds the implementation will timeout attempting to send a websocket message. A
non-positive number indicates the implementation will not timeout attempting to send a websocket message
asynchronously. This value overrides the default value assigned in the WebSocketContainer.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the timeout time in milliseconds.</dd>
</dl>
</li>
</ul>
<a name="setSendTimeout-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSendTimeout</h4>
<pre>void&nbsp;setSendTimeout(long&nbsp;timeoutmillis)</pre>
<div class="block">Sets the number of milliseconds the implementation will timeout attempting to send a websocket message. A
non-positive number indicates the implementation will not timeout attempting to send a websocket message
asynchronously. This value overrides the default value assigned in the WebSocketContainer.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>timeoutmillis</code> - The number of milliseconds this RemoteEndpoint will wait before timing out an incomplete
asynchronous message send.</dd>
</dl>
</li>
</ul>
<a name="sendText-java.lang.String-jakarta.websocket.SendHandler-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendText</h4>
<pre>void&nbsp;sendText(java.lang.String&nbsp;text,
<a href="../../jakarta/websocket/SendHandler.html" title="interface in jakarta.websocket">SendHandler</a>&nbsp;handler)</pre>
<div class="block">Initiates the asynchronous transmission of a text message. This method returns before the message is
transmitted. Developers provide a callback to be notified when the message has been transmitted. Errors in
transmission are given to the developer in the SendResult object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - the text being sent.</dd>
<dd><code>handler</code> - the handler which will be notified of progress.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the text or the handler is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="sendText-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendText</h4>
<pre>java.util.concurrent.Future&lt;java.lang.Void&gt;&nbsp;sendText(java.lang.String&nbsp;text)</pre>
<div class="block">Initiates the asynchronous transmission of a text message. This method returns before the message is
transmitted. Developers use the returned Future object to track progress of the transmission. The Future's
get() method returns <code>null</code> upon successful completion. Errors in transmission are wrapped in the
<code>ExecutionException</code> thrown when querying the Future object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - the text being sent.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the Future object representing the send operation.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the text is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="sendBinary-java.nio.ByteBuffer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendBinary</h4>
<pre>java.util.concurrent.Future&lt;java.lang.Void&gt;&nbsp;sendBinary(java.nio.ByteBuffer&nbsp;data)</pre>
<div class="block">Initiates the asynchronous transmission of a binary message. This method returns before the message is
transmitted. Developers use the returned Future object to track progress of the transmission. The Future's
get() method returns <code>null</code> upon successful completion. Errors in transmission are wrapped in the
<code>ExecutionException</code> thrown when querying the Future object.
<p>
It is not safe for other threads to use the ByteBuffer until the sending of this message is complete. If the
sending of the message completes successfully, the buffer's limit will be unchanged and the buffer's position
will be equal to the limit. If the sending of the message does not complete successfully, the state of the
buffer is undefined.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - the data being sent.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the Future object representing the send operation.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the data is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="sendBinary-java.nio.ByteBuffer-jakarta.websocket.SendHandler-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendBinary</h4>
<pre>void&nbsp;sendBinary(java.nio.ByteBuffer&nbsp;data,
<a href="../../jakarta/websocket/SendHandler.html" title="interface in jakarta.websocket">SendHandler</a>&nbsp;handler)</pre>
<div class="block">Initiates the asynchronous transmission of a binary message. This method returns before the message is
transmitted. Developers provide a callback to be notified when the message has been transmitted. Errors in
transmission are given to the developer in the SendResult object.
<p>
It is not safe for other threads to use the ByteBuffer until the sending of this message is complete. If the
sending of the message completes successfully, the buffer's limit will be unchanged and the buffer's position
will be equal to the limit. If the sending of the message does not complete successfully, the state of the
buffer is undefined.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - the data being sent, must not be <code>null</code>.</dd>
<dd><code>handler</code> - the handler that will be notified of progress, must not be <code>null</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if either the data or the handler are <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="sendObject-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendObject</h4>
<pre>java.util.concurrent.Future&lt;java.lang.Void&gt;&nbsp;sendObject(java.lang.Object&nbsp;data)</pre>
<div class="block">Initiates the asynchronous transmission of a custom developer object. The developer will have provided an
encoder for this object type in the endpoint configuration. Containers will by default be able to encode java
primitive types and their object equivalents, otherwise the developer must have provided an encoder for the
object type in the endpoint configuration. A developer-provided encoder for a Java primitive type and its
object equivalent overrides the container default encoder. Progress may be tracked using the Future object.
The Future's get() methods return <code>null</code> upon successful completion. Errors in transmission are wrapped
in the <code>ExecutionException</code> thrown when querying the Future object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - the object being sent.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the Future object representing the send operation.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if the data is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="sendObject-java.lang.Object-jakarta.websocket.SendHandler-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>sendObject</h4>
<pre>void&nbsp;sendObject(java.lang.Object&nbsp;data,
<a href="../../jakarta/websocket/SendHandler.html" title="interface in jakarta.websocket">SendHandler</a>&nbsp;handler)</pre>
<div class="block">Initiates the asynchronous transmission of a custom developer object. Containers will by default be able to
encode java primitive types and their object equivalents, otherwise the developer must have provided an
encoder for the object type in the endpoint configuration. A developer-provided encoder for a Java primitive
type and its object equivalent overrides the container default encoder. Developers are notified when
transmission is complete through the supplied callback object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - the object being sent.</dd>
<dd><code>handler</code> - the handler that will be notified of progress, must not be <code>null</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if either the data or the handler are <code>null</code>.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../jakarta/websocket/RemoteEndpoint.html" title="interface in jakarta.websocket"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../jakarta/websocket/RemoteEndpoint.Basic.html" title="interface in jakarta.websocket"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?jakarta/websocket/RemoteEndpoint.Async.html" target="_top">Frames</a></li>
<li><a href="RemoteEndpoint.Async.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>