Skip to Main Content
Developing Middleware in Java EE 8
book

Developing Middleware in Java EE 8

by Abdalla Mahmoud
June 2018
Intermediate to advanced content levelIntermediate to advanced
252 pages
6h 45m
English
Packt Publishing
Content preview from Developing Middleware in Java EE 8

Designing and implementing the backend

For the backend, we will use a WebSocket endpoint mapped to the URL /booking/{movieId}, as follows:

@ServerEndpoint(value = "/booking/{movieId}", 
                            encoders = {SeatsEncoder.class}) 
public class BookingEndpoint { 
     ... 
} 

Inside the endpoint class, we will define an in-memory database to simulate a database for all available movies. In a real-world implementation, the database would be too complex to maintain movies, available dates and cinemas, and seats for each combination in persistent storage. However, for the sake of simplicity, we will create a HashMap of Integer to boolean[][], where the key will be the movie ID, and the value a two-dimensional array of Boolean values, denoting whether the seat is ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Java EE Development with WildFly

Mastering Java EE Development with WildFly

Luca Stancapiano

Publisher Resources

ISBN: 9781788391078Supplemental Content