JBoss AS7 for Spring Developers
Java EE 6 and 7 at JUGICE, Iceland, JFokus 2012, and Umeå JUG, Sweden
After an easy January month, the conference circuit is starting with a tour of the Nordics.
What ? Java EE 6 hands-on workshopDate ? Saturday, Feb 11, 2012
Time ? 9am - 1pm
Where ? Reykjavik University, Fönix (m-105)
Register ? jugice-ag2012-eorg.eventbrite.com
Prep work: Download and Install NetBeans 7.0.1 or later ("All" version) from netbeans.org, JDK 6 latest update from oracle.com/javase.
Twitter: @JUGICE

What ? Java EE 6 hands-on workshop (Feb 13, 9am), PaaSing a Java EE Application (Feb 15, 9am), Java EE 7: Developing for the Cloud (Feb 15, 1pm)
Date ? Monday - Wednesday, Feb 13 - 15, 2012
Time ? All Day
Where ? Stockholm Waterfront Congress Center, Sweden
Register ? jfokus.com (almost sold out, register quick)
Prep work: (For hands-on workshop only) Download and Install NetBeans 7.0.1 or later ("All" version) from netbeans.org, JDK 6 latest update from oracle.com/javase.
Website: jfokus.com
Twitter: @jfokus
Check out my reports from JFokus 2011.

What ? Java EE 6 hands-on workshop
Date ? Thursday, Feb 16, 2012
Time ? 6pm
Where ? Umeå University (Triple-Helix), Umeå, Sweden
Register ? Just show up
Prep work: Download and Install NetBeans 7.0.1 or later ("All" version) from netbeans.org, JDK 6 latest update from oracle.com/javase.
Website: umejug.blogspot.com
Where will I meet or run with you ? :)
Poll: Which HTML5 Refcard Would You Like To See Next?
Continuing Coverage of New Java 7 Features and APIs: Video Tutorials
Playframework + Google Guice
Nexus 2.0 is coming. Join Jason for the first demo.
Join us Tuesday, February 21 at 11:00AM (GMT-0500) for a 30 minute demonstration of Nexus 2.0, with Jason van Zyl, Sonatype Founder & CTO. You’ll see all the new features and learn how Nexus 2.0 will help you:
- Avoid downtime by using a highly available architecture
- Improve repository management with enhanced component information
- Standardize on a single repository for .NET, Java, and OSGi
If you register, you’ll also receive access to the recording after the event. So if something comes up and you can’t make it, you won’t miss out.
Griffon in NetBeans IDE 7.1

Griffon development can now be done in NetBeans IDE 7.1.
Plugin: http://plugins.netbeans.org/plugin/18664/griffon
Sources: http://java.net/projects/nbgriffonsupport
Sneak preview: Navigating from C++ code to Protocol Buffer declaration – in Eclipse

One of the most popular features of protobuf-dt is its integration with protoc, the Protocol Buffer compiler. When this feature is enabled, protobuf-dt invokes protoc to generate Java, C++ or Python code when a .proto file is saved.
A fairly common feature request is navigation from generated code to its declaration in the .proto file. For example, navigating from a generated C++ class that extends ::google::protobuf::Message to the actual declaration of the Message element in a .proto file.
I started working on this feature a week ago and now I’m happy to show off some progress. The following movie demonstrates the following:
- How to enable and configure protobuf-dt’s integration with protoc
- How C++ code gets generated after saving a .proto file
- How to navigate from the generated code to the protocol buffer declaration
To accomplish this code navigation, I created an Eclipse plug-in that acts as a bridge between CDT and protobuf-dt. Navigation from generated C++ code to its declaration in a .proto file is as easy as right-clicking on a C++ element and selecting the menu “Open Declaration in .proto File.”
Under the covers, the bridge plug-in does the following:
- Finds the C++ AST node enclosed in the current cursor position in the active CEditor
- Derives the qualified name and type of the proto element from the qualified name and type of the C++ element found in the AST
- Asks the Xtext index for the URI of the proto element that has an equal qualified name and type
- Asks the Xtext index for the closest match, if the previous step failed
- Asks Xtext to open and select the element under the found URI
Of course, this a over-simplified explanation. For more details, the source code of the bridge can be found here.
ChallengesCreating this plug-in was not too difficult. I think the biggest challenge is reverse-engineering protoc to figure out how navigation from generated C++ code to .proto files should be done. A good example is nested Protocol Buffer messages. When a nested message is compiled to C++, protoc creates a top-level class using underscores in the name to concatenate the names of its ancestors.
For example:

Both the messages Outer_Message.Inner and Outer.Message.Inner will generate a C++ class with name Outer_Message_Inner. In this case, there is no single path for navigating from C++ to Protocol Buffer. Currently we identify this ambiguity and select the first match only. I’m thinking about displaying a dialog showing all the possible options and let the user chose the Protocol Buffer element to navigate to.
Another thing I haven’t figured out is how to enable this menu only for files with names ending with “.pb.h.” Here is how I define the menu in the plug.xml file:
<extension point="org.eclipse.ui.popupMenus">
<viewerContribution
id="com.google.eclipse.protobuf.cdt.cEditorPopup"
targetID="#CEditorContext">
<action
class="com.google.eclipse.protobuf.cdt.ProtobufCdtExecutableExtensionFactory:com.google.eclipse.protobuf.cdt.actions.OpenProtoDeclarationAction"
icon="icons/pb.gif"
id="com.google.eclipse.protobuf.cdt.openProtoDeclaration"
label="Open Declaration in .proto File"
menubarPath="group.open"
style="push">
</action>
</viewerContribution>
</extension>
Any suggestions or hints are appreciated! :)
Road aheadI only scratched the surface of what can be done to integrate C++ and Protocol Buffers in Eclipse. There are still a lot of things to do. In the case of C++-to-Protocol-Buffer navigation, I still need to:
- Figure out how protoc handles letter cases and C++ keywords in Protocol Buffer element names
- Implement message field matching by both qualified name and type (currently matching is done by qualified name only)
- Support navigation for the rest of Protocol Buffer elements: enum literals, groups, rpcs, services and streams
There is also other functionality that would be really useful to have:
- Cross-language refactoring: update all references in generated code when a Protocol Buffer element is renamed.
- Find usages of Protocol Buffer elements in generated code. This functionality can also have other interesting uses. Eclipse can warn a user, before deleting a .proto file, that there are dependencies on the code generated from that .proto file.
For now I’m concentrating on C++. Java support will come next.
SummaryIn this post I have show you some of the upcoming functionality in protobuf-dt. Navigation from generated C++ code to its declaration in .proto files in Eclipse is a handy feature that is finally being implemented. It is not complete yet, but I expect to have a “beta” (or “testing”) release pretty soon.
Feedback is always welcome :)
(Image taken from Calsidyrose’s flickr stream under the creative commons license)Hibernate Search 4.1.0.Beta1: improve Infinispan Query mapping
Hibernate Search version 4.1.0.Beta1 was tagged; the most essential change compared to January's release 4.1.0.Alpha1 was HSEARCH-1034, made to allow Infinispan Query to use the fluent Programmatic Mapping API as already available to Hibernate users.
More changes are being developed: stay tuned for new MassIndexer improvements, some new performance improving tricks, and a fierce discussion is going on to provide a new pragmatic way to define index mappings starting from the Query use cases.
Integrations with InfinispanThe Infinispan project released a new milestone version 5.1.1.FINAL, which is relevant to Hibernate Search users in many ways:
- Hibernate Search can use Infinispan to distribute the index among several clustered nodes.
- JBoss AS 7.1 will use this version as the fundamental clustering technology.
- Hibernate OGM can map JPA entities to Infinispan instead of a database, and use Hibernate Search as query engine and replicate the indexes storing them in Infinispan.
- Infinispan Query uses the Hibernate Search Engine component to make it possible to search across the values stored in Infinispan. All you need to do is add the dependency to infinispan-query, enable indexing in the configuration and either annotate the objects you store in the grid like you would do with Hibernate Search entitites, or define the mappings using the programmatic API.
More details on Infinispan Query can be found in the Infinispan reference, but if you're familiar with Hibernate Search there's not much to learn as they share most features and configuration options as defined on the Hibernate Search reference manual.
The usual links- Download from Sourceforge.
- or get it via Maven artifacts.
- User forums.
- New ideas and suggestions via the mailing list.
- Issue tracker is JIRA; bug reports are welcome, especially those providing patches and/or tests.
- Source code is on GitHub , pull requests welcome.
Make your process your Rock Star, not individuals
Document language identification
Tieing JBoss AS 7 to multiple realities
We had an interesting discussion at FOSDEM about collaboring on a Free and Open Source Software project like JBoss AS 7. To really allow FOSS developers to participate you need to make sure only FOSS build tools and dependencies are used. Anything else and you would raise the bar for your contributors.
An interesting point was the usage of a non-FOSS issue tracker. Should you use an issue tracker which does have free access, but is not FOSS?
Personally I would say: why not? As long as you control and own the data it should pose no real threat. Just make sure the acquired license does allow for an unlimited number of free access.
Using Fedora 17 makes sure your build tools, dependencies and even transitive dependencies are FOSS. But does it lower the bar for contributors?
In actuallity no, because the build tool used (mvn-rpmbuild) and the component set available (latest and greatest only) makes for a different result than upstream. But this does not only go for Fedora (and it's mvn-rpmbuild), it goes for every Maven (or other build tool) project that draws in dependencies.
Looking at building Maven 3.0.3 using Maven 3.0.3 it would download and use maven-artifact 2.0 to 2.0.9, while at runtime it only uses maven-artifact 3.0.3 by its own definition.
Java developers give little thought about the runtime platform where their component is going to run. Regardless of the use of Maven, Gradle or Ant / Ivy. Or running on RHEL, Fedora, Debian or Windows. It will create issues once you want to integrate on a well-defined component set.
So we should really give more thought into where our components are going to run, be it Windows, OS X, Debian, RHEL or Fedora.
And we should try to foster an environment in which all these realities can collaborate.
RHQ CLI over XMPP
Securing Rhino in Java6
Ultra low latency Event Store
There are two basic libraries for managing data in Java, JDBC (for connecting to database) and JMS (for messaging). For some use cases you ideally want both, and you want it to be very fast.
HistoryThis is a redevelopment of a previous project HugeCollections The project is still on hold because its too complex IMHO for what it does. This library is lower level and much simpler to understand. It may become the basis for the higher level HugeCollections library.
The Java Chronicle LibraryThis library attempts to provide ultra low latency, high throughput, persisted, messaging and event driven in memory database with random access to previous messages) The typical latency is as low as 16 nanoseconds (between processes), supporting throughputs of 5-20 million messages per second.
Technical Features
- It uses almost no heap with trivial GC impact regardless of size,
- It can be much larger than your physical memory size (only limited by the size of your disk). and can be shared *between processes* with better than 1/10th latency of using Sockets over loop back.
- You can attach any number of readers, including tools to see the exact state of the data externally. e.g. I use; od -t cx1 {file} to see the current state.
It can change the way you design your system because it allows you to have independent processes which can be running or not at the same time (as no messages are lost) This is useful for restarting services and testing your services from canned data. e.g. like sub-microsecond durable messaging.
Modes of useThe library can be used in two mode. Either as an event driven persisted journal, or as a re-writable random access store.
The main limitations are that it only designed for one writer, and "extracts" or records cannot be made larger once they are written.
Download or Browse the Java Chronicle Library
POJOMapping in Jersey for type-safe clients
Over on his blog, Jason Lee has a detailed post on the new POJOMapping feature in Jersey/GlassFish which offers strongly-typed client API's and illustrates this with a GlassFish Cluster administration sample.
POJOMapping Client/Server Example">
The post shows how to enable POJOMapping with a Jersey servlet initialization parameter and goes on to show the Cluster domain model. An archive with the entire sample is available there.