Our day started with a free coffee from Duke’s Cafe:
There are coffee (and beer) stations all over the place here. You never have to be without caffeine :)
Here is a quick update of my loooong (8 am - 11 pm) day. You can also see some live streaming here
Java EE 7 in Action by Reza Rahman
A nice (and long) session going through actual code examples of the new stuff in Java EE 7. (We are still on 6, but it’s nice to see what’s coming)
The example we went through is also available online for e-study:
Here are some highlights on the updates in version 7:
- JMS (update) to include delayed send, async send (for reactive programming) with the ability to register a callback. New fluent style API. Disable some default headers like message ID. (More in depth detail on the session later in the day on What’s Coming in JMS 2.1)
- WebSockets (new) to have both client and server as part of the spec. This essentially replaces long polling (see comet).
- JSON Processing (new) is the abstraction of json processing, so we decouple from the underlying implementation similar to JAXP for XML.
- Bean validation (upgrade) to now be included in JAX-RS and WebSockets. Adding method validation and custom validation using @Inject. Also allow expressive messaging via EL 3.
- JAX-RS 2 (upgrade) Spec now includes the client API. New message filters and interceptors. Async support. Content negotiation with new qs (quality service) parameter to assign weight. Hypermedia support.
- JPA 2.1 (upgrade) now has schema generation as part of the spec. More support for stored procedures. Entity graphs to allow creating partial populated objects (so finer grained than just LAZY or EAGER loading)
Also see the Aquarium blog for update on the Java EE spec
Prepare for JDK 9
This talk went in detail through the disruptive changes in JDK 9. Mostly w.r.t the new modularity framework to break the JDK up into modules. Really exciting stuff that is coming. We might see less classpath issues in the future :)
For more info see Project Jigsaw (JSR 376)
Some other changes include the removal of some internal classes. You can use the jdeps tool to check your code base for usages of these. Most affected will be:
- sun.misc.BASE64Encoder and Decoder
- sun.misc.Unsafe
There will however be command line flags to allow for backward compatibility.
There is also now an API to access the run-time (vs just looking at rt.jar) as the JDK is now made up of modules and your run-time can be a subset of all modules.
Another interesting change is the removal of ext in the JDK. Extensions will now be done through modules.
CDI 2.0: What’s in the Works?
This talk from the spec leads of CDI took us through the enhancements they are planning for CDI.
CDI 2.0 (or maybe even 2.1) will be aligned with the Java EE 8 release.
Some of the notable enhancements:
- Async support for CDI Event. Because you will lose the context, this will be a new method on the interface.
- Potentially splitting up the spec into 3 parts (CDI Core, CDI for Java SE and CDI for Java EE)
invokedynamic for Mere Mortals
I had an hour before the next session started so I popped into the exhibition hall to have a quick look. Apart from getting to talk to some awesome people there is the added benefit of free swag :)
Invoke Dynamic is a JVM feature typically used by people writing languages on top of the JVM. This talk explained the feature for “normal” developers.
For a list of languages that run on the JVM see this link
Some interesting takes from this talk is that we can potentially use part of this in place of normal java reflection. Not only is this faster than reflection (due to caching of the linkage) but also easier to use.
What’s Coming in JMS 2.1
This talk from the spec lead of JMS took us through the proposed enhancements in the new version of the spec. Unfortunately we are far behind here. Due to only using Jave EE 6 we are still using JMS 1.2 :(
But that just means we will soon be deleting a lot of code - and I like doing that !!
As with all Java API and spec, we (the community) have access to take part in the definitions of these specs. He encouraged us to look at the early draft of the spec and contribute suggestions.
- Alignment with CDI Events.
- Even simpler annotations.
- Better fluent programmatic API
- Multiple callbacks
- Improved Message Beans (even less code needed) with some nice default for common use cases.
- Standardization of some common JMS attributes (that results in new annotations and less code)
- Batch support
High-Performance Java EE with JCache and CDI
Basic but still cool talk on JCache in Java EE. Simply adding @CacheResult to a method can cache the data to improve performance. In this example the cache was backed but Hazelcast and was nicely distributed and elastic. They demonstrated adding and removing of caching nodes and the automatic re-syncing of the data.
@CacheRemove
is also available for removing of cache but it seems like the expiring of cache via some strategy is still limited in the spec and only defined time based strategy. Most implementations however support more strategies like size and count based.
Other options include some callback listeners to then manually expire cache.
Most Popular Java (EE) Q&A: Airhacks.tv Live
This was a live recording of Adam Bien usual Airhacks Q&A session. It should be available online soon. I will then update the post with a link to the video.
Update: https://www.youtube.com/watch?v=cWD0a7f3YxY
High Availability with Java EE Containers, JDBC, and Java Connection Pools
Panel discussion by the developers of the Oracle JDBC drivers. This was interesting but not really applicable to what we are doing (at the moment). Because we usually use OR mappers to access data, we are hidden from this lower level detail. Still interesting to see what is happening under the covers.
Developing a Nonintrusive Annotation-Based Java Monitoring
This was a little bit of a disappointing talk. Very basic and kind of old. We already use newer technology in some of the new code.
See @Trace
and @NotifyAnd**
annotation in our code base.