Monday, December 22, 2008

Zwitscher: JavaME client for Twitter

I have written a little JavaME client for Twitter, called Zwitscher.

Over the weekend I have published a very first version, that is already able to post tweets and to get the friends timeline. So far it is still at a very basic level.

And I have only tested it on my SonyEriccson K610i phone.

If you are interested, you can download the current version from Please provide feedback.

Friday, December 19, 2008

Plugin generator for Jopr/JBossON/RHQ updated

As I wrote previously, I have written a plugin generator for Jopr, JBoss ON and RHQ, which is hosted in the RHQ source tree.

This generator asks a few questions on the command line and creates the necessary directory structure and artifacts depending on the answers.

Since the last posting, I have updated the generator a lot, so that it
is now also able to generate embedded child servers/services and also supports most of the entries in the plugin descriptor.

I have added a dedicated page for the plugin generator in the RHQ wiki.

The old 1.0 version of the binary from the previous post has been removed.

Please provide feedback and report bugs to me.

Btw: If you are new to writing a RHQ plugin, you might want to first check out the "How-To"-Whitepaper.

Tuesday, December 16, 2008

Short Devoxx 08 summary

This post is a summary of a whole week of Java geekdom gathered together in Antwerp, Belgium

The conference was sold out with over 3200 attendees (propably not all did all the 5 days, as I have seen some that only were there on the first two university days). This had an influence on the quality of the Wlan (and the total internet connection) :-/ But in total it was a really good conference. I met a lot of colleagues and other interesting people, learned new things, got three books signed and also delivered three talks.

One of the major focuses of the conference was JavaFX, others were Java 7 with support for dynamic languages and dynamic languages per se.

Of course you can also read my reviews of the individual conference days:

Day 1,
Day 2,
Day 3,
Day 4 and
Day 5

Photo of me at the speakers dinner, of me presenting and here.

Plugin-generator for Jopr, JBoss ON and RHQ

I have written a simple generator that allows to generate plugin skeletons by answering some questions. The generator will afterwards try to generate the respective artifacts. I have added it to RHQ in version 2419. Of course it is also usable in Jopr and JBoss ON.

See below on how to obtain the generator.

Sample run

This is a sample run to create a new plugin called 'test' in my RHQ tree -- user input is marked in bold. Comments at the end of line in italics are mine for explanation. Those will not show up on screen.

$ java -jar rhq-pluginGen-1.0-jar-with-dependencies.jar
Please speficy the plugin root category (Platform, Server, servIce) S What resource category is this plugin using? Most common is server or service.
Please specify its FileSystemRoot: /jon/jonHEAD/rhq/modules/plugins This is the base location of your plugin subtree within RHQ or Jopr
Please specify its PackagePrefix: com.acme.plugins The base in which your plugin should live in. The plugin package itself will be added below it.
Please specify its DiscoveryClass: TestDiscovery The name of the discovery class
Please specify its ComponentClass: TestComponent The name of the component class
Please specify its ParentType: The parent type if this plugin should e.g. be embedded into another one. Can be left empty
Please specify if it should support Monitoring (y/N): y Will the plugin gather measurement data?
Please specify if it should support Operations (y/N): y Will the plugin allow to execute operations on a managed resource?
Please specify if it should support Singleton (y/N): n Is this a singleton kind of server/service? This is e.g. true if it represents a Subsystem with individual resources below it.
Please specify if it should support ResourceConfiguration (y/N): n Will configuration of managed resources be supported?
Please specify if it should support Events (y/N): y Does the plugin gather event type data (e.g. logfile parsing)?
Please specify if it should support CreateChildren (y/N): n Can child resources be created by this server/service?
Please spefify if it should support UsesExternalJarsInPlugin (y/N): y Do you use external chars that need to be put in the plugin?
Please specify its Name: test The name of the plugin. Used for the package, the name and the top level server/service
Please specify its Description: This is a test plugin
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen run
You have choosen:
Props{category=SERVER, name='test', description='This is a test plugin', packagePrefix='com.acme.plugins', discoveryClass='TestDiscovery', componentClass='TestComponent', parentType='', fileSystemRoot='/jon/jonHEAD/rhq/modules/plugins', monitoring=true, operations=true, singleton=false, resourceConfiguration=false, events=true, createChildren=false, children=null}
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen generate
INFO: Generating...
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen createFile
INFO: Trying to generate /jon/jonHEAD/rhq/modules/plugins/test/pom.xml
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen createFile
INFO: Trying to generate /jon/jonHEAD/rhq/modules/plugins/test/src/main/resources/META-INF/rhq-plugin.xml
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen createFile
INFO: Trying to generate /jon/jonHEAD/rhq/modules/plugins/test/src/main/java/com/acme/plugins/test/
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen createFile
INFO: Trying to generate /jon/jonHEAD/rhq/modules/plugins/test/src/main/java/com/acme/plugins/test/
15.12.2008 13:53:19 org.jboss.jopr.pluginGen.PluginGen generate
INFO: Done ..

Please note, that you still need to add the plugin to the parent pom
file - e.g. like this:


Please also note that creation of children (Servers, Services) is not supported in this version.

How to get and start it

The generator lives in modules/helpers/pluginGen. So update your source, go into the directory and compile it via mvn install. To run it, change into target directory and issue java -jar rhq-pluginGen-1.0-jar-with-dependencies.jar as seen above.

For convenience you can directly download the generator from the RHQ wiki (Note: this download can go away any time).

Further reading

I am writing from time to time on my blog about RHQ and have also written a "How to write a plugin" series of posts.

We have compiled this "How to" series into a PDF Whitepaper, that you can download. It might make sense to first having a look at this paper before using the generator.


Please tell me if this generator is useful for you (of course you can also put feature requests in RHQ-Jira).

Sunday, December 14, 2008

x2svg updated to use fop 0.95 final

I have updated x2svg to compile against fop 0.95 final.
There is no new binary release yet, as I wanted to look into some other issues first.

If you are running the source, you can just do a svn update to get this minor change.

Let me know if you encounter issues.

Friday, December 12, 2008

Devoxx08 - day 5

Today is the last day of Devoxx and actually it is only half a conference day and the exhibition floor is closed anyway. Will it be a good day? Yes, of course it will.

In the first session JRuby has been presented and how easily you can write programs in it. JRuby will run most of the 'normal' Ruby programs without change - except those that are using C libraries. But even those can be used with some changes. They also showed the nice integration into NetBeans with auto-completion for a lot of stuff.

Next talk I attended was about WOTE (Write Once Test Everywhere). Brian Leonard talked about developers can effectively test apps without the need to access to lots of extra machines. But first it was a sales pitch for Solaris and OpenSolaris (and other Sun products).

After this he showed how to build a database CRUD application in NetBeans and how to turn it into a Java Web Start application, deploy it via web server and test it outside of the IDE.

The next part was about VirtualBox that he was using to test on a different guest. This part was again a big sales pitch (but then I a biased, as I am using Xen on Red Hat Enterprise Linux for work to test on different guests as well :-)

ZFS allows for Snapshots (like the NetApp filers already allowed over 10 years ago), which is kinda neat, as you can define a file system, run the tests and then roll back to the original maiden state.

I went quickly to the talk about EJB 3.1 - from legacy to secret weapon by Adam Bien. Of course I already had some knowledge, but I finally wanted to see Adam live, which I was never able before.


My last session was "Dynamic Service Management in High resolution monitoring systems". This was about visualizing data on very large screens (up to 16mx6m in size) with equally high resolutions in real time. The first part was again a sales pitch, which was still interesting, as they showed pictures of the installed screens.

After this the talk went more into the technology behind the Digital Mosaic. An interesting idea behind the software is data driven control room management, where they can update the whole wall and update screen layout when an alert arises. Of course it is also possible to just update a value on screen :-)


Picture of a 15mx3m screen

That's it from Devoxx08 - I will probably in the next days post a summary with more pictures from the conference and also from Antwerp, which is a really nice town.

Thursday, December 11, 2008

Devoxx08 - day 4

This conference day started for me with the keynote talk "Effective Java reloaded" by Josh Bloch and "Java SE 7 update" by Mark Reinhold. As the main room was crowded, I went to the overflow room. This feel strange as you see presentation and the speaker on the big screen, but just no one standing in front of you (Josh on that subject of overflow rooms: "You are not missing anything except from the dancing girls").

Josh was giving examples from his 2nd edition of his book about Generics ("Remember your ECS"), Enums (passing data in the constructor, usage of Enums instead of C-style bitfields, use the ordinal method if you really need it and know what you are doing, all Enums are serializable by default - can be used for Serialization-save singletons) and Lazy Initialization (do it only when you need it (fix circularity issue, solve a performance issues), Double check locking works since JVM 5 -- if done right "copy and paste this from the book web site").

Next Mark was talking about SE7 and especially also about project Jigsaw under the new title "The modular java platform". He was talking about Java and the JDK are big and amorphous. Running a simple hello world uses 332 classes and takes around 10 times the execution time than the same on Python. So the idea is to introduce profiles to JavaSE as they have been successful in ME already.
This can also extend into the applications by defining what we have today as a classpath as modules with version information and explicit dependencies (the next image shows a possible module and dependency tree).


Modularization is coming in the form of JSR 294 in JDK 7 (and not as JSR 277, which is not dead, but 'on hold'); OSGi is out of the game because the platform requirements for modularization are to integrate deeply in the VM and the language, but Sun is talking to the OSGi guys to make sure that the modularity work interoperates with OSGi.

In the last part of his talk, Mark was showing a list of potential features for Java 7. Among those are:

  • Modularization - see above

  • JSR 292, VM support for dynamic languages

  • JSR 203, more NIO Apis (e.g. real filesystem api)

  • Small language changes (Sage re-throw, Better type inference, Multi-catch (YAY!!) TBD) -- See blog of Joe Darcy

  • JSR 296 Swing Application Framework

  • Unicode 5 support

  • Upgrade class-loader architecture (-> deadlock prevention)

  • Swing updates

  • G1 garbage collector, HotSpot improvement

  • Thinking about a MVM-lite

  • JSR 308 Annotations on types (e.g. annotate method parameters with @NonNull and have static checkers running on this stuff, much like ItelliJ and Findbugs are doing it with their proprietary annotations).

  • Concurrency and collections updates (see. e.g. yesterday talk by Brian Goetz)

Some features that won't make it into 7:

  • Closures

  • Operator overloading

  • JSR 295, Beans Binding

The next talk I went to was titled "Towards a universal VM" with a subtitle of "The JVM is not just for java anymore" and was given by Brian Goetz and Alex Buckley. Brian was first defining VMs and what they provide and how they help you writing new languages, as you don't have to re-invent stuff like garbage collection etc. A big advantage is here, that Objects of different languages running on the same VM can reflectively call each other. Another big advantage is hat the HotSpot compiler has information about the hardware and can profile class usage etc. to optimize the behavior, which is not possible with static compilers. It also just allows for an easy implementation of a new language, as its compiler just needs to create dumb code and the VM will speed it up nevertheless.
As an example of this Brian showed results of the great ruby shootout dec 2008 where JRuby is the fastest Ruby 1.8 implementation.

The VM only has a basic set of features; other stuff (also in Java) needs to be implemented by the compiler ("language fictions"). Some of those fictions are difficult to implement efficiently (like e.g. Open classes in Ruby).


Brian when signing his book yesterday

Handing over to Alex: This is why JSR 292 is working on a invokedynamic bytecode. In addition there will be a MethodHandle that can point to a block of code. But first before getting to this, Alex was explaining why the current version with invokevirtual is slow and not well suited for other more dynamic languages.

The idea behind invokedynamic is to have the VM call in the user language to consult the dispatching for calls and to trust its result to dispatch then. The good part is that this 'boostrap' code only needs to be called once at the start and after this the direct jump can be inlined and optimized. For all the details you really should go to JSR 292 and / or also watch the recording of this session.

Next to this, Brian was back to talk about the other part of JSR 292, Interface injection. This allows you to modify existing classes to have them implement new interfaces. As an example, this would allow to have java.lang.String also implementing GroovyString. This is also implemented through some bootstrap upcall as just seen before.

There are a few other features in JSR 292, that may or may not make it in Java 7.

John Roses blog (JSR 292 spec lead) talks about all this too.

Next for me was the "JBoss SOA platform overview" by my colleague Mark Little. Mark was having some issues with his presentation template; Did I already mention that white text on light blue background is unreadable? :)

Mark was showing an overview slide of all the possible modules and then listed the features of ESB and the SOA-P(latform) product.

Roberto Chinnici was then giving an "Overview over JEE 6". As I wrote a book on EJB-3 in the past and am a user of JEE 5, this was quite interesting for me. Most of the spec parts are now in public review in the JCP. Goals for EE6 are Easier to use, profiles (full EE, web profile), pruning and extensibility. First profile will be the Web profile. In the future profiles will be defined in the JCP. The current spec just defines the rule on how those profile rules need to work.

A good thing is that the spec is now pruning deprecated stuff. Current candidates are JAX-RPC, EJB 2 Entitiy Beans, JAXR, JSR-88. In consequence this means that they (if confirmed) will be optional in EE 7.

Extensibility means that frameworks (e.g. in the Web tier) can come with a built-in description which is read by the container and which will allow those frameworks to be registered in a zero-conf way in the container (-> web fragments, located in META-INF/web-fragment.xml within the framework).

Another change (especially) in the web tier is to move more to the annotation based configuration by exception development mode.
Proposed components for EE 6 are along with minor updates of others:
  • EJB 3.1 - JSR 318

  • JPA 2.0 - JSR 317

  • Servlet 3.0 - JSR 315

  • JSF 2.0 - JSR 314

  • JAX-RS 1.0 - JSR 311

  • Connectors 1.6 - JSR 322

  • Web Beans 1.0 - JSR-299

  • Bean Validation 1.0 - JSR 303

Also new in Servlet 3.0 (next to the fragments) are annotations for servlets and filters (@WebServlet, @ServletFilter). New is also an async API e.g. for Chat room applications. You need to annotate the Servlet with @WebServlet(asyncSupported=true) and can get a AsyncContext from the ServletRequest on which you can operate. It sounds relatively easy, but can have strange effects on servlet filters, so all filters and servlets need to explicitly enable asynchronous behavior by correctly (re)codig them to support it.

Next were the highlights for EJB 3.1 - I will skip those, as I've written an entry about those in the past already. The only new one are global JNDI names for beans in the form of java:global/(app)/(module)/(bean)#(interface)

EJB components can now also be put directly into Web applications (in the war file).

Within EJB there will also be EJB 3.1 lite, which contains: Session Beans, Tx, Security, Interceptors, ejb-jar.xml. This EJB 3.1 lite can be used in JavaSE and there is a bootstrapping API for this and to embed it e.g. in a Servlet container or in unit tests. EJB 3.1 lite will be in the Web profile.

Current proposed contents of a Web Profile would be
  • Servlet 3.0

  • JSP 2.1

  • JSR-45

  • EL 1.2

  • JSTL 1.2

  • JSF 2.0

  • EJB Lite 3.1

  • JTA 1.1

  • JPA 2.0

  • JSR 250

Still controversial are JAX-RS 1.1, Web Beans 1.0 and JSR 303

Estimated release date for EE6 will be around JavaOne 2009

For the last session of the day I peeked at the Hibernate performance tuning session by Volker Bergmann. Volker points out that there is no silver bullet, but some steps that you can follow to diagnose the issues.

Volker was describing those steps starting from the 10000 feet perspective and drilling down into the details.

One of the nice things of being at such a conference is that one meets people. So for me it is/was great to meet my colleagues. But not only this. I was able to speak with the Jetbrains people about some issues I was having with IntelliJ (I am mostly used to Eclipse an IJ does some things just differently) and they helped me solving those. This is just cool - and I start liking IJ just more and more.

With all the Macs, iPhones and iPods used by Java people, this conference looks a lot like an Apple users conference :)

Btw.: There is a nice photo of mine.

Wednesday, December 10, 2008

Devoxx08 - day 3

JavaFX is strong on Devoxx, so the keynote (that I missed was about it). What I did not miss was the talk "From Concurrent to Parallel" by Brian Goetz - this was about the (possibly) upcoming JoinFork classes in Java 7. Brian was describing that the current thread and concurrency model is not suited for future computers with large number of cpu cores. JF provides some implicit divide-and-conquer algorithm working on a ParallelArray data structure. After his talk he was also signing copies of his book at one of the book stores in the exhibition area (Josh Bloch was also signing copies of his books there, even if his signing session will be tomorrow).

After lunch (there were sandwiches and soup, but when I arrived there was no more soup left), I had a talk with Mark Newton from the and went to the JPA2 session done by Mike Keith. Mike showed us the upcoming features of JPA2 and also a collection of funny signs in Canada. This talk was crowded even if a good part of the people didn't know much about JPA 1 at all.

As I am tired, there will be no photos today - I will supply some tomorrow again.

Tuesday, December 09, 2008

Devoxx08 - day 2

Today was my big day with my two presentations and the quickie session.

But first I started off with some real good coffee at my very nice hotel :) When I arrived at Devoxx, the exhibition floor was already crowded with people enjoying breakfast there and playing table soccer at the JBoss booth.



People at breakfast

I went to the "Java Performance Tooling" presentation by Kirk Pepperdine and Holly Cumminns. They really approached the topic in a funny and very knowledgeable way. Key point to successful performance tooling is to use the right methodology. The two were showing and explaining this with lots of fun, examples and demos.


If you have the chance to get the video after the conference, make sure to take the time to watch is and learn from it (there are a few spots, where you can press fast forward :). But I have definitively learned from this session.

Next for me after this talk was Quickie "I spy something ... and it's a bug". When I came into the room, the person doing the previous quickie talk had not even started due to technical issues, so I was only able to start at the time I was supposed to finish. Luckily there was time left after my presentation, so I went through the slides a little quicker - the actual code demo was exactly right. I got some good applause and also some feedback about the issues presented from the audience. One of the feedbacks was that I'd probably enjoy the "Java Puzzlers" book - will check it out.

I took some of the time until my next talk to prepare for it - the conference network is sub-obtimal and relying on it being present is no good idea for a talk.

My other two talks went well as well. The RHQ one attracted around 50 people and the Profiler one around 300. I got good and positive feedback for both and was actually talking to some folks about Jopr and RHQ later on and showing them more at our booth. I hope that there will be more questions to come.

Here are some more pictures from the exposition floor:




There are actually a lot of photos online at

Luckily I got rewarded for all the pain and hassle :-) by the speakers dinner in the Pakhuis brewery....

Monday, December 08, 2008

Devoxx08 - day 1

Pheww this first conference day started early for me: I got up at 4am (actually even woke up earlier) and left Stuttgart with the train at 5:51am. I had to change trains in Cologne and Brussels and finally arrived in Antwerp around noon. Antwerp has a great main station that goes over several levels and where a modern station has been integrated in the historical one:


Made a quick stroll to the hotel to drop my stuff and headed to Metropolis. Before doing that, I walked under the Schelde river - there is a pedestrian tunnel starting right in front of my hotel. To get down into the tunnel you can take the elevator (meant for cycles) or alternatively an escalator with wooden stairs. Way cool.


There is a tram going directly to the front door of Metropolis; tram tickets are actually quite cheap over here -- 15 € for a 5 days ticket for all of Antwerp.

After registration (which was quick) I went to our booth, which Noel and Tobias were just building. A few other colleagues also joined later - most notably the team, Sacha and Emmanuel Bernard.



I've been in Emmanuel and Max' talks and it is really impressing when you see them talking in front of the big screens and the huge audience (the rooms have 400 seats ..)



Thursday, December 04, 2008

Devoxx I am coming

Only four more days until Devoxx 08. I am just finalizing my presentations for my two Tools in Action talks:

I am also giving a little Quickie session on the 9th:

As I will be at Devoxx for the whole conference, you will also be able to reach me at the JBoss booth, where I'll be happy to talk about JBoss ON, RHQ and Jopr.

I will try to post updates about the confernce here on this blog and will also do some twittering about it.

Tuesday, December 02, 2008

Whitepaper on how to write a plugin for JBossON, Jopr and RHQ available

I am very pleased to announce that Red Hat has published my plugin development series as white paper. This document got real formatting from the Red Hat creative team - and it is looking just great. I am very pleased with it. The following is a screen shot of the title page and if you want to see more, you have to download it :)


Image of the title page of the paper

You can get the paper from those locations:

Many thanks to the Creative team for going over my "rough" text in OpenOffice and making this look so great. I also want to thank Chris Morgan for his work, as well as my colleagues who have read the paper and have given me hints on how to improve it.

Monday, December 01, 2008

Dzone interview with Greg Hinkle on Jopr and JBoss ON

Dzone has done an interview with Greg Hinkle, the project lead for JBoss ON, RHQ and Jopr.

The interview is available as a 23 minutes talk as well as in the form of a transcript. You can read it and listen to it on the Dzone site.