Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJetty Bot2019-02-04 10:25:52 +0000
committerJetty Bot2019-02-04 10:25:52 +0000
commit74633f8c34f977605f59583fa3bdddc85914469d (patch)
tree3fba69250aeddc9740cbb3859469cc345d67cbc3 /documentation/9.4.x/jetty-websocket-api-annotations.html
parent40a0ef90ceb13c136dcf9656a23ad17d8648b626 (diff)
downloadjetty-74633f8c34f977605f59583fa3bdddc85914469d.tar.gz
jetty-74633f8c34f977605f59583fa3bdddc85914469d.tar.xz
jetty-74633f8c34f977605f59583fa3bdddc85914469d.zip
jetty-website: deploy
Diffstat (limited to 'documentation/9.4.x/jetty-websocket-api-annotations.html')
-rw-r--r--documentation/9.4.x/jetty-websocket-api-annotations.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/documentation/9.4.x/jetty-websocket-api-annotations.html b/documentation/9.4.x/jetty-websocket-api-annotations.html
index 614450e4ea..4b4a34f369 100644
--- a/documentation/9.4.x/jetty-websocket-api-annotations.html
+++ b/documentation/9.4.x/jetty-websocket-api-annotations.html
@@ -49,10 +49,10 @@ public class AnnotatedEchoSocket
}
}
}</code></pre><p>The above example is a simple WebSocket echo endpoint that will echo back any TEXT messages it receives.</p><p>This implementation is using a stateless approach to a Echo socket, as the Session is being passed into the Message event as the event occurs.
-This would allow you to reuse the single instance of the AnnotatedEchoSocket for working with multiple endpoints.</p><p>The annotations you have available:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/WebSocket.html" target="_top">@WebSocket</a></span></dt><dd><p class="simpara">A required class level annotation.</p><p class="simpara">Flags this POJO as being a WebSocket.</p><p class="simpara">The class must be not abstract and public.</p></dd><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/OnWebSocketConnect.html" target="_top">@OnWebSocketConnect</a></span></dt><dd><p class="simpara">An optional method level annotation.</p><p class="simpara">Flags one method in the class as receiving the On Connect event.</p><p class="simpara">Method must be public, not abstract, return void, and have a single <a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top">Session</a> parameter.</p></dd><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/OnWebSocketClose.html" target="_top">@OnWebSocketClose</a></span></dt><dd><p class="simpara">An optional method level annotation.</p><p class="simpara">Flags one method in the class as receiving the On Close event.</p><p class="simpara">Method signature must be public, not abstract, and return void.</p><p class="simpara">The method parameters:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top"><code class="literal">Session</code></a> (optional)</li><li class="listitem"><code class="literal">int closeCode</code> (required)</li><li class="listitem"><code class="literal">String closeReason</code> (required)</li></ol></div></dd><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/OnWebSocketMessage.html" target="_top">@OnWebSocketMessage</a></span></dt><dd><p class="simpara">An optional method level annotation.</p><p class="simpara">Flags up to 2 methods in the class as receiving On Message events.</p><p class="simpara">You can have 1 method for TEXT messages, and 1 method for BINARY messages.</p><p class="simpara">Method signature must be public, not abstract, and return void.</p><p class="simpara">The method parameters for Text messages:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top"><code class="literal">Session</code></a> (optional)</li><li class="listitem"><p class="simpara"><code class="literal">String text</code> (required)</p><p class="simpara">The method parameters for Binary messages:</p></li><li class="listitem"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top"><code class="literal">Session</code></a> (optional)</li><li class="listitem"><code class="literal">byte buf[]</code> (required)</li><li class="listitem"><code class="literal">int offset</code> (required)</li><li class="listitem"><code class="literal">int length</code> (required)</li></ul></div></dd><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/OnWebSocketError.html" target="_top">@OnWebSocketError</a></span></dt><dd><p class="simpara">An optional method level annotation.</p><p class="simpara">Flags one method in the class as receiving Error events from the WebSocket implementation.</p><p class="simpara">Method signatures must be public, not abstract, and return void.</p><p class="simpara">The method parameters:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top"><code class="literal">Session</code></a> (optional)</li><li class="listitem"><code class="literal">Throwable cause</code> (required)</li></ol></div></dd><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/OnWebSocketFrame.html" target="_top">@OnWebSocketFrame</a></span></dt><dd><p class="simpara">An optional method level annotation.</p><p class="simpara">Flags one method in the class as receiving Frame events from the WebSocket implementation after they have been processed by any extensions declared during the Upgrade handshake.</p><p class="simpara">Method signatures must be public, not abstract, and return void.</p><p class="simpara">The method parameters:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top"><code class="literal">Session</code></a> (optional)</li><li class="listitem"><p class="simpara"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.12-SNAPSHOT/org/eclipse/jetty/websocket/api/extensions/Frame.html" target="_top"><code class="literal">Frame</code></a> (required)</p><p class="simpara">The Frame received will be notified on this method, then be processed by Jetty, possibly resulting in another event, such as On Close, or On Message.
+This would allow you to reuse the single instance of the AnnotatedEchoSocket for working with multiple endpoints.</p><p>The annotations you have available:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/WebSocket.html" target="_top">@WebSocket</a></span></dt><dd><p class="simpara">A required class level annotation.</p><p class="simpara">Flags this POJO as being a WebSocket.</p><p class="simpara">The class must be not abstract and public.</p></dd><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/OnWebSocketConnect.html" target="_top">@OnWebSocketConnect</a></span></dt><dd><p class="simpara">An optional method level annotation.</p><p class="simpara">Flags one method in the class as receiving the On Connect event.</p><p class="simpara">Method must be public, not abstract, return void, and have a single <a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top">Session</a> parameter.</p></dd><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/OnWebSocketClose.html" target="_top">@OnWebSocketClose</a></span></dt><dd><p class="simpara">An optional method level annotation.</p><p class="simpara">Flags one method in the class as receiving the On Close event.</p><p class="simpara">Method signature must be public, not abstract, and return void.</p><p class="simpara">The method parameters:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top"><code class="literal">Session</code></a> (optional)</li><li class="listitem"><code class="literal">int closeCode</code> (required)</li><li class="listitem"><code class="literal">String closeReason</code> (required)</li></ol></div></dd><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/OnWebSocketMessage.html" target="_top">@OnWebSocketMessage</a></span></dt><dd><p class="simpara">An optional method level annotation.</p><p class="simpara">Flags up to 2 methods in the class as receiving On Message events.</p><p class="simpara">You can have 1 method for TEXT messages, and 1 method for BINARY messages.</p><p class="simpara">Method signature must be public, not abstract, and return void.</p><p class="simpara">The method parameters for Text messages:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top"><code class="literal">Session</code></a> (optional)</li><li class="listitem"><p class="simpara"><code class="literal">String text</code> (required)</p><p class="simpara">The method parameters for Binary messages:</p></li><li class="listitem"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top"><code class="literal">Session</code></a> (optional)</li><li class="listitem"><code class="literal">byte buf[]</code> (required)</li><li class="listitem"><code class="literal">int offset</code> (required)</li><li class="listitem"><code class="literal">int length</code> (required)</li></ul></div></dd><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/OnWebSocketError.html" target="_top">@OnWebSocketError</a></span></dt><dd><p class="simpara">An optional method level annotation.</p><p class="simpara">Flags one method in the class as receiving Error events from the WebSocket implementation.</p><p class="simpara">Method signatures must be public, not abstract, and return void.</p><p class="simpara">The method parameters:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top"><code class="literal">Session</code></a> (optional)</li><li class="listitem"><code class="literal">Throwable cause</code> (required)</li></ol></div></dd><dt><span class="term"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/annotations/OnWebSocketFrame.html" target="_top">@OnWebSocketFrame</a></span></dt><dd><p class="simpara">An optional method level annotation.</p><p class="simpara">Flags one method in the class as receiving Frame events from the WebSocket implementation after they have been processed by any extensions declared during the Upgrade handshake.</p><p class="simpara">Method signatures must be public, not abstract, and return void.</p><p class="simpara">The method parameters:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/Session.html" target="_top"><code class="literal">Session</code></a> (optional)</li><li class="listitem"><p class="simpara"><a class="link" href="http://www.eclipse.org/jetty/javadoc/9.4.15-SNAPSHOT/org/eclipse/jetty/websocket/api/extensions/Frame.html" target="_top"><code class="literal">Frame</code></a> (required)</p><p class="simpara">The Frame received will be notified on this method, then be processed by Jetty, possibly resulting in another event, such as On Close, or On Message.
Changes to the Frame will not be seen by Jetty.</p></li></ol></div></dd></dl></div></div><script type="text/javascript">
SyntaxHighlighter.all()
</script><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="jetty-websocket-api-send-message.html"><i class="fa fa-chevron-left" aria-hidden="true"></i> Previous</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="websocket-jetty.html"><i class="fa fa-chevron-up" aria-hidden="true"></i> Top</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="jetty-websocket-api-listener.html">Next <i class="fa fa-chevron-right" aria-hidden="true"></i></a></td></tr><tr><td width="40%" align="left" valign="top">Send Messages to Remote Endpoint&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html"><i class="fa fa-home" aria-hidden="true"></i> Home</a></td><td width="40%" align="right" valign="top">&nbsp;Using WebSocketListener</td></tr></table></div><p xmlns:jfetch="java:org.eclipse.jetty.xslt.tools.JavaSourceFetchExtension" xmlns:fetch="java:org.eclipse.jetty.xslt.tools.SourceFetchExtension" xmlns:d="http://docbook.org/ns/docbook" xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" xmlns:xslthl="http://xslthl.sf.net" xmlns:gcse="http://www.google.com" xmlns:date="http://exslt.org/dates-and-times"><div class="jetty-callout">
See an error or something missing?
<span class="callout"><a href="http://github.com/eclipse/jetty.project">Contribute to this documentation at
- <span class="website"><i class="fa fa-github" aria-hidden="true"></i> Github!</span></a></span><span style="float: right"><i>(Generated: 2019-01-31)</i></span></div></p></body></html> \ No newline at end of file
+ <span class="website"><i class="fa fa-github" aria-hidden="true"></i> Github!</span></a></span><span style="float: right"><i>(Generated: 2019-02-04)</i></span></div></p></body></html> \ No newline at end of file

Back to the top