Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJetty Bot2020-02-28 17:59:07 +0000
committerJetty Bot2020-02-28 17:59:07 +0000
commit42e3f335f6afa621e165679a4624510c601913f4 (patch)
tree515ddcb9addfcb7a262f8c511e5449b6ff1bc6ed /documentation/9.4.x/jetty-websocket-api-annotations.html
parentc90ac89e860394453c9af2aa1d8397b9a796a45e (diff)
downloadjetty-42e3f335f6afa621e165679a4624510c601913f4.tar.gz
jetty-42e3f335f6afa621e165679a4624510c601913f4.tar.xz
jetty-42e3f335f6afa621e165679a4624510c601913f4.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.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/documentation/9.4.x/jetty-websocket-api-annotations.html b/documentation/9.4.x/jetty-websocket-api-annotations.html
index fce64d1067..6d0cde6cb2 100644
--- a/documentation/9.4.x/jetty-websocket-api-annotations.html
+++ b/documentation/9.4.x/jetty-websocket-api-annotations.html
@@ -3,7 +3,7 @@
<title>Using WebSocket Annotations</title><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><meta name="keywords" content="jetty, servlet, servlet-api, cometd, http, websocket, eclipse, maven, java, server, software"><link rel="home" href="index.html" title="Jetty"><link rel="up" href="websocket-jetty.html" title="Chapter&nbsp;27.&nbsp;Jetty Websocket API"><link rel="prev" href="jetty-websocket-api-send-message.html" title="Send Messages to Remote Endpoint"><link rel="next" href="jetty-websocket-api-listener.html" title="Using WebSocketListener"><link 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" rel="shortcut icon" href="images/favicon.ico"><link rel="stylesheet" href="css/highlighter/foundation.css"><script src="js/highlight.pack.js"></script><script>
hljs.initHighlightingOnLoad();
</script><link type="text/css" rel="stylesheet" href="css/font-awesome/font-awesome.min.css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table 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"><tr><td style="width: 25%"><a href="http://www.eclipse.org/jetty"><img src="images/jetty-header-logo.png" alt="Jetty Logo"></a><br><span style="font-size: small">
- Version: 9.4.26-SNAPSHOT</span></td><td style="width: 50%"></td></tr></table><div 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" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using WebSocket Annotations</th></tr><tr><td width="20%" 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><th width="60%" align="center">Chapter&nbsp;27.&nbsp;Jetty Websocket API<br><a accesskey="p" href="index.html"><i class="fa fa-home" aria-hidden="true"></i> Home</a></th><td width="20%" 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></table><hr></div><div 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" class="jetty-callout"><h5 class="callout"><a href="http://www.webtide.com/">Contact the core Jetty developers at
+ Version: 9.4.27-SNAPSHOT</span></td><td style="width: 50%"></td></tr></table><div 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" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using WebSocket Annotations</th></tr><tr><td width="20%" 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><th width="60%" align="center">Chapter&nbsp;27.&nbsp;Jetty Websocket API<br><a accesskey="p" href="index.html"><i class="fa fa-home" aria-hidden="true"></i> Home</a></th><td width="20%" 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></table><hr></div><div 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" class="jetty-callout"><h5 class="callout"><a href="http://www.webtide.com/">Contact the core Jetty developers at
<span class="website">www.webtide.com</span></a></h5><p>
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ...
scalability guidance for your apps and Ajax/Comet projects ... development services for sponsored feature development
@@ -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.26-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.26-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.26-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.26-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.26-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.26-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.26-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.26-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.26-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.26-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.26-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.26-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.26-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.27-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.27-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.27-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.27-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.27-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.27-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.27-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.27-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.27-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.27-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.27-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.27-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.27-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: 2020-01-17)</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: 2020-02-28)</i></span></div></p></body></html> \ No newline at end of file

Back to the top