Tag Archives: javaee7

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

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

Dynamic provider registration in JAX-RS

The DynamicFeature class in JAX-RS (2.0) allows you to register providers Dynamically i.e. without any pre-defined binding strategy (e.g. annotations) Based on criteria i.e. to help decide which provider to bind to which JAX-RS resource(s) The JAX-RS implementation detects and executes … 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

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

Hybrid queries with JPA 2.1

Before JPA 2.1 There were two types of queries Named (static): these are declared using the @NamedQuery or @NamedQueries annotations. Dynamic: as the name suggests, this type of query is specified by the application logic at runtime JPQL, Native SQL as … Continue reading

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

Custom Security Context in JAX-RS

And the JAX-RS juggernaut continues …. This blog briefly talks about how to override the default security related information associated with a JAX-RS request i.e. how to mess with the SecurityContext Wait.. Security Context ? Think of it as a JAX-RS … Continue reading

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

Asynchronous JAX-RS: basics & gotchas

This blog post covers asynchronous programming support in JAX-RS and some of its potential gotchas along with a sample (maven based) Java EE project on Github Man, I tend to blog a lot about JAX-RS and REST ! Basics of server side async … Continue reading

Posted in Java EE | Tagged , , , , | 1 Comment

Efficient JAX-RS: Conditional GETs & PUTs

This post discusses how to leverage features in the JAX-RS API to execute RESTful operations based on conditions/criteria in order to aid with scalability and performance. It covers which HTTP headers are involved which JAX-RS APIs to use details of the entire request-response … Continue reading

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