Integration between Tapestry 5 and Jini
I am a big fan of Tapestry 5. This version is a huge improvement over version 4.
Recently some integration were committed for support of Spring and Hibernate. I decided that I should spend a bit of time understanding how they were written so that I could write a tapestry-jini integration module.
Two hours later, I have a simple module easing development…
I can now inject proxies of Jini services using the regular @Inject annotation.
Here is how it looks like when you want to inject the proxy of the JavaSpace service:
@Inject("jini:net.jini.space.JavaSpace")
private JavaSpace space;
Could it be easier? :-p
Now, for the fun (and still useful — this is the first reason why I did write this module), I can have my page adapt to the presence of Jini services in the network, and display an alternative HTML chunk if a service is down.
Here is the version when the JavaSpace service is down:

Here is the version when the JavaSpace service is running:

And finally here are the 9 lines (yes, 9 lines only!) of code you need in order to deal with this properly:

I need to improve this module (especially provide support for searches of Jini services based on something else than an interface), but the basic idea is here and ready. And best of all, it offers ease of usage and a good implementation of Jini services lookup (especially using the lookup cache).
So congrats to the Tapestry developers!
March 16th, 2007 at 1:22 am
Could be even more succinct:
Found JavaSpace!
Ooops, we could not find the Jini service!
This will make my pal Greg Burd really happy; he’s always been a Jini fan, fighting the uphill battle against EJB + friends.
Are you really trying to edit the properties or just display them? I don’t think the BeanEditForm has enough context there to properly update the properties when the form is submitted.
March 16th, 2007 at 1:41 am
The markup did not make it through…
Could you send it to me over the ML or at jerome DOT bernard AT gmail DOT com please?
If Greg Burd wants to join in this effort, he is welcomed! :-p
The last part of the comment being linked to Tapestry, I’m gonna answer this on the ML
March 16th, 2007 at 2:22 am
This is so very cool.
I was around at Sun when EJB was coined and Jini arrived on the scene. I was in JavaSoft at the time (I think that was in the 1.04 days). J2EE and EJB were mistakes from the beginning that’s have only partially been corrected since their inception. Jini was inspired work that really broke the mold for distributed service architectures. SOA is recycled CORBA which is recycled RPC with a bit of Spring (the research OS not the Java framework) IDL tossed in. Jini represents the only really new and compelling method for building robust and manageable solutions. Jini suffers from two things. First, Sun’s inept marketing. Second, its only for Java. While Java is popular, it isn’t the only game in town and it never will be so Jini’s concepts need to somehow out grow Java.
Howard is one of those geniuses you only run into every once in a while. Inspired and dedicated I was happy to be there to help him in the early days of Tapestry while we both worked at Primix Solutions. With Tapestry 5 Howard’s really out done himself (again). The demos I’ve seen and the new concepts he’s infusing into Tapestry will make a huge impact. Now all he needs is some community marketing support in the form of a ground swell that makes this Rails movement pale in comparison.
Imagine a Tapestry delivered site where the components of that site were all leased Jini services. To update the site you would expire the leases and let the site predictably fail over. Java Spaces are nifty, but they are simple bit buckets for simple storage. Don’t stop with JavaSpaces. Think through the benefits of leasing, discovery, and negotiated interfaces that come with Jini services then try to integrate that with Tapestry.
Jini now being an Apache project (River, right?) this should be a happy union of compelling technologies and unique techniques in their own rights.
Keep thinking big, and keep coding.
cheers,
-greg
March 16th, 2007 at 2:34 am
Hey Greg,
Don’t be afraid, I’m not limiting this to JavaSpaces
I’m fully using Jini, and in fact my storage is a native XML database (the one from Sleepycat that Oracle bought).
I’m working with Dennis Reedy on the Rio (http://rio.dev.java.net) project too.
And the scenario you are speaking about is the one I’m working on: I am developing a OSS for e-commerce, and guess what? the services will be Rio ones… :-p
I have plenty of idea and will let you know about how this things evolve (I posted a few ideas on the Tapestry ML a few minutes ago).
Thanks for your encouragements!