There are two programming models available to the enterprise developer. The annotation-driven method and the interface-driven method. Annotations are used declaratively to define endpoints and life-cycle methods and are arguably the easiest and most natural way to construct WebSocket. You candiscuss how to use the annotation methodology to build a WebSocket server.
- [Instructor] Annotations are used to define…endpoints and lifecycle methods,…and are arguably the easiest way…to construct WebSocket endpoints.…Okay, let's dive into the annotation way…of defining WebSocket endpoints.…All configurations are made in the same class,…and it's the same class that defines the lifecycle methods.…Configuration is done…by passing metadata to the annotations,…and this, as you'll see later on,…is quite different to it's implementation…of the programmatic method.…So, the specify that a class represents an endpoint,…we annotate the class at server endpoint,…and pass it the URI of it's endpoint location.…
In this case, the endpoint location is chat,…and we annotate four methods…that will handle the WebSocket lifecycle on open,…on message, on close, and on error.…Each of the four lifecycle methods…accepts at least the session as a parameter,…and the OnMessage method accepts a message object…that contains the message received.…Remember that we touched on the subject…of variables in template URIs.…
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.