The WebSocket specification has a client API that connects to a WebSocket server endpoint. You canbuild a very simple client and server chat applications entirely in Java. You can use the commandline as the input interface and the Tyrus project will provide the client and server infrastructure.
- [Instructor] We're going to code the WebSocket client,…but before, let's have a look at the code…that executes on the server side first.…Open up the ChatServer class.…I have this class already opened on my screen.…This class is where we create the actual WebSocket server.…In the main method, you can see that the server…is creating by parsing the host name,…the port on which we want to listen…for WebSocket communications, the route path,…which in this case will be WS,…and the actual server endpoint class.…Once a server has been created, all you need to do…to launch it is to call the start method.…
Now, let's have a look at the server endpoint class.…Load up the class ChatServer endpoint.…I have it already open on my screen here.…You will see that there is absolutely no difference…to the server endpoint that we saw earlier on in the course.…It is defined by the ServerEndpoint annotation,…which accepts the URI endpoint string…and the message coders.…Lifecycle methods have been defined…and annotated appropriately, and the session is stored…
Join Alex Theedom as he guides you through the lifecycle of a WebSocket connection, and discusses the Java EE WebSocket programming methodologies: annotation and programmatic. He shows how to secure and encrypt WebSocket endpoints and use simple techniques to test their implementation. In addition, he explains how to integrate the JSON-processing API and build a front-end and server based WebSocket client.
- WebSocket usage
- WebSocket lifecycle and topology
- WebSocket front end and back end
- WebSocket methodologies
- Annotation methodology and programmatic methodology
- Coding a client API
- Using the JSON Processing API
- Coding the encoder and decoder
- Building the front end
- Testing WebSocket endpoints
Skill Level Intermediate
Java Platforms Compared: SE vs EE vs MEwith Peggy Fisher25m 38s Intermediate
1. Introduction to WebSocket
2. WebSockets Front End and Back End
3. Project Application and Structure
4. Java EE WebSocket API
5. Messages and Encoding
6. Build Web Front End
7. WebSocket Security
8. Testing WebSocket Endpoints
Next steps1m 37s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.