blob: d4c9eac0224c2c5485d38dafd5c085a9bcb0c85c [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.Basic</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.Basic";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":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.Async.html" title="interface in jakarta.websocket"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../jakarta/websocket/SendHandler.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.Basic.html" target="_top">Frames</a></li>
<li><a href="RemoteEndpoint.Basic.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.Basic" class="title">Interface RemoteEndpoint.Basic</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.Basic</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 synchronously. The
point of completion of the send is defined when all the supplied data has been written to the underlying
connection. The methods for sending messages on the RemoteEndpoint.Basic block until this point of completion is
reached, except for <a href="../../jakarta/websocket/RemoteEndpoint.Basic.html#getSendStream--"><code>getSendStream</code></a> and
<a href="../../jakarta/websocket/RemoteEndpoint.Basic.html#getSendWriter--"><code>getSendWriter</code></a> which present traditional blocking I/O streams to
write messages.
<p>
If the websocket connection underlying this RemoteEndpoint is busy sending a message when a call is made to send
another one, for example if two threads attempt to call a send method concurrently, or if a developer attempts to
send a new message while in the middle of sending an existing one, the send method called while the connection is
already busy may throw an <code>IllegalStateException</code>.</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>java.io.OutputStream</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Basic.html#getSendStream--">getSendStream</a></span>()</code>
<div class="block">Opens an output stream on which a binary message may be sent.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.io.Writer</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Basic.html#getSendWriter--">getSendWriter</a></span>()</code>
<div class="block">Opens a character stream on which a text message may be sent.</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.Basic.html#sendBinary-java.nio.ByteBuffer-">sendBinary</a></span>(java.nio.ByteBuffer&nbsp;data)</code>
<div class="block">Send a binary message, returning when all of the message has been transmitted.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Basic.html#sendBinary-java.nio.ByteBuffer-boolean-">sendBinary</a></span>(java.nio.ByteBuffer&nbsp;partialByte,
boolean&nbsp;isLast)</code>
<div class="block">Send a binary message in parts, blocking until all of the message has been transmitted.</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.Basic.html#sendObject-java.lang.Object-">sendObject</a></span>(java.lang.Object&nbsp;data)</code>
<div class="block">Sends a custom developer object, blocking until it has been transmitted.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/websocket/RemoteEndpoint.Basic.html#sendText-java.lang.String-">sendText</a></span>(java.lang.String&nbsp;text)</code>
<div class="block">Send a text message, blocking until all of the message has been transmitted.</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.Basic.html#sendText-java.lang.String-boolean-">sendText</a></span>(java.lang.String&nbsp;partialMessage,
boolean&nbsp;isLast)</code>
<div class="block">Send a text message in parts, blocking until all of the message has been transmitted.</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="sendText-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendText</h4>
<pre>void&nbsp;sendText(java.lang.String&nbsp;text)
throws java.io.IOException</pre>
<div class="block">Send a text message, blocking until all of the message has been transmitted.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - the message to be sent.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if there is a problem delivering the message.</dd>
<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>void&nbsp;sendBinary(java.nio.ByteBuffer&nbsp;data)
throws java.io.IOException</pre>
<div class="block">Send a binary message, returning when all of the message has been transmitted.
<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 message to be sent.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if there is a problem delivering the message.</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the data is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="sendText-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendText</h4>
<pre>void&nbsp;sendText(java.lang.String&nbsp;partialMessage,
boolean&nbsp;isLast)
throws java.io.IOException</pre>
<div class="block">Send a text message in parts, blocking until all of the message has been transmitted. The runtime reads the
message in order. Non-final parts of the message are sent with isLast set to false. The final part must be
sent with isLast set to true.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>partialMessage</code> - the parts of the message being sent.</dd>
<dd><code>isLast</code> - Whether the partial message being sent is the last part of the message.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if there is a problem delivering the message fragment.</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the partialMessage is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="sendBinary-java.nio.ByteBuffer-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sendBinary</h4>
<pre>void&nbsp;sendBinary(java.nio.ByteBuffer&nbsp;partialByte,
boolean&nbsp;isLast)
throws java.io.IOException</pre>
<div class="block">Send a binary message in parts, blocking until all of the message has been transmitted. The runtime reads the
message in order. Non-final parts are sent with isLast set to false. The final piece must be sent with isLast
set to true.
<p>
It is not safe for other threads to use the ByteBuffer until the sending of this partial message is complete.
If the sending of the partial 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 partial message does not complete
successfully, the state of the buffer is undefined.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>partialByte</code> - the part of the message being sent.</dd>
<dd><code>isLast</code> - Whether the partial message being sent is the last part of the message.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if there is a problem delivering the partial message.</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the partialByte is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="getSendStream--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSendStream</h4>
<pre>java.io.OutputStream&nbsp;getSendStream()
throws java.io.IOException</pre>
<div class="block">Opens an output stream on which a binary message may be sent. The developer must close the output stream in
order to indicate that the complete message has been placed into the output stream. If no calls are made to
one of the <code>write()</code> methods before the output stream is closed then no WebSocket binary messages will
be sent. If at least one call is made to one of the <code>write()</code> methods before the output stream is
closed then at least one WebSocket binary message will be sent even if that message is of zero length.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the output stream to which the message will be written.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if there is a problem obtaining the OutputStream to write the binary message.</dd>
</dl>
</li>
</ul>
<a name="getSendWriter--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSendWriter</h4>
<pre>java.io.Writer&nbsp;getSendWriter()
throws java.io.IOException</pre>
<div class="block">Opens a character stream on which a text message may be sent. The developer must close the writer in order to
indicate that the complete message has been placed into the character stream. If no calls are made to one of
the <code>write()</code> or <code>append()</code> methods before the writer is closed then no WebSocket text messages
will be sent. If at least one call is made to one of the <code>write()</code> or <code>append()</code> methods before
the writer is closed then at least one WebSocket text message will be sent even if that message is of zero
length.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the writer to which the message will be written.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if there is a problem obtaining the Writer to write the text message.</dd>
</dl>
</li>
</ul>
<a name="sendObject-java.lang.Object-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>sendObject</h4>
<pre>void&nbsp;sendObject(java.lang.Object&nbsp;data)
throws java.io.IOException,
<a href="../../jakarta/websocket/EncodeException.html" title="class in jakarta.websocket">EncodeException</a></pre>
<div class="block">Sends a custom developer object, blocking until it has been transmitted. 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.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - the object to be sent.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.IOException</code> - if there is a communication error sending the message object.</dd>
<dd><code><a href="../../jakarta/websocket/EncodeException.html" title="class in jakarta.websocket">EncodeException</a></code> - if there was a problem encoding the message object into the form of a native
websocket message.</dd>
<dd><code>java.lang.IllegalArgumentException</code> - if the data parameter is <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.Async.html" title="interface in jakarta.websocket"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../jakarta/websocket/SendHandler.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.Basic.html" target="_top">Frames</a></li>
<li><a href="RemoteEndpoint.Basic.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>