Bistro!
Alexis Moussine-Pouchkine's Weblog
public enum Topic { Java, GlassFish, Tools, Sun, InFrenchInZeText, SDPY }

20091109 lundi novembre 09, 2009

javax.annotation.ManagedBean

You might have hear or "managed beans" before, but chances are these will be new to you. These are not specific to JSF and not related to JMX in any way. Rather, Java EE 6 (well EJB 3.1 to be precise) specifies Managed Beans 1.0, or lightweight components.

Managed beans are plain old java objects whose life-cycle is governed by the container (allowing for creation and destruction callbacks) and supports resource injection (and of course can themselves be injected). To define a managed bean, you simply need to annotate a class with @java.annotation.ManagedBean. You can apply the existing (JSR 250) @PostConstruct and @PreDestroy annotations to methods in that bean and inject resources using @Resources (as well as with @EJB or @WebServiceRef). Here's a simple example :

@javax.annotation.ManagedBean
public class MessagesBean {
    @Resource
    TranslationBean localizer;

    @PostConstruct
    public void myInit() {
        System.out.println("*** Constructed!");
        // Do something useful
    }

    public String getTranslatedMessage(String message) {
        return localizer.translate(message);
    }
}

Such a class can then be deployed within a WAR, an EJB-JAR or an ACC-JAR and can be injected within another Managed Bean, a servlet, an EJB or a JSF Managed Bean using a simple @Resource MessagesBean bean; statement. Life-cycle and injection in itself is nice but it gets even better with interceptors which can also be applied to managed beans (no longer to just EJB's) :

@Interceptors(LogInterceptor.class)
@javax.annotation.ManagedBean
public class MessagesBean {
     ...
}

Whether Managed Beans will be used directly by application developers or mostly for building higher level abstractions such as EJB's (transactional managed beans in a sense), JAX-WS endpoints (SOAP-enabled managed beans) or JSR 299 is yet to be defined. You decide.

You can of course try all of the above in GlassFish v3.

( nov. 09 2009, 09:19:56 AM CET ) Permalink Comments [1]

20090502 samedi mai 02, 2009

SDPY - Java EE 5 is 3 years old

Java EE 5 is 3 years old. GlassFish v1 will hit the same milestone in a few days.
Java EE 6 and GlassFish v3 are scheduled for the fall with an interim release of the app server at JavaOne next month.

( mai 02 2009, 11:56:57 AM CEST ) Permalink

20090426 dimanche avril 26, 2009

Antonio's book on Java EE 6 (and GlassFish v3)

Antonio Goncalves seems to have just shipped his work for his new Java EE 6 book. It sounds like the very first one to cover this topic which is quite a challenge given the specification will be final only in a few months. In the mean time, I wish Antonio the best for JavaOne sales! He's certainly very well positioned to write such a book - at the heart of the matter, yet not a "vendor" but rather a exemplary Java community member.

GlassFish v3 as covered in this book (great to have GlassFish be part of the title!) is also a moving target since "Prelude" was released last year with a Java EE 5 web container and previews of EJB 3.1 and JSF 2.0 available via the update center. In the mean time, only promoted builds of the Java EE 6 work have been made available, so I hope Antonio will have a chance the refresh the content when Java EE 6 and GlassFish v3 ship later this year in a second edition of the book.

( avr. 26 2009, 10:04:35 PM CEST ) Permalink

20090119 lundi janvier 19, 2009

Random Java performance podcast comments

I was recently listening to this JavaWorld podcast on Java scalability and was surprised to hear a few things (hopefully well paraphrased here) :

"Java is not the best choice given its threading model and synchronizing". I just don't understand that statement. Still Java 5's concurrency API is still under-used by many IMO.

"30 seconds GC pauses are common". Really? This sounds like 2000. Are you still seeing GC pauses above 10 seconds? There's now multiple GC algorithms to chose from and default options now provide really good performance in a large majority of setups.

"Real-time Java is around the corner and will fix many latency issues". Real-time java is really not the issue to most web site scalability or latency issues. Maybe the garbage-first GC scheduled for Java 7 will be an easier answer than the current required JVM tuning.

"ORM's are not needed, straight JDBC is better for scalability". I can't help but think that this can apply to only a handful of popular web sites. For everyone else, frameworks like JPA are just no-brainers.

"More generally speaking, frameworks are bad for performance and scalability". I think some stack-traces can be indeed intimidating. Frameworks should strike a good balance between productivity and out-of-the-box performance. Tuning expertise for a given framework is usually a function of the popularity of that framework while some popular frameworks are known to have scalability issues.

"Application servers are not a good idea because they mix business logic and web requests... a JVM should suffice". I am a strong believer in multi-tiered architectures and stateful applications so this sounds very wrong to me. The notion of a container is one of the most important break-through in recent years for productivity, transactions, persistence, and scalability. Clearly I don't buy or even really understand this assertion.

Performance and scalability objectives can justify to de-normalize the architecture (much like you would for database schemas) but while this podcast has value, I don't believe most developers should follow every recommandation in this podcast right off the bat.

( janv. 19 2009, 06:08:23 PM CET ) Permalink Comments [4]

20090116 vendredi janvier 16, 2009

Two JUG events in two days

I presented on Tuesday at the Paris JUG. As previously reported by JBoss' Sacha, this JUG is really doing well - great attendance (200+ every single month), very fine question during and after the the talks, and several people reporting in details what they heard and learned in various blogs (this one for instance). Luckily the beamer Gods were with us and almost all demos worked. Antonio Goncalves (JUG leader, book author, and JSR EG member) presented on Java EE 6 before I took the stage with a GlassFish v3 Prelude presentation. The combination of compile-on-save, deploy-on-change and session preservation across redeployments was what most people liked it seems. From the questions and comments I think more people realize that in those difficult times, the Open Source application server alternatives are very real and that GlassFish has a lot of thinks going for it.

On the next day I was at the inaugural Riviera JUG meeting. Not as crowded as the Paris event but some very good discussions. The Lunatech Research guys (organizing the event and the JUG) are clearly very JBoss-friendly but I think I got them pretty excited about GlassFish (the question during diner was along the lines of "should we switch to GlassFish?"). There were several technical questions asked (OSGi, session preservation, etc..) and a business one around the commercial (I wish I could share all the customer wins, some are really significant...). eXo's Julien Viet did a nice presentation with a full section on integration between portlets and various web frameworks. With his JBoss background and connections he's of course always an interesting guy to talk to even if I'm not sure I agree with his analysis "JBoss has a superior kernel design" assertion! :)

Time spent in JUG meetings as a speaker or as an attendee seems to be always well spent! Slides are posted here: http://www.parisjug.org/xwiki/bin/view/Meeting/20090113

Blogs on the Paris evening (in French): #1, #2, #3, #4

( janv. 16 2009, 02:48:25 PM CET ) Permalink

20081223 mardi décembre 23, 2008

JUG, JUG, JUG

It's been a heck of a year for JUGs in France. 2008 started with only one physical (java.developpez.com is a great virtual JUG) and aging JUG with almost no activity and we are now, 12 months later, with no less than 8 JUGs country-wide!

The ParisJUG was the first one (it already averages around 180/200 attendees every month) and others quickly followed: Breizh JUG (Rennes), Tours, Grenoble JUG, Bordeaux JUG, Nantes JUG, Lorraine JUG (Nancy?), and last but not least the RivieraJUG (Nice)!

I also hear rumors of something going on in Toulouse. I'm sure we can do even better with Lille, Lyon, Marseille, Clermont-Ferrand, ... Given the hard task of running a JUG (getting a venue, speakers, not upsetting anyone with the content or the sponsors, etc...) the goal of still being at 8 active JUGs next year would be a good one IMO.

I'll be speaking about GlassFish v3 Prelude in Paris and Sophia Antipolis in January :
14 janvier 2009 @ Sophia-Antipolis: Mini-conférence Java EE. Great to be back there after a long hiatus (darn, Tiger seems like ages ago!).
Soirée Java EE 6 (13/01/2009). Doing this one with Antonio Goncalves.

Just like elsewhere, the java community is alive and well (in case anybody asks!).

( déc. 23 2008, 12:55:19 PM CET ) Permalink Comments [2]

20081010 vendredi octobre 10, 2008

One more appserver doing Java EE 5

So it appears WebSphere 7 has been released. Reading this list of new features, I find some interesting management stuff but wonder how many people will actually use it. It also feels kinda odd to see EJB3 examples I was using 3 years ago evangelizing Java EE 5. Still, it's great to have another Java EE 5 product in the industry. I guess JBoss is last... Oh no, still waiting for JOnAS too :)

( oct. 10 2008, 09:32:55 PM CEST ) Permalink Comments [1]

20080828 jeudi août 28, 2008

SDPY 2006 - licence pour Java Open Source


•   Java Open Source - Votre avis nous intéresse! (Mon, Aug 28, 2006)
Sun a annoncé que la licence utilisée pour la mise en Open Source de Java serait une licence OSI....

Pour être tout à fait honnête, à cette époque déjà (quelques mois avant l'annonce publique), la GPL tenait déjà bien la corde. Ce qui est intéressant dans la relecture de ce billet, c'est le commentaire de bjb qui avait presque tout juste. Avec un peu plus de temps GPLv3 aurait été un bon candidat, mais le risque était trop grand sans un minimum de recul sur l'usage de cette nouvelle licence. Depuis, OpenOffice a annoncé son adoption de la GPLv3.

( août 28 2008, 10:01:39 AM CEST ) Permalink

20080718 vendredi juillet 18, 2008

Stuff that happened while I was away...

I'm back from almost 2 weeks off. While I was away on vacation, many others were busy:
• NetBeans 6.1 released Patch 2 and NetBeans 6.5 Milestone 1 (PHP included) also shipped (do people in Prague ever take a break?)
VisualVM 1.0 ships and is part of the Java 6 Update 7 release ! (some background here). Notice it's a NetBeans RCP app and that it features the NetBeans profiler.
Python in NB !
• Former Sun and startup colleague Vincent launched http://www.jspresso.org/. I like the name, now I need to check out if I like this "end2end" framework.
EclipseLink 1.0 ships (and is now in GFv3 nightly builds)
OpenDS 1.0 shipped!. Congratulations Grenoble!
• First SPECjvm2008 Result Published!
MEP (Mobile Enterprise Platform) 1.0 released (GlassFish + Mobile Sync technology + JavaCAPS connectors). SyncML is now called OMA DS btw.

Now that's a lot of stuff including many releases but so little time...

( juil. 18 2008, 11:35:41 AM CEST ) Permalink

20080629 dimanche juin 29, 2008

Jazoon trip report

This wiki page has the agenda and the slides for the presentations given during the GlassFish Day at the Jazoon conference earlier this week. Audio for some of the session should be released on the GlassFish Podcast in the next few weeks.

We had a nice, participating crowd throughout the day. I'd like to thank all the speakers for making their presentation different from the Jazoon one. All the talks had many good questions but I'd say Jersey, Comet/IceFaces, JavaEE, and v3 triggered the most. IceFaces' Ted Goddard did a comprehensive Comet presentation as well as the SailFin demo with a page of all the SIP phones registered updated on the fly. Paul Sandoz had a demo-mostly session on JAX-RS/Jersey that went very well. Roberto Chinnici had a good feedback session on JavaEE. Interestingly OSGi as a developer-exposed API didn't trigger any interest from this crowd.

In Jerome's v3 talk, only 5 people or so had seen a GlassFish v3 demo before. Sometimes we take for granted that most people have seen the various JavaOne keynotes and associated screencasts. Overall 45-minute sessions worked well (thanks to all the speakers for making it work). We stayed on track for the entire day (9am-3pm). Oh and by the way, the conference had great Wifi (worth noting as I never had this at any conference).

Finally some interesting statistics from the participants:
• Half of the attendees were GlassFish users.
• 80% of all the attendees use Java EE 5 (the rest probably can't).
• Top 5 features for GF (ranked): JPA, Rest (Jersey), EJB3, Metro Web Services, Clustering
• Top 3 resources to get information (ranked): Documentation, Forums & mailing lists, TechTips & Articles.

( juin 29 2008, 09:00:09 PM CEST ) Permalink Comments [1]

20080601 dimanche juin 01, 2008

Blog Alti - draggable applets

Un des moments forts de cette JavaOne 2008 du mois dernier fut Java 6 Update 10. Que cela soit utilisé par JavaFX ou tout simplement par des applications Web Start ou des applets existantes, Patrick Champion d'Alti vous explique en détails comment reproduire la fonction démontrée qui consiste à sortir une applet de sa page web pour la transformer en application Java Web Start indépendante du navigateur. Le tout en français dans le texte.

( juin 01 2008, 11:09:19 PM CEST ) Permalink

20080501 jeudi mai 01, 2008

Any announcements left for JavaOne?

It really seems that this year, announcements are happening before JavaOne.
Here's what I have so far (I'm sure I missed some, adding as we go):
GlassFish v3 does OSGi
NetBeans 6.1 released
Spring Application Platform
Java 6 on the Mac (late, but still faster than JBoss on Java EE 5 ;)
OpenJDK 6 in Fedora and Ubuntu
Embedded GlassFish
XWikiWorkspaces

Hum, I'm wondering if they were all planned long in advance or somehow related one to another...
Anyway, plenty more to come at JavaOne I'm sure. Full speed ahead!

( mai 01 2008, 06:49:59 PM CEST ) Permalink Comments [4]

20080428 lundi avril 28, 2008

A Tours le 14 mai 2008

JavaOne c'est la semaine prochaine et le compte-rendu de ce qu'il se sera dit c'est à Tours au "Toursjug" le 14 mai 2008 à 19h (avec un peu de GlassFish au passage).

( avr. 28 2008, 09:44:13 PM CEST ) Permalink

20071218 mardi décembre 18, 2007

Yet Another Successful JavaPolis

JavaPolis is over and it was yet another great event. I've had many people tell me they liked it more than JavaOne. It must be either the comfy theater chairs or the size of the conference (easy to talk chat with speakers and conference attendees).

It must be a habit of releasing NetBeans versions for JavaPolis (4.0 in 2004). This time NetBeans 6.0 is really here and what a distance between those releases!

My GlassFish presentation went well, very well even given I had totally crashed my aging laptop two hours before I started. Good thing I had my presentation on a USB stick and that the GF download was reasonable in size. As Jean-François wrote, the audience was good (the competition was pretty stiff) and people stayed throughout the presentation and there were some interesting questions after the talk. The startup time of the current v3 drew some nice "wow" 's and applause which I almost did expect (I'm must be spoiled after showing this too many times ;-).

Of course I met a lot of people and I'm not even going to try to name them all. I have to say that I was very pleasantly surprised to see the attendance in talks such as Java EE 6, EJB 3.1, and JPA 2.0. They were really crowed. Spring seemed less present than previous years and there was no BEA in sight (they used to be one of the main sponsors).

Finally, it was great to see Neal and Josh on stage together, but it seems the agreement didn't last long.

( déc. 18 2007, 10:53:28 AM CET ) Permalink Comments [2]

20071210 lundi décembre 10, 2007

Java 6 is 365 days old

Java SE 6 was released one year ago. Have you moved to using it? In development? In production? Using and application server (GlassFish v2 is supported on JDK 6)? Are you a Mac User? :)

( déc. 10 2007, 10:38:32 PM CET ) Permalink Comments [12]


GlassFish Podcast
Get GlassFish V3
Support GlassFish Enterprise

Today's Page Hits: 235




bea conference glassfish groovy ips java javaee javafx javaone javazone jug mysql netbeans openesb openoffice opensource paris performance podcast presentation sdpy spring sun swing techdays tips updatecenter v3 webservices wsit
Links