Issue #3182 - update documentation to use new location of example files
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
d37dfd4357
commit
7d26acd882
|
@ -23,7 +23,7 @@ A basic adapter for managing the Session object on the WebSocketListener.
|
|||
|
||||
[source, java, subs="{sub-order}"]
|
||||
----
|
||||
include::{SRCDIR}/jetty-websocket/websocket-common/src/test/java/examples/echo/AdapterEchoSocket.java[]
|
||||
include::{SRCDIR}/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/endpoints/adapters/AdapterEchoSocket.java[]
|
||||
----
|
||||
|
||||
This is a convenience class to make using the WebSocketListener easier, and provides some useful methods to check the state of the Session.
|
||||
|
|
|
@ -24,7 +24,7 @@ provided by the Jetty WebSocket API.
|
|||
|
||||
[source, java, subs="{sub-order}"]
|
||||
----
|
||||
include::{SRCDIR}/jetty-websocket/websocket-common/src/test/java/examples/echo/AnnotatedEchoSocket.java[]
|
||||
include::{SRCDIR}/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/endpoints/adapters/AnnotatedEchoSocket.java[]
|
||||
----
|
||||
|
||||
The above example is a simple WebSocket echo endpoint that will echo back any TEXT messages it receives.
|
||||
|
|
|
@ -23,7 +23,7 @@ The basic form of a WebSocket using the link:{JDURL}/org/eclipse/jetty/websocket
|
|||
|
||||
[source, java, subs="{sub-order}"]
|
||||
----
|
||||
include::{SRCDIR}/jetty-websocket/websocket-common/src/test/java/examples/echo/ListenerEchoSocket.java[]
|
||||
include::{SRCDIR}/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/endpoints/adapters/ListenerEchoSocket.java[]
|
||||
----
|
||||
|
||||
This is by far the most basic and best performing (speed and memory wise) WebSocket implementation you can create.
|
||||
|
|
|
@ -38,14 +38,14 @@ To use the WebSocketClient you will need to hook up a WebSocket object instance
|
|||
|
||||
[source, java, subs="{sub-order}"]
|
||||
----
|
||||
include::{SRCDIR}/jetty-websocket/websocket-client/src/test/java/examples/SimpleEchoClient.java[]
|
||||
include::{SRCDIR}/jetty-websocket/jetty-websocket-client/src/test/java/examples/SimpleEchoClient.java[]
|
||||
----
|
||||
|
||||
The above example connects to a remote WebSocket server and hands off a SimpleEchoSocket to perform the logic on the websocket once connected, waiting for the socket to register that it has closed.
|
||||
|
||||
[source, java, subs="{sub-order}"]
|
||||
----
|
||||
include::{SRCDIR}/jetty-websocket/websocket-client/src/test/java/examples/SimpleEchoSocket.java[]
|
||||
include::{SRCDIR}/jetty-websocket/jetty-websocket-client/src/test/java/examples/SimpleEchoSocket.java[]
|
||||
----
|
||||
|
||||
When the SimpleEchoSocket connects, it sends 2 Text messages and then closes the socket.
|
||||
|
|
|
@ -31,7 +31,7 @@ To wire up your WebSocket to a specific path via the WebSocketServlet, you will
|
|||
|
||||
[source, java, subs="{sub-order}"]
|
||||
----
|
||||
include::{SRCDIR}/jetty-websocket/websocket-servlet/src/test/java/examples/MyEchoServlet.java[]
|
||||
include::{SRCDIR}/jetty-websocket/websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/examples/MyEchoServlet.java[]
|
||||
----
|
||||
|
||||
This example will create a Servlet mapped via the http://docs.oracle.com/javaee/6/api/javax/servlet/annotation/WebServlet.html[@WebServlet] annotation to the Servlet path spec of `"/echo"` (or you can do this manually in the `WEB-INF/web.xml` of your web application) which will create MyEchoSocket instances when encountering HTTP Upgrade requests.
|
||||
|
@ -57,7 +57,7 @@ If you have a more complicated creation scenario, you might want to provide your
|
|||
|
||||
[source, java, subs="{sub-order}"]
|
||||
----
|
||||
include::{SRCDIR}/jetty-websocket/websocket-servlet/src/test/java/examples/MyAdvancedEchoCreator.java[]
|
||||
include::{SRCDIR}/jetty-websocket/websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/examples/MyAdvancedEchoCreator.java[]
|
||||
----
|
||||
|
||||
Here we show a WebSocketCreator that will utilize the http://tools.ietf.org/html/rfc6455#section-1.9[WebSocket subprotocol] information from request to determine what WebSocket type should be
|
||||
|
@ -65,7 +65,7 @@ created.
|
|||
|
||||
[source, java, subs="{sub-order}"]
|
||||
----
|
||||
include::{SRCDIR}/jetty-websocket/websocket-servlet/src/test/java/examples/MyAdvancedEchoServlet.java[]
|
||||
include::{SRCDIR}/jetty-websocket/websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/examples/MyAdvancedEchoServlet.java[]
|
||||
----
|
||||
|
||||
When you want a custom WebSocketCreator, use link:{JDURL}/org/eclipse/jetty/websocket/servlet/WebSocketServletFactory.html#setCreator(org.eclipse.jetty.websocket.servlet.WebSocketCreator)[`WebSocketServletFactory.setCreator(WebSocketCreator creator)`] and the WebSocketServletFactory will use your creator for all incoming Upgrade requests on this servlet.
|
||||
|
|
Loading…
Reference in New Issue