Using Server Sent Events and the GlassFish REST Interface

Wikipedia defines Server-Sent Events as "a technology for providing push notifications from a server to a browser client in the form of DOM events. The Server-Sent Events EventSource API is now being standardized as part of HTML5 by the W3C." It’s a great alternative to polling the server for updates. Long story short, thanks to the work of the Jersey team, we have "easy" access to this in GlassFish, and we.....

Read More ›

Maven Project Version from the Command Line

A friend asked me today how to get a project’s version out of a Maven POM file without having to read and parse it. A quick Google search brought up the answer, which I thought I’d share here. The short answer is this: $ mvn help:evaluate -Dexpression=project.version [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building GlassFish Admin REST Service 4.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-help-plugin:2.....

Read More ›

Yum Pseudo-Transactions

If you follow me on Twitter, you may have seen that I’ve been looking for a good media player. This long, painful process involved installing project Foo, along with its 87 dependencies, only to see that I didn’t like it, then running into the same thing with Bar and Baz. Now I have a ton of packages installed that I don’t need, which will irritate me as I think.....

Read More ›

Converting Many Images to One PDF

I recently had the need to convert several scanned images into one multi-page PDF. While there are probably tools to help do this manually, I knew that there was a good chance I’d have to do something like this again, quite possibly with a large number of images, so I did what any good geek would do: I scripted it. In this entry, I’ll show how I went about that.....

Read More ›

Annotation Processing the New Way

I recently ran into an issue with our dependency injection system: it won’t return a list of interfaces, only implementations. That system, for what it’s worth, is HK2, but CDI has the same "problem". Since the rest of the system worked using these interfaces, I really wanted to solve the discoverability issue rather than redesigning that part of the system. After considering and playing with a Maven plugin, I opted to.....

Read More ›

A New Way to Blog

On the Sunday before the recent JAX conference in San Francisco, I was privileged to attend the Speakers' Summit with many of the other speakers for that week. There was a lot of really good discussions, but the biggest thing I took away from it, or at least the most practical, came from Dan Allen’s lightning talk on documentation and removing the pain. That five minute talk stands a good chance of changing.....

Read More ›

Writing Pluggable Java EE Applications, The Explanation

I recently posted the slides and the source code from the presentation I gave at JAXConf San Francisco. While that’s helpful for those who were in my session, it’s probably less so for those who weren’t. What I’ll do in this post, then, is discuss the slides and code in detail, skipping over the introductory slides, and getting right to the heart of the matter. The idea.....

Read More ›

Writing Pluggable Java EE Applications

I just finished giving my session at JAXConf San Francisco 2012, "Writing Plugged-In Java EE Apps". I think it went pretty well, though I guess I’ll find out how it really went when the reviews come in. :) Either way, I had a great time. As promised, here is a tar ball that includes the code we looked at during the session, as well as the accompanying slides. Hopefully I’ll be.....

Read More ›

Firefox, Linux, and the Java Plugin

In a perfect world, Firefox, Linux and the Java plugin would get along happily. You’d install all three, and things would just work. If memory serves, that’s exactly what happened under Ubuntu. However, after installing Fedora 17, it just didn’t want to work for me (I’m not blaming Fedora, mind you. I like to live on the bleeding edge, so I install Java 7 nightlies from tar.....

Read More ›

From OS X to Linux

When I joined Sun Microsystems "way back" in 2008, I was asked if I wanted a Mac for my work system. Having heard many extol the numerous virtues of the OS, I jumped at the chance. Since then, I’ve even migrated my wife and family to the OS. Trouble arose last fall, though, with the delivery of a new MacBook Pro (whose purchase was somewhat a miracle, brought about by the tireless efforts.....

Read More ›