Tag Archives: websocket

WebSocket endpoint as Singleton EJB

By default … … a WebSocket implementation creates a new (server) endpoint instance per client. In case you need a single instance, you can implement this using a custom ServerEndpointConfig.Configurator (by overriding the getEndpointInstance method) The catch: you might have to sacrifice some … Continue reading

Posted in Java, Java EE | Tagged , , , , | Leave a comment

New release: Java WebSocket API handbook

Happy to announce the initial release of the Java WebSocket API handbook. This is still a work in progress but moving at a strady pace. You can read this on Gitbook or grab your PDF/ePub/Mobi version from Leanpub   Here is … Continue reading

Posted in Java, Java EE | Tagged , , , , , | Leave a comment

Using Asynchronous timeouts in the Java WebSocket API

Sending messages in an asynchronous manner avoid blocking the sending thread. This is a great where your solution needs to scale in order to support a large number of clients. But there is a limit on how long can we … Continue reading

Posted in Java, Java EE | Tagged , , , , , | Leave a comment

WebSocket and CDI integration.. again..

In one of my older blog posts, I had written about what does not work as far as WebSocket and CDI integration within the Java EE Platform 😉 This one talks about what’s possible with CDI in terms of Dependency Injection Interceptors … Continue reading

Posted in Java, Java EE | Tagged , , , , , , , | 3 Comments

Configuring WebSocket server endpoints

WebSocket Server endpoint configuration Before we dive into the details, here is a quick snapshot of the related interfaces Class/Interface Description ServerEndpointConfig A derivative of EndpointConfig interface which is specific for configuration related to server side WebSocket endpoints ServerEndpointConfig.Configurator An … Continue reading

Posted in Java, Java EE | Tagged , , , , | Leave a comment

Deploying WebSocket annotated & programmatic server endpoints together

One of my previous blog post discussed Programmatic WebSocket endpoints and their deployment methodology using the javax.server.ServerApplicationConfig class. When annotated and programmatic endpoints co-exist… you have to make use of the a custom implementation of ServerApplicationConfig and explicitly return set … Continue reading

Posted in Java EE | Tagged , , , | Leave a comment

Java Websocket containers: the possibilities

The Java Websocket API (JSR 356) specification supports different containers Good old Java EE 7 app servers – since Websocket API is integrated directly into the Java EE 7 Platform Servlet 3.1 containers Standalone containers – for runtimes which are … Continue reading

Posted in Java EE | Tagged , , , , , | Leave a comment

Programmatic Websocket endpoints in Java EE 7…

This post briefly demonstrates how to develop and deploy (server and client) Websocket endpoints using the programmatic version of the Java Websocket API To begin with… extend the javax.websocket.Endpoint class Let’s code the client endpoint as well (using the same set of … Continue reading

Posted in Java EE | Tagged , , | 2 Comments

Java WebSocket API: difference b/w Endpoint and RemoteEndpoint

If you encounter the Endpoint and RemoteEndpoint artefacts from the Java WebSocket API for the first time, you might think they represent the same concept or you might even guess that they are hierarchical in nature. It is not the … Continue reading

Posted in Java, Java EE | Tagged , , , | Leave a comment

WebSocket Client API in Java EE 7

In this post, let’s explore the less talked about Web Socket Client API and how to leverage it within a Java EE 7 container itself Web Socket Server API rules The server side API of JSR 356 (Web Socket API … Continue reading

Posted in Java, Java EE | Tagged , , , , , | Leave a comment