<?xml version="1.0" encoding="iso-8859-1"?>



<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:admin="http://webns.net/mvcb/"
  xmlns:cc="http://web.resource.org/cc/"
  xmlns="http://purl.org/rss/1.0/">

<channel rdf:about="http://blogs.codehaus.org/people/avasseur/">
<title>Alex</title>
<link>http://blogs.codehaus.org/people/avasseur/</link>
<description></description>
<dc:language>en-us</dc:language>
<dc:creator></dc:creator>
<dc:date>2007-08-12T14:23:45+01:00</dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=2.661" />


<items>
<rdf:Seq><rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001607_this_blog_has_moved.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001604_bea_weblogic_esper_event_server.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001601_esper_brings_complex_event_processing_cep_to_mainstream.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001583_event_driven_application_servers_bea_is_in.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001563_esper_at_javaone_on_event_driven_application_server_and_xtp.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001548_esper_tutorial_on_oreilly_onjava.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001547_terracotta_jonas_eugene_on_aop_at_aosd_2007.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001308_free_as_open_source_they_said.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001290_microsoft_goes_aop.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001281_spring_2x_innovation_or_maturity.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001198_jrockit_powered_aop_prototype_available.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001191_synchronized_block_join_points_v2.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001152_aop_weavers_are_we_doing_it_wrong.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001141_jvm_support_for_aop_in_bea_jrockit.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001140_aspectj_5_load_time_weaving_with_java_13_using_aspectwerkz.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001130_optout_aop_good_or_evil_.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001128_aspectj_in_ajdt_a_world_premiere_.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001121_aspectj_aspect_and_java_13.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001120_javaone_2005_aop_distributed_java_and_more.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001107_jrockit_aop_and_aspectj_5_and_javaone_2005.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001100_java_open_source_playing_with_sharks.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/001002_ejb_3_and_aop_the_ejb_interceptor_dilemna.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000993_bea_joins_eclipse.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000991_junit_test_cases_and_number_of_tests_.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000986_writting_idea_plugins.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000961_spring_pointcut_on_steroids.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000958_aspectj_and_aspectwerkz_to_join_forces.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000934_yapb_aop_1234_released.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000923_aspectwerkz_aop_eclipse_plugin.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000839_jaoo_2004_aop_coverage_day_1_and_2.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000837_annotationdriven_aop_in_java_at_jaoo.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000794_aspectwerkz_in_weblogic_domain_wizard.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000780_aop_in_j2ee_tomcat_tutorial.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000743_aop_integration_in_tomcat_5.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000727_see_you_at_eworld.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000615_dynamic_aop_and_hotswap.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000607_its_life.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000540_aspectwerkz_aop_new_pointcut_expression_implementation.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000512_an_awfull_backend_for_aop_vs_aspectwerkz_part_1.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000264_aop_debugging_makes_its_show.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000256_aspectwerkz_announces_support_for_bea_jrockit.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000235_threadlocal_and_memory_leaks.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000209_aspectwerkz_online_mode_and_jsr_163.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000120_an_old_crap_we_dont_care_about_anymore.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000139_aspectwerkz_has_support_for_ibm.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000135_debug_your_aop_with_aspectwerkz.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000119_aspectwerkz_new_on_the_fly_weaving_architecture_released.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000112_aspectwerkz_online_architecture_better_than_jvmpi_sun_needs_to_think_about_it_for_java_15.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000107_besee_donated_to_aspectwerkz.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000106_bcel_patch_submitted.html" />
<rdf:li rdf:resource="http://blogs.codehaus.org/people/avasseur/archives/000101_bcel_internal.html" />
</rdf:Seq>
</items>

</channel>

<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001607_this_blog_has_moved.html">
<title>This blog has moved</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001607_this_blog_has_moved.html</link>
<description><![CDATA[<p>I have moved my blog to <a href="http://avasseur.blogspot.com/">http://avasseur.blogspot.com/</a></p>

<p>Please update your links and feeds.</p>]]></description>
<dc:subject></dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2007-08-12T14:23:45+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001604_bea_weblogic_esper_event_server.html">
<title>BEA WebLogic (Esper) Event Server</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001604_bea_weblogic_esper_event_server.html</link>
<description><![CDATA[There has been quite a lot of rumors these last weeks regarding the new <a href="http://www.bea.com">BEA WebLogic Event Server</a> which set the date of the entry of BEA into the Complex Event Processing arena.
<p/>
As official facts and news can now be read by everyone, I thought it was a good time for a recap and for a few comments and thoughts. You may find this post quite long to read, but well ... this is my industry viewpoint!
<p/>

<b>(1) Facts</b>
<p/>
Rumors were all at rage trying to figure out if BEA "ripped off" the <a href="http://esper.codehaus.org">Esper</a> ESP/CEP open-source GPL licensed engine, which has been in the arena for more than two years, release after release, commercialy supported by <a href="http://www.espertech.com">EsperTech</a> - hence the title of an hypothetical BEA WebLogic Esper Event Server of this post.
<p/>
Now we know, BEA is using Esper to bring to the market its WebLogic Event Server and has an agreement in place with EsperTech, the dual licensing company beehind Esper and NEsper.
<p/>
Now is time to shed some light on that topic. But first, let's recap...
<p/>
(as it is a long post, I'll use the extended entry so click to read more - I'll just paste my congrats there but there is much more to blog about:
<p/>
<b>Congrats to Esper and EsperTech for their success with BEA, and congrats to BEA for this new product offering that trully shakes the complex event processing arena - perhaps not in what it does but more in how it was assembled and engineered - with a a best of breed approach all the way up.</b>)]]></description>
<dc:subject></dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2007-07-20T23:42:29+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001601_esper_brings_complex_event_processing_cep_to_mainstream.html">
<title>Esper brings Complex Event Processing (CEP) to mainstream</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001601_esper_brings_complex_event_processing_cep_to_mainstream.html</link>
<description><![CDATA[<p>There has been two interesting posts recently regarding <a href="http://esper.codehaus.org">Esper</a>.</p>

<p>One from Tim Bass, from Tibco, reporting from the <a href="http://www.informationsecurityasia.com/v2/conference/conference-programme1.htm">InformationSecurityAsia2007</a>.<br />
Tim reports in <a href="http://thecepblog.com/2007/07/10/extrusion-detection-is-ripe-for-cep/">his blog</a> that complex event processing solutions like Esper can be used for extrusion detection (that is inverse of intrusion detection in a network where you want to track malicious users and software acting from inside, zombi machines etc.).<br />
Tim reports Esper is already known from several experts in the field and is beeing considered for such use cases. Glad to hear and thanks Tim for the info.</p>

<p>The second interesting news appears in <a href="http://www.intelligententerprise.com/print_article.jhtml?articleID=199902891">Intelligent Enterprise</a> where Esper is beeing quoted as the only <i>active open-source project for CEP</i> - both for Java and .Net platforms (what, you never heard about NEsper? Bet you will !).</p>

<p>Esper is quoted separately from the so called more commercial solutions like Apama, StreamBase, Coral8, Tibco etc. Especially because Esper is a great initiative to bring CEP to mainstream thru innovative, affordable and <i>a la carte</i> approach as quoted here:</p>

<quote>
Not For Big Companies Only.
With the ranks of CEP practitioners including big government, big finance and big telco, you might think the technology is accessible only to giants . That's not the case, however, as there's an active open-source CEP project called Esper that offers both Java and .NET components. 
</quote>

<p>It 's nice to see Esper quoted, although I am not sure I would do such a difference between Esper and the others solutions available for the following reasons:<br />
<ul><br />
<li>Esper is commercially backed and supported - checkout Esper' founder company <a href="http://www.espertech.com">EsperTech</a></li><br />
<li>Esper users include major investment banks already and other big shops - checkout the mailing list if you want to get a taste</li><br />
</ul></p>

<p>Of course I can't say if those guys are evaluating Esper or if they run some of their production system with it already - so you never know who is a user evaluating software and who is ready / has already entered the commercial relationship with commercially backed open source software unless you ask and they dare to reveal it.</p>

<p>There's trully no difference in fact when you look at that from a community point of view.<br />
When you are building open source software (which I have been doing for years now) there is only one thing that matters: <b>the community</b>.<br />
The community rules the use cases and drives the product direction in unanticipated ways accross industries of all kind and size.</p>

<p>This is a typical mistake regularly done when trying to compare open source software and commercial software as two fundamentally different things. Would you start saying Linux is for small companies and Windows for the big ones...</p>]]></description>
<dc:subject></dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2007-07-13T18:06:28+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001583_event_driven_application_servers_bea_is_in.html">
<title>Event Driven Application Servers - BEA is in</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001583_event_driven_application_servers_bea_is_in.html</link>
<description><![CDATA[<p>BEA has started to spread the news about the fact they'll enter the <a href="http://blogs.codehaus.org/people/avasseur/archives/001563_esper_at_javaone_on_event_driven_application_server_and_xtp.html">Event Driven Application Server</a> area - which I covered during my JavaOne 2007 session (with a bias on the first and only Java and .Net container for event-driven applications aka <a href="http://esper.codehaus.org">(N)Esper</a>). The product name is <a href="http://www.bea.com/framework.jsp?CNT=index.htm&FP=/content/products/weblogic/event_server/">WebLogic Event Server 2.0</a> (go figure what happened to 1.0!?), slatted for a public beta in the next few days.</p>

<p>Tim from Tibco wraps up the news in his <a href="http://eventprocessing.wordpress.com/2007/05/29/bea-enters-the-cep-market-with-weblogic-event-server/">blog</a>.</p>

<p>Stay tuned.</p>]]></description>
<dc:subject></dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2007-05-29T17:21:46+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001563_esper_at_javaone_on_event_driven_application_server_and_xtp.html">
<title>Esper at JavaOne, on Event Driven Application Server and XTP</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001563_esper_at_javaone_on_event_driven_application_server_and_xtp.html</link>
<description><![CDATA[<p>I am pleased to be back at this year <b>JavaOne 2007</b> as a speaker on "Event-Driven Application Servers". I'll showcase ESP/CEP technology to the Java community and industry, San Francisco, on Friday May 11th, 12:10.</p>

<p>The session that I co-lead with Tom, <a href="http://esper.codehaus.org">Esper</a> and <a href="http://www.espertech.com">EsperTech</a> founder, will introduce the audience with <b>Event Driven Architectures (EDA), Event Stream Processing (ESP) and Complex Event Processing (CEP)</b>. We will showcase the why, what and how on event-driven application servers, going from simple integration over JEE platforms to tailored off-the-shelf leading edge solutions playing in the <b>eXtreme Transaction Processing (XTP)</b> field.</p>

<p>This has implication in various areas such as investment banking, RFID, monitoring, compliance management and many more (up to this good old SOA...).</p>

<p>If you attend the event or are in the bay area and want to meet up, ping me or leave me a comment!</p>

<p>The session id is TS-1911 and if you happen to attend JavaOne this year you can already add it to your session schedule or click below to connect with me for the event.</p>

<p><a href="http://javaone2007.leveragesoftware.com/profile_view.aspx?customerid=avasseur"><img src="http://javaone2007.leveragesoftware.com/businesscard.aspx?customerid=avasseur" border="0" alt="Join Me at the 2007 JavaOne Conference Event Connect Tool!"></a></p>

<p>I hope to see you there and see a whole bunch of long time friends there.</p>

<p><a href="http://esper.codehaus.org">Esper</a><br />
<a href="http://java.sun.com/javaone/sf/index.jsp">JavaOne 2007</a><br />
</p>]]></description>
<dc:subject></dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2007-05-02T22:51:55+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001548_esper_tutorial_on_oreilly_onjava.html">
<title>Esper tutorial on OReilly ONJava</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001548_esper_tutorial_on_oreilly_onjava.html</link>
<description><![CDATA[It's live!
</p>
<i>
Event-driven architectures turn a traditional data-driven application's architecture upside-down. Instead of storing the data and running queries against stored data, Esper allows applications to store queries and run the data through.
</p>
This article introduces Esper, a lightweight ESP/CEP engine written in Java.</i>
</p>
This Esper tutorial is now available online at OReilly ' ONJava. The tutorial illustrates an airport self-service terminal that we monitor and improve with real-time customer relationship management by using both ESP and CEP capabilities of Esper. 
</p>
It includes a fully functional yet simple to run bundled application and also includes Eclipse configuration files so that you can start practicing right away (if you are an Eclipse user...).
</p>
I hope this will help get those blooming ESP/CEP concepts to mainstream. The tutorial should give you enough ground to understand where we come from and enough details to get started in your own project right away.
</p>
If the EPL snips below does not sound familiar to you
<div class="code"><pre>select avg(price) from StockTick.win:time(30 sec)
where symbol='GOOG'

select type, count(*)
from BaseTerminalEvent.win:time(10 minutes)
group by type
output all every 1 minutes</pre></div>


<a href="http://www.onjava.com/pub/a/onjava/2007/03/07/esper-event-stream-processing-and-correlation.html ">Read it online at ONJava</a>
</p>
or read more about <a href="http://esper.codehaus.org">Esper</a>]]></description>
<dc:subject></dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2007-03-12T00:00:04+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001547_terracotta_jonas_eugene_on_aop_at_aosd_2007.html">
<title>Terracotta&apos; Jonas &amp; Eugene on AOP at AOSD 2007</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001547_terracotta_jonas_eugene_on_aop_at_aosd_2007.html</link>
<description><![CDATA[<p>Jonas and Eugene from <a href="http://terracottatech.com/">Terracotta</a> - the Naturally Clustered Java provider and maker of OpenTerracotta - have published a very interesting paper on industry use of AOP and point out some limitations present in current AOP frameworks: <i>"Clustering the Java Virtual Machine using Aspect-Oriented Programming"</i>.</p>

<p>Excerpt:<br />
<i>"application startup time with AspectJ load-time weaving [which I partly authored] was ... slower and memory overhead was ... bigger ... when comparing with similar transformations done with either the Terracotta runtime or the AspectWerkz AOP engine [which I authored with my friend and former coworker Jonas]."</i></p>

<p>This comes to no surprise to me as AspectJ is born for build time weaving and Eclipse integration and AspectWerkz was born for load time and runtime weaving. As author of both (as we joint forces from AspectWerkz to AspectJ back mhh.. 2 years ago) I was unable to get the best of both world in one engine as we initially focussed on features integration - such as thru the @AspectJ style that is annotation-defined and driven AOP. Since that time my open source bandwith has been drawned due to work engagements. That is unfortunate as I believe there are no technical reasons for this multi-weaving-optimized engine to not happen. Fortunately AspectJ is strong on runtime performance which is something you really have to consider as well.</p>

<p>Their paper is available online on <a href="http://www.aosd.net/2007/program/industry/I1-ClusteringJVMUsingAOP.pdf">AOSD 2007</a><br />
</p>]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2007-03-10T13:08:59+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001308_free_as_open_source_they_said.html">
<title>Free as Open Source they said?</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001308_free_as_open_source_they_said.html</link>
<description><![CDATA[<p>It's interseting to follow the different strategies around Open Source these days.<br />
<b>Can Open Source be FOSS at all?</b></p>

<p>I have been myself leading a project for some time with <a href="http://www.jonasboner.com">Jonas Bonér</a> in the AOP field, and we more than once had potential corporate users willing to be helped or supported (thus charged) with some more formal ways than classic user mailing lists and "fix it yourself / wait for the community to fix it" attitude.</p>

<p>BEA's <b>blended strategy</b> of certifying and supporting 24/7 major open source components (like Spring) is well echoed by several facts these last weeks.</p>

<p>First some post on <a href="http://www.theserverside.com/news/thread.tss?thread_id=38021">TheServerSide "Developping J2EE without xxx? Why?"</a>, xxx beeing your perhaps favorite open source framework, (xxx and yyy abstracted for the purpose of this blog article).</p>

<p>Some various comments from this thread:<br />
<i><br />
"xxx is good"<br />
"Don' t look from the developer angle only"<br />
"Couple of years down the track, if xxx goes bust or I can't find developers who want to work with old technology like xxx as everyone has moved on to yyy_standard or something similar, and my application breaks for certain reason, where will I get support or resource to maintain my application?"</i></p>

<p>More interesting, a <a href="http://www.lemondeinformatique.fr/entretiens/lire-todd-delaughter-hp-software-11.html">recent quote</a> from <b>HP Software head Todd DeLaughter</b> (translated from French):<br />
"We could do something with Open Source. It will depend on the market evolution. [..] Today the problem is that sooner or later customers are asking their software provider to certify and support the stack, and provide services around. That won't change any time soon."</p>

<p>Obviously it would then be intersting to look at the cost of Open Source, beyond the FOSS zero acquisition cost.</p>

<p>It's not secret that <b>JBoss is now selling software (not free, with trial copy and commercial license)</b> and doing marketing around it - see the last JBoss newsletter and the messages around JBoss ON "JBoss Operating Network", the what sounds to be administration solution of JBoss app servers (see f.e. <a href="http://labs.jboss.com/file-access/default/members/jbosslabs/freezone/roadmaps/files/JBossON-Intro.pdf">here</a>).<br />
Quoting the newsletter:<br />
<i>"JBoss is holding a series of workshops [...] will include hands-on training on JBoss ON (trial copies of the software will be provided)"</i></p>

<p>Deploying stuff on an Open Source stack is end to end is definitely not free at the end. FOSS is just one view on one single phase in a project: development.</p>

<p>Left aside the training cost for the young developers themselves.<br />
In a recent <a href="http://opensource.sys-con.com/read/169006.htm">post</a>, Yakov Fain calculates that if you follow introduction trainings on Spring, Hibernate and JBoss, which seems today' minimum to get started on a so called FOSS stack, you'll have to travel some accross the globe, and afford a total of $9000.</p>

<p>Obviously, we then should take into account support prices, and possible performance gaps between each stacks, meaning all in all you'll need more CPU and hosting power here and there to run your beast. And CPU is never free.</p>

<p>I'd be pleased to see the debate around the Java community shift from programming practices and tech buzzwords (IoC AOP ligthweight whatever is best implemented here things) to some from the trench real project end to end considerations.<br />
Obviously lightweight approaches and Open Source do play a key role in the whole picture, both with pros and cons.</p>

<p>So FOSS - free as in free beer? Really? The world is obviously more complex than that.</p>]]></description>
<dc:subject>Technology</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2006-01-13T16:26:21+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001290_microsoft_goes_aop.html">
<title>Microsoft goes AOP?</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001290_microsoft_goes_aop.html</link>
<description><![CDATA[<p>While AOP has reached a decent maturity level in the Java platform, thanks to several iniatives from different players with different priorities and goals (IBM, BEA, JBoss, Spring, and individuals like Bob Lee to name a few), Microsoft seems to be willing to move beyond that.</p>

<p>Last year at AOSD they were hosting a session on Phoenix, an interesting building block in the .Net CLR labs to help enable AOP frameworks. The community in .Net around AOP is fairly active as well, and Microsoft did <a href="http://research.microsoft.com/ur/us/fundingopps/Phoenix-RFP_awards.aspx">awarded</a> some of the projects, like Alan Cyment' <a href="http://docs.codehaus.org/display/SETPOINT/Home">SetPoint</a> hosted on CodeHaus, the home of AspectWerkz.</p>

<p>Recently (Nov. 2005) Microsoft has set up a <a href="http://research.microsoft.com/workshops/aop/">research event</a> to emulate discussions around <b>the best way to have good AOP solutions in the .Net platform</b>. Several key .Net AOP project leads and folks from the AOP research academia were invited for a full day event at Redmond.</p>

<p>As far as I know Sun never set up such an event to try to understand AOP from its roots, and most of the discussion on the field has been driven by individual to individual networking and the <a http="http://aosd.net">AOSD</a> annual conference.</p>

<p>I am eager to see where .Net ends up in that field in 2 years from now. There are certainly interesting architectures and concepts that we have implemented in Java based AOP that could be ported rightaway to .Net, though .Net luminaries have certainly several new ideas that 'd be worth exploring from Java luminaries point of view - and possibly standardizing on - obviously outside the JCP - unless Sun suddenly cares more about AOP.</p>]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-12-29T17:48:21+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001281_spring_2x_innovation_or_maturity.html">
<title>Spring 2.x -  innovation or maturity?</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001281_spring_2x_innovation_or_maturity.html</link>
<description><![CDATA[<p>
Last week I had the pleasure to discuss some more with the Spring team at <a href="http://www.javapolis.com">JavaPolis</a>, and I was thus given a quick informal update on what they are heading at in Spring 2.x,  especially on the AOP side, discussing with <a href="http://blog.springframework.com/rod/">Rod</a> and <a href="http://blog.springframework.com/rob/">Rob</a>.
</p>

<p>
Spring AOP in Spring 1.x has been easy to use - though missing a good pointcut language. This simplicity is well described in a recent article on dev2dev by <a href="http://dev2dev.bea.com/pub/a/2005/12/spring-aop-with-ejb.html">Eugene</a>, and I had debated this issue and tried to solve it with <a href="http://blogs.codehaus.org/people/avasseur/archives/000961_spring_pointcut_on_steroids.html">Spring pointcuts on steroids with AspectWerkz</a>.
</p>

<p>
In Spring 2.x, with the help of newly appointed excellent <a href="http://www.aspectprogrammer.org/blogs/adrian/">Adrian Coyler</a> as chief scientist, my AspectJ lead peer, Spring AOP will unleash AspectJ and <a href="http://eclipse.org/aspectj/doc/released/adk15notebook/ataspectj.html">@AspectJ</a> that I spent quite some time on this year as per our engagement to merge best of breed AspectWerkz with AspectJ.
</p>

<p>
But going beyond, Spring 2.x also introduces a way to define aspects in your spring bean xml files directly f.e.:
<div class="code"><pre>		&lt;aop:aspect id="<span class="quote">countAgeCalls</span>" ref="<span class="quote">countingAdvice</span>"&gt;
			&lt;aop:pointcut id="<span class="quote">setCalls</span>" expression="<span class="quote">execution(* *..ITestBean.set*(..))</span>"/&gt;
			&lt;aop:advice pointcut="<span class="quote">execution(* *..ITestBean.set*(..))</span>" method="<span class="quote">myBeforeAdvice</span>" kind="<span class="quote">before</span>"/&gt;
			&lt;aop:advice pointcut-ref="<span class="quote">setCalls</span>" method="<span class="quote">myAfterAdvice</span>" kind="<span class="quote">after</span>"/&gt;
			&lt;aop:advice pointcut-ref="<span class="quote">setCalls</span>" method="<span class="quote">myAroundAdvice</span>" kind="<span class="quote">around</span>"/&gt;
		&lt;/aop:aspect&gt;</pre></div>

</p>

<p>
This is actually a really nice feature that I started playing with 2 years ago when implementing AspectWerkz with <a href="http://www.jonasboner.com">Jonas</a>. So there is not much innovation there.
</p>
<p>
There might actually be some issues and hard work going forward. By having aspects defined this way, the AspectJ runtime that is used when your are using the excellent <a href="http://www.eclipse.org/ajdt/">AJDT Eclipse Plugin for AspectJ</a> will not take those into account (whilst regular @AspectJ ones are fully supported).
</p>
<p>
This means there 'll be definitely a need to open-up some more AJDT and have some extension point in it so that the Spring IDE can leverage it and have the AJDT crosscutting view display the Spring xml defined aspect.
</p>
<p>
Wups - <a href="http://blogs.codehaus.org/people/jboner/archives/000065_aspectwerkz_ruthlessly_refactored.html">xml defined aspect</a> I have said - just like this June 2003' Jonas article introduces, back in AspectWerkz 0.6.3
</p>
<p>
Maturity - finally!
</p>]]></description>
<dc:subject>Technology</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-12-23T10:57:12+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001198_jrockit_powered_aop_prototype_available.html">
<title>JRockit powered AOP prototype available</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001198_jrockit_powered_aop_prototype_available.html</link>
<description><![CDATA[It's there !
<p/>
I am very pleased to announce the prototype version of JRockit that includes our AOP API is available. It will drive you far far away from current bytecode instrumentation techniques to a world of <b>plain Java API, complete runtime control for hot deployment and undeployment, agnostic from the programming model you like for your aspects</b>.
<p/>
If you are involved in the AOP field, bytecode instrumentation field, APM field, and did not heard from us recently, please drop me an email and I 'll consider your participation in evaluating this technology to help us drive it to reality.
<p/>
You can read the official announcement and some background information in our <a href="http://forums.bea.com/bea/forum.jspa?forumID=600000004">BEA dev2dev dedicated forum</a>.
]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-10-20T11:22:02+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001191_synchronized_block_join_points_v2.html">
<title>Synchronized block join points (v2)</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001191_synchronized_block_join_points_v2.html</link>
<description><![CDATA[Back in July Jonas suggested some semantics for a <a href="http://blogs.codehaus.org/people/jboner/archives/001134_semantics_for_a_synchronized_block_join_point.html">synchronized block join point</a>. The discussion was interesting but I am wondering if we actually came up with the right question.
<p/>
What if we simply think in terms of <b>"is this type listening to locking events ?"</b> instead of trying to come up with a pointcut expression that defines the semantics of a <i>synchronized</i> block - as done in Jonas discusion?
<p/>
Lets draft some code:
<br/>
Consider the program:
<div class="code"><pre><span class="category1">class</span> Bar {
   <span class="category1">synchronized</span> <span class="category1">void</span> foo() {
      ..
    }
 
   <span class="category1">static</span> <span class="category1">synchronized</span> <span class="category1">void</span> statfoo() {
      ..
    }
 
   <span class="category1">void</span> stuff() {
       ..
       <span class="category1">synchronized</span>(bar) {
          ..
        }
    }
}</pre></div>


So the deal is to listen to lock events - mainly:
<ul>
<li>waiting the lock</li>
<li>just acquired the lock</li>
<li>just released the lock (or perhaps about to release it - but this does not matter much for this discussion)</li>
</ul>
<p/>
I argue that instead of defining semantics, the issue should be narrowed to a type pattern ie something as simple as <i>Bar</i> (or more fancy variations based on type hierarchy or annotation - you bet it).
<p/>
Given that we can define this interface:
<div class="code"><pre><span class="category1">interface</span> Lockable {
   <span class="category1">void</span> waiting();
   <span class="category1">void</span> acquired();
   <span class="category1">void</span> released();
}</pre></div>

<p/>
As a user you can then implement this interface on your own types, use some sort of AOP or proxy to have it introduced where you want, etc.
<p/>
So what should happen to make that work?
<p/>
First based on the type pattern, we simply <b>introduce</b> <i>Lockable</i> to <i>Bar</i>. This can be done manually, by the mean of AOP if f.e. I was writing <i>@Distributed class Bar { .. }</i> and so on - depends on the use case.
<p/>
Second the interface must then be <b>implemented by Bar</b>.
The user can provide one if implemented manually, or the system (AOP f.e.) can provide an <b>empty one</b> ie something like (depends on the AOP system but you get the idea)
<div class="code"><pre>@Introduce("<span class="quote">Bar</span>")
<span class="category1">class</span> LockableNOOP <span class="category1">implements</span> Lockable {
   <span class="category1">void</span> waiting() {}
   <span class="category1">void</span> acquired() {}
   <span class="category1">void</span> released() {}
}</pre></div>

<p/>
Last we need to <b>transform the program</b> so that the synchronized block or the Bar' synchronized method are triggering event to that.
This is not that hard since we just need to look at the type hierarchy for non static synchronized method and given that an instance synchronized method can be rewritten (by the system) as a synchronized(this) block we end up to something like that:
<br/>Replace all synchronized blocks like that:
<br/>Given
<div class="code"><pre><span class="category1">synchronized</span>(stuff) {
   ..
}</pre></div>

to
<div class="code"><pre><span class="category1">if</span> (stuff <span class="category1">instanceof</span> Lockable) {
   Lockable lockable = (Lockable)stuff;
   lockable.waiting();
   <span class="category1">synchronized</span>(stuff) {
      lockable.acquired();
      ..<span class="linecomment">// unchanged body</span>
    }
   lockable.released();
} <span class="category1">else</span> {
   <span class="category1">synchronized</span>(stuff) {
      ..<span class="linecomment">// unchanged body</span>
    }
}</pre></div>

Fairly easy.
<p/>
So far, nothing will happen, as we have a LockableNOOP implementation, unless the user (you) explicitly provided some implementation.
<p/>
Last part: configure the system so that <b>it advises Lockable' methods</b>, so that you can add your behavior there (f.e. distribute lock, or trace them for some application performance system). There, usual AOP stuff can be used.
<br/>You can now access the enclosing static join point information if you need - which gives you <b>if you really need it</b>, the rich semantics Jonas was looking for:
<code>call(Lockable.waiting()) && withincode(....) && target(t) && cflow(...) .....
// t is the locked object

</code>

<p/>
There are two interesting things to solve now:
<ul>
<li>What if I want to <b>kick out the synchronized() block</b> ?(f.e. for distributed lock). I think a small variation of Lockable can solve that - f.e. <i>boolean shouldUseJavaLocks()</i>, and a tiny change for the transformed program.</li>
<li>What about the <i>static synchronized statfoo() {..}</i> in <i>Bar</i>? For that one, the transformation would have to be a bit more compex so that we f.e. lock on an introduced static field. That said, the Lockable interface is not handy anymore. Any suggestion for that one? Should we define three methods like <i>static void lockable_waiting()</i> that ones would implement or introduce to adress this use case?</li>
</ul>
<p/>
On a more high level perspective, this send us back to a recurrent set of problems in the AOP / bytecode transformation space:
<ul>
<li>to achieve API transparency, we have a very intrusive transformation engine (though the one described here can be quite fast)</li>
<li>by changing the bytecode we break the visibility another system may require to work properly (as f.e. we add if blocks, change synchronized method into synchronized blocks etc).</li>
</ul>
<p/>
There is thus a set of open questions:
<ul>
<li>So should that belongs to the JVM directly, and in which form?
(as f.e. JVMTI already provides monitor entry / exit events, that should be fairly easy).</li>
<li>Should those 3 Lockable' methods (or 6 if we include the static versions) belong to <i>java.lang.Object</i> direclty?</li>
<li>Would an hybrid system that changes the synchronize blocks using bytecode transformation but then relies on JVM level support for AOP such as we do in JRockit be enough to listen for lock events?</li>
<li>Is the cost of the introduced <i>instanceof</i> acceptable?</li>
</ul>
<p/>
Happy thinking! ]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-10-10T13:30:28+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001152_aop_weavers_are_we_doing_it_wrong.html">
<title>AOP weavers - are we doing it wrong?</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001152_aop_weavers_are_we_doing_it_wrong.html</link>
<description><![CDATA[These last days I have been prototyping around an interesting idea.
<p/>
As you know we have been working on an API to add <a href="http://dev2dev.bea.com/pub/a/2005/08/jvm_aop_2.html">JVM support for AOP in JRockit</a>. The prototype will be available any time soon.
<p/>
The nice thing about it is that you don't manipulate the bytecode anymore and that you are using only well known <b>java.lang.reflect.*</b> API to tell the JVM if your pointcut is matching or not. This is somehow similar to what ones can do with Spring AOP - as this one is proxy based (see f.e. <a href="http://fisheye.cenqua.com/viewrep/springframework/spring/src/org/springframework/aop/MethodMatcher.java?r=1.10">MethodMatcher</a> API in Spring).
<p/>
The immediate benefit of it is that first there is no need to have another in-memory representation of classes beeing weaved (before they get loaded) that is backed by some expensive (both memory and CPU) bytecode analysis.
This advantage is detailled in our JVM support for AOP <a href="http://dev2dev.bea.com/pub/a/2005/08/jvm_aop_1.html">part1</a> article.
<br/>
As a consequence it is really easy to query the method annotation, generics properties, and such - something that is extremely complex to achieve with acceptable overhead in regular bytecode based weaver such as AspectJ or AspectWerkz (actually more complex than changing some bytecode instruction).
<p/>
So what is that idea I had ?
<br/>
Having AOP support in JRockit is nice, but it will take some time before that gets mainstream (with eventually a JSR etc). In this transition period, there must be a way to implement a better bytecode based weaver that will perform way better than current weavers (both AspectJ and AspectWerkz), that will be easier to implement, and whose only requirement is Java 5 (well off course, it won't be as good as JRockit JVM support for AOP - so it is still a transition technology).
<p/>
I have thus been sketching on an hybrid system that makes extensive use of the hotswap API, and whose actual weaver relies only on pointcut matching backed by the java.lang.reflect.* API ie does not build any kind of equivalent structure backed by bytecode analysis.
<br/>
As such the memory overhead is zero, and the CPU overhead is way less than current AspectJ and AspectWerkz.
<p/>
The overall idea is quite simple and consists in 2 phases:
<br/>
<b>Phase 1</b>
<br/>
A first weaver is changing the bytecode in some   stable way - such that <b>all</b> classes are transformed (lets say prepared) <b>the same way</b> - while not introducing any dependancies on any kind of AOP, and while not adding any kind of performance overhead (ie no changes in the execution flow such as introduced by wrappers method and such usually used when implementing instrumentation needed for around advice).
<br/>
All classes thus get loaded as expected with a very limited time overhead and no memory overhead at all (thanks to the excellent <a href="http://asm.objectweb.org/">ASM</a> performance).
<p/>
<b>Phase 2</b><br/>
Then when an actual class gets loaded (as per regular application behavior) I get a small callback invoked when this class <b>has just been loaded</b> and just before anything else happens (ie the class static initializer invoked by the JVM). Current <i>load time</i> weavers do things "just before the class gets loaded" and as such cannot access the java.lang.reflect representation of what they weave.
<br/>
This callback can then perform the actual weaving by relying entirely on the <b>java.lang.reflect.*</b> API to match the pointcuts. It then constructs the instrumented version of the class and hotswap it thanks to the Java 5 API. The JVM eats this one and goes on.
<br/>
The first prepare phase is needed as the hotswap API does forbids change in the schema (ie cannot add or remove methods or fields).
<p/>
A nice extra side effect is that at any point in time any class can be exposed to the AOP layer thru a simple API. This can be handy for some cases where there are some circular references in the dependancies (f.e. the instrumentation needs the java.lang.reflect.Method class to match against the pointcuts so if I want to add aspects to the Method class, I cannot do it until I have a representation of this class ie there 's no way to have it working by simply invoking the callback from the prepared Method class itself).
<p/>
This might seems like gory details, especially when compared to what we do in the JRockit JVM support for AOP, but I am sure there are some concepts worth digging there - as memory usage and weaving overhead as been reported more than once as a major problem (see f.e. use case with AspectJ reported by Ron Bodkin where the system takes 4 minutes to start instead of less than a minute without any weaver <a href="http://rbodkin.blogs.com/ron_bodkins_blog/2005/03/nearinfinity_ao.html">here</a>) 
<br/>
This makes it also very easy to add aspects even to java.* classes (though it's not generally a good idea unless you know what you are doing).
<p/>
This sample is an actual code snip of the actual AOP transformation (part of phase 2). As you can see it relies on the java.lang.reflect API.
<p/>
<div class="code"><pre>    <span class="category1">public</span> MethodVisitor visitMethod(<span class="category1">int</span> access, <span class="category2">String</span> name, <span class="category2">String</span> desc, <span class="category2">String</span> signature, <span class="category2">String</span>[] exceptions) {
         <span class="category1">if</span> (!filter(access, name)) {<span class="linecomment">//fast filter for f.e. clinit method as we look for method execution join points</span>
              <span class="linecomment">// see if we get a match for this join point</span>
              <span class="linecomment">// only java.lang.reflect.* API is used here</span>
              <span class="category2">Member</span> method = ReflectQuery.getMethod(m_klass, name, desc);
              <span class="category2">Class</span> thisClass = m_klass;
              <span class="category2">Class</span> targetClass = <span class="category1">null</span>;
              <span class="category2">Member</span> withinCode = <span class="category1">null</span>;
              <span class="linecomment">//do matching</span>
              <span class="category1">if</span> (match(method, thisClass, targetClass, withinCode)) {
                   <span class="linecomment">//change the bytecode but don't change the schema for hotswap purpose</span>
               } <span class="category1">else</span> {
                   <span class="category1">return</span> super.visitMethod(access, name, desc, signature, exceptions);
               }
          }
     }</pre></div>

<p/>
Finally I must say this idea is not 100% new as I wrote a paper on it for AOSD 2004 (read my paper <a href="http://aspectwerkz.codehaus.org/downloads/papers/aosd2004-daw-aspectwerkz.pdf">here</a>). At that time though I was not doing the pointcut matching based on the java.lang.reflect API - as the purpose was to enable dynamic AOP in AspectWerkz 1.0) ie I was not solving the problem of the memory and CPU overhead of the actual weaver.
<p/>
What do you think? Are those ideas worth digging more?]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-08-10T12:18:40+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001141_jvm_support_for_aop_in_bea_jrockit.html">
<title>JVM support for AOP in BEA JRockit</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001141_jvm_support_for_aop_in_bea_jrockit.html</link>
<description><![CDATA[<p>We have plublished a follow-up to our <a href="http://java.sun.com/javaone/">JavaOne 2005</a> session that describes with some more details the <b>JVM support for AOP that is beeing designed within the BEA JRockit JVM</b>.<br />
<p/><br />
This first article introduces the problems that usually happen with current weavers (in the Java land) and briefly described the proposed solution.<br/><br />
The next part to appear in the following weeks will give more details and code samples.<br />
<p/><br />
<a href="http://dev2dev.bea.com/pub/a/2005/08/jvm_aop_1.html">Read the article</a><br />
<p/><br />
<table border=1><br />
<tr><td><br />
<a href="http://dev2dev.bea.com/pub/a/2005/08/jvm_aop_1.html">JRockit JVM Support For AOP, Part 1</a> by Jonas Bonér and Alexandre Vasseur, Joakim Dahlstedt -- AOP is all the rage, but how do you implement it? In this article, Jonas, Alexandre, and Joakim show that the current approaches to implementing AOP suffer from many problems, making scalability an issue. Moreover, they indicate that the traditional approach to aspect weaving duplicates efforts that the JVM already performs.<br />
</td></tr><br />
</table><br />
<p/><br />
We are currently working on making the prototype implementation available for further evaluation.<br />
<p/><br />
If you could not attend JavaOne 2005, the slides are available from the <a href="http://java.sun.com/javaone/">JavaOne</a> web site, and they are also available <a href="http://blogs.codehaus.org/people/avasseur/download/TS-7659.pdf">here</a><br />
<p/><br />
The full webcast of the JavaOne session is <a href="http://dev2dev.bea.com/pub/e/721">also available on dev2dev</a>.</p>]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-08-02T09:34:12+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001140_aspectj_5_load_time_weaving_with_java_13_using_aspectwerkz.html">
<title>AspectJ 5 load time weaving with Java 1.3 using ... AspectWerkz</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001140_aspectj_5_load_time_weaving_with_java_13_using_aspectwerkz.html</link>
<description><![CDATA[<div class="code"><pre>**** Introduction</pre></div>

<p/>  
As development of <a href="http://aspectj.org">AspectJ 5</a> and the merger with <a href="http://aspectwerkz.codehaus.org">AspectWerkz</a> making good progress, several users have started to wonder how the load time weaving under Java 1.3 / 1.4 VM be enabled.
<p/>
Despite the name, AspectJ 5 is not at all tied to Java 5. I have already explained in <a href="http://blogs.codehaus.org/people/avasseur/archives/001121_aspectj_aspect_and_java_13.html">this post</a> how to write plain Java aspects using JavaDoc annotation and <a href="http://backport175.codehaus.org">Backport175</a>.
<p/>
In this post I 'll explain how to <b>enable load time weaving for Java 1.3/1.4 for AspectJ... by using AspectWerkz !</b> ie that AspectJ will sit on top of the very low level layer of AspectWerkz.
<p/>  
<div class="code"><pre>**** Some background</pre></div>
  
<p/>  
In AspectWerkz we enable load time weaving to happen thru a wide range of options that user can choose: 
<ul>
<li>Java 5 agent</li>
<li>JRockit specific integration with JRockit agent</li>
<li>bootclasspath family</li>
<li>hotswap family</li>
</ul>
I have integrated the most important ones in the AspectJ 5 code base already - ie the first two - but some of them won't be integrated - hence this post.
<p/>
When running Java 5 or JRockit (java 1.3 / 1.4 / 1.5) you don't need to read further and can stick to what's provided out of the box in AspectJ 5. Else... continue reading.
<p/>
The AspectWerkz low level layer named <i>aspectwerkz-core</i> is actually a generic load time weaving layer. It comes with one interface that one has to implement - very similar to the <i>JSR-163</i> instrumentation agent: the <b>org.codehaus.aspectwerkz.hook.ClassPreProcessor</b>.
<p/>
This core layer comes with a set of tools that allows to turn this one on into the environment. The most easiest to use is what we called the <i>"prepared bootclasspath"</i> where you basically run a little script that will patch the <i>java.lang.ClassLoader</i> to hook in the agent, and will give you back a jar. This jar file can then be used first in the classpath when you start your JVM so that the agent gets called.
<p/>
You can read more about all the options in the AspectWerkz doc <a href="http://aspectwerkz.codehaus.org/weaving.html#Overview_of_options_for_online_weaving">here</a>.
</p>
<div class="code"><pre>**** Running AspectJ by using AspectWerkz <span class="category1">for</span> load time weaving</pre></div>

<p/>
I describe here the implementation of the agent, but you can use directly the one I ship with this post if you are not interested in the details. You can assume this one is LGPL, as AspectWerkz is.
<p/>
The implementation of the ClassPreProcessor to use AspectJ on top of AspectWerkz core is straightforward and looks like that:
<div class="code"><pre><span class="category1">package</span> org.aspectj.ext.ltw13;

<span class="category1">public</span> <span class="category1">class</span> ClassPreProcessorAdapter <span class="category1">implements</span>
<span class="linecomment">// implements the AspectWerkz core interface </span>
org.codehaus.aspectwerkz.hook.ClassPreProcessor {
 
     <span class="blockcomment">/**
      * Concrete preprocessor we delegate to
      * This one sits in org.aspectj.weaver.loadtime.*
      */</span>
     <span class="category1">private</span> <span class="category1">static</span> ClassPreProcessor s_preProcessor;
 
     <span class="category1">static</span> {
          <span class="category1">try</span> {
               s_preProcessor = <span class="category1">new</span> Aj();
               s_preProcessor.initialize();
           } <span class="category1">catch</span> (<span class="category2">Exception</span> e) {
               <span class="category1">throw</span> <span class="category1">new</span> <span class="category2">ExceptionInInitializerError</span>("<span class="quote">could not initialize preprocessor due to: </span>" + e.toString());
           }
      }
 
     <span class="category1">public</span> <span class="category1">void</span> initialize() {
          ;
      }
 
     <span class="category1">public</span> <span class="category1">byte</span>[] preProcess(<span class="category2">String</span> className, <span class="category1">byte</span>[] bytes, <span class="category2">ClassLoader</span> classLoader) {
          <span class="linecomment">// skip bootCL</span>
          <span class="category1">if</span> (classLoader == <span class="category1">null</span>) {
               <span class="category1">return</span> bytes;
           }
  
          <span class="linecomment">// skip AJ weaver well know stuff to avoid circularity</span>
          <span class="category1">if</span> (className != <span class="category1">null</span>) {
               <span class="category2">String</span> slashed = className.replace('.', '/');
               <span class="category1">if</span> (slashed.startsWith("<span class="quote">org/aspectj/weaver/</span>")
                   || slashed.startsWith("<span class="quote">org/aspectj/bridge/</span>")
                   || slashed.startsWith("<span class="quote">org/aspectj/util/</span>")
                   || slashed.startsWith("<span class="quote">org/aspectj/apache/bcel</span>")
                   || slashed.startsWith("<span class="quote">org/aspectj/lang/</span>")
               ) {
                    <span class="linecomment">//System.out.println("SKIP " + className);</span>
                    <span class="category1">return</span> bytes;
                }
           }
          <span class="linecomment">// do the weaving using AspectJ weaver</span>
          <span class="category1">return</span> s_preProcessor.preProcess(className, bytes, classLoader);
      }
}</pre></div>

<p/>
By using the AspectWerkz <i>Plug</i> utility we generate our load time weaving enabled java.lang.ClassLoader in <i>awaj-boot.jar</i> (see AspectWerkz doc for other options, that might be more license friendly if you care). This can be done thru Ant:
<div class="code"><pre>        &lt;java classname="<span class="quote">org.codehaus.aspectwerkz.hook.Plug</span>" fork="<span class="quote">true</span>" failonerror="<span class="quote">true</span>"&gt;
            &lt;classpath&gt;
                &lt;pathelement path="<span class="quote">${java.home}/../lib/tools.jar</span>"/&gt;
                &lt;path refid="<span class="quote">aw.path</span>"/&gt;
            &lt;/classpath&gt;
            &lt;arg line="<span class="quote">-target _boot/awaj-boot.jar</span>"/&gt;
        &lt;/java&gt;</pre></div>

<p/>
The last step consists in starting the JVM with this one, passing in a specific option to say what is the ClassPreProcessor implementation we want to use (the default one beeing AspectWerkz).
Starting a sample with Ant will thus looks like this - the important details are int he <i>jvmarg</i> option
<div class="code"><pre>    &lt;target name="<span class="quote">test</span>" depends="<span class="quote">compile.test, compile, prepare</span>"&gt;
        &lt;java classname="<span class="quote">test.ltw13.Sample</span>" fork="<span class="quote">true</span>" failonerror="<span class="quote">true</span>"&gt;
            &lt;classpath&gt;
                .....
            &lt;/classpath&gt;
            &lt;jvmarg line="<span class="quote">
      -Daj5.def=test/aop.xml
      -Xbootclasspath/p:_boot/awaj-boot.jar
      -Xbootclasspath/a:D:/aw/cvs_aw/aspectwerkz4/lib/aspectwerkz-core-2.0.jar
                         -Daspectwerkz.classloader.preprocessor=org.aspectj.ext.ltw13.ClassPreProcessorAdapter
            </span>"/&gt;
        &lt;/java&gt;</pre></div>

<p/>  
<div class="code"><pre>****  Sample project</pre></div>

<p/>  
I am attaching the complete source code, along with a sample Aspect in a zip.
<p/>
This sample further use Backport175 so that the project is 100% Java 1.3 - without any of the AspectJ specific extra keyword to defines aspects that would disturb your regular javac compiler.
<p/>
Off course, this load time weaving can be used for any kind of aspects, so adapt it for using AJC if you have some <i>.aj</i> files to compile.
<p/>
<b>Note: this zip does not include AspectWerkz jars, Backport175 jars, and AspectJ jars needed. You will have to get those and fix the Ant build.xml for your environment. See the build.xml file in the zip.</b> (the sample is also refering to AspectWerkz 2.1RC1 - so change it to AspectWerkz 2.0  / sorry about those minor details).
<p/>
It may also happen that you will need a SAX XML parser has Java 1.3 does not ships one. You may read more about that in the AspectWerkz FAQ for example
<a href="http://aspectwerkz.codehaus.org/faq.html#other_java_1_3">here (read  "Does AspectWerkz support Java 1.3?")</a>. This is not contained in the sample project neither.
<p/>
<a href="http://blogs.codehaus.org/people/avasseur/downloads/ltw13.zip">Get AspectJ load time weaving on Java 1.3 enabled by AspectWerkz !</a>
<p/>
You will need AspectWerkz 2.0 for it. <a href="http://aspectwerkz.codehaus.org">Get it there</a>.
<p/>
To run the sample, you will also need AspectJ and Backport and the Backport175 AspectJ extension. See build.xml on how to get those.]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-08-01T14:48:00+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001130_optout_aop_good_or_evil_.html">
<title>Opt-out AOP: good or evil ?</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001130_optout_aop_good_or_evil_.html</link>
<description><![CDATA[There is an interesting option in <a href="http://aspectj.org">AspectJ</a> that is named <b>-Xreweavable</b>.

<p/>

When turned on using any kind of compilation/weaving mode (compiling with <b>ajc</b>, within Eclipse AJDT, doing bynary weaving, or using loadtime weaving), each weaved class keeps track of
<ul>
<li>the aspects that are affecting it</li>
<li>its state before the weaving happened (ie its bytecode without aspects)</li>
</ul>

<p/>

This option is very handy when you plan to weave more than once your application (because f.e. this is a library that you distribute), and when you want to make sure everyone will be able to add some more aspects in there.<br/>
Actually, discussions are taking place if this should be the default.

<p/>

An interesting consequence is that it is fairly easy to implement an <b>opt-out AOP engine</b> that simply restores the state prior to weaving, and thus <b>kicks out all the aspects from the application !</b><br/>
There are of course realistic use-cases for it :
<ul>
<li>sanity check if production is very scared about use of AspectJ, knowing that the developpers team is using it for their own needs (declare error / warning f.e. and tracing in QA stage etc)</li>
<li>obtain some more info about which aspect is in, and is affecting the application, to increase the trust everyone gets in using the technology</li>
<li>introspect some third parties libraries and see if they actually use aspects</li>
<li>add some more reporting features on the go, to be able to have at any time the list of aspects that are in the system f.e. thru some sort of web console</li>
<li>enforcing that some key section of the system are not allowed to be advised by anything, or only by some sort of well know and certified aspect(s)</li>
</ul>

<p/>

A small amout of code is required for it, the trick is mainly to add another Java 5 agent or loadtime weaver that will check for this <i>reweavable</i> state and do the reporting.<br/>
This is actually very easy to do when using f.e. <a href="http//aspectwerkz.codehaus.org">AspectWerkz</a>-core as the backend to hook this one in and have it work as well on Java 1.3, and using <a href="http://asm.objectweb.org/">ASM</a> for the bytecode details.
<p/>


Here is a sample output (I am using AspectJ loadtime weaving to do the weaving first, but that could be done using post compilation with AJC, or compilation from within Eclispe AJDT etc)
<div class="code"><pre><span class="linecomment">// in this sample, start the app with AspectJ loadtime weaving (could have been compiled with ajc instead)</span>
<span class="linecomment">// and pipe with the UndoAspectJ opt-out engine using the AspectWerkz core</span>
<span class="linecomment">// as a backend</span>
#java -javaagent:aspectjweaver.jar -Daj5.def=test/aop.xml
       -javaagent:aspectwerkz-jdk5-2.0.jar
       -Daspectwerkz.classloader.preprocessor=
          org.aspectj.ext.undoaspectj.ClassPreProcessor
       test.undoaspectj.Sample

weaveinfo Type 'test.undoaspectj.Sample' (Sample.java:28) advised by
   around advice from 'test.undoaspectj.Sample$TestAspect' (Sample.java)

<span class="linecomment">// here is the opt-out message</span>
UndoAspectJ - test/undoaspectj/Sample was affected by 
	test.undoaspectj.Sample$TestAspect

<span class="linecomment">// execution without any aspect takes place:</span>
Sample.target</pre></div>


<div class="code"><pre><span class="linecomment">// without the opt-out we would see the aspect executing:</span>

weaveinfo Type 'test.undoaspectj.Sample' (Sample.java:28) advised by
   around advice from 'test.undoaspectj.Sample$TestAspect' (Sample.java)

<span class="linecomment">// execution with aspect takes place:</span>
Sample$TestAspect.around
Sample.target</pre></div>


<p/>

Though the first idea is quite odd and counter productive, this illustrates that ones could easily implement a security layer on top of AspectJ without even going deep in the AspectJ code base, to enforce security constraints about the use of AOP in the system and in the deployments at large.

<p/>

So is opt-out AOP good or evil ?]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-07-13T13:02:50+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001128_aspectj_in_ajdt_a_world_premiere_.html">
<title>@AspectJ in AJDT - a world premiere !</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001128_aspectj_in_ajdt_a_world_premiere_.html</link>
<description><![CDATA[<p>I am happy to announce that the <b>@AspectJ support within Eclipse AJDT</b> will appear in the next build snapshots, ie very soon !</p>

<p>That is an important step that brings to the <a href="http://aspectwerkz.codehaus.org">AspectWerkz</a> and <a href="http://aspectj.org">AspectJ</a> merger all its meaning, by providing a plain Java syntax (based on annotations) to write AspectJ aspects (aka @AspectJ) while still providing excellent support for it in Eclipse AJDT plugin - just as it exists for the well know AspectJ style (code style).</p>

<p>In the list of things to already expect, that will officially ship as of AspectJ 1.5 M3 in the following days:<br />
<ul><br />
<li>error checking for pointcuts (even though those looks like strings within an annotation)</li><br />
<li>warnings when @AspectJ annotations are misused (f.e. used in a class that is not annotated with an @Aspect annotation etc)</li><br />
<li>advised by view</li><br />
<li>advises view and cross-reference view</li><br />
<li>and off course AJC integration (ie weaving happens behind the scene as compilation is done)</li><br />
</ul></p>

<p>As a world premiere, here is a snapshot of an @AspectJ aspect in AJDT !</p>

<p><a href="http://blogs.codehaus.org/people/avasseur/archives/download/aj-ajdt-worldpremiere.html" onclick="window.open('http://blogs.codehaus.org/people/avasseur/archives/download/aj-ajdt-worldpremiere.html','popup','width=1400,height=964,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img alt="@AspectJ in AJDT" src="http://blogs.codehaus.org/people/avasseur/archives/download/aj-ajdt-worldpremiere_resize.jpg" width="290" height="200" border="0" /></a></p>

<p>For those of you using AspectWerkz, you may wish to give it a try very soon, as it is already much better that <a href="http://blogs.codehaus.org/people/avasseur/archives/000923_aspectwerkz_aop_eclipse_plugin.html">the Eclipse plugin I had written for AspectWerkz</a>, and as it will help you to get started with the @AspectJ syntax in your favorite IDE.</p>

<p>Start your download engines to get the next build snapshots and the upcoming AspectJ 1.5 M3 with your fresh Eclipse 3.1 final !</p>

<p>(Many thanks to Andrew and Mik for answering my questions to get that bits working)</p>]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-07-05T13:32:06+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001121_aspectj_aspect_and_java_13.html">
<title>AspectJ, @Aspect and Java 1.3</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001121_aspectj_aspect_and_java_13.html</link>
<description><![CDATA[Following the <a href="http://backport175.codehaus.org">Backport175</a> release that Jonas and I have done some days ago, and since <a href="http://aspectj.org">AspectJ 1.5</a> upcoming <b>M3</b> and especially the <b>@Aspect</b> style is starting to take shape after some month of hard work on my side, I think it is a good timing to also explain that this @Aspect sytle, despite its name tied to these Java 5 annotations, is not at all tied to Java 5, and will bring the <b>plain Java aspect</b> concept to all of you using <b>Java 1.3 and 1.4</b> (from the real world).

<p/>

The <b>@Aspect style</b> is also referred as @AJ, or annotation style, or this way to write aspect with annotation that we came up with thru <a href="http://aspectwerkz.codehaus.org">AspectWerkz</a>.
It mainly means that AspectJ allows you to write an aspects using wether the well known <b>code style</b> or the AspectWerkz like <b>annotation style</b>.

<p/>

<div class="code"><pre><span class="linecomment">// code style</span>
<span class="category1">public</span> aspect SomeAspect {
      <span class="category1">void</span> before() : execution(* Foo.bar()) {
          <span class="linecomment">// do some stuff</span>
          <span class="linecomment">// use thisJoinPoint etc</span>
       }
}</pre></div>


<p/>

<div class="code"><pre><span class="linecomment">// annotation style, here with Java 5</span>
@Aspect
<span class="category1">public</span> <span class="category1">class</span> SomeAspect {
      @Before("<span class="quote">execution(* Foo.bar())</span>")
      <span class="category1">void</span> before(JoinPoint thisJoinPoint)  {
          <span class="linecomment">// do some stuff</span>
          <span class="linecomment">// use thisJoinPoint etc</span>
       }
}</pre></div>


<p/>

And since Backport175 brings annotations to Java 1.3 while preserving the bytecode format that the Java 5 specification describes, it seamlessly allows you to use the very same AspectJ version to write @Aspect on Java 1.3 as well (but please don't call it the <i>doclet style</i>!)

<p/>

<div class="code"><pre><span class="linecomment">// annotation style, backported to Java 1.3 or 1.4</span>
<span class="blockcomment">/**
 * @Aspect
 */</span>
<span class="category1">public</span> <span class="category1">class</span> SomeAspect {
     <span class="blockcomment">/**
       * @Before("execution(* Foo.bar())")
       */</span>
      <span class="category1">void</span> before(JoinPoint thisJoinPoint)  {
          <span class="linecomment">// do some stuff</span>
          <span class="linecomment">// use thisJoinPoint etc</span>
       }
}</pre></div>


<p/>

For the Java 1.3 to work, you just need an single little jar that contains the AspectJ defined annotations (like <code>@interface Aspect
</code>
) backported to Java 1.3 in the form of regular interfaces (ie <code>interface Aspect
</code>
) and then make sure you have those classes first when doing the weaving.
Aside, since AJC (the AspectJ compiler) is not yet integrated in the doclet parsing pipeline, you need to follow a <i>binary weaving</i> strategy ie:
<ul>
<li>develop the aspect and the application with Java 1.3 (remember it's plain Java so you can use IntelliJ if you want)</li>
<li>compile the sources with regular javac</li>
<li>post-compile with Backport175 to handle the annotations</li>
<li>binary weave with AJC</li>
<li>run</li>
</ul>

<p/>

That sounds a bit cumbersome but some simple Ant script is of great help. Aside Backport175 comes with plugins for Eclipse and IntelliJ so you end up with just the binary weaving step - that is rather common.

<p/>

I have made <a href="http://blogs.codehaus.org/people/avasseur/downloads/aspectjrt-backport175.jar">this little AspectJ extension available here (that can be used with Java 1.3)</a>

<p/>

You can also grab <a href="http://blogs.codehaus.org/people/avasseur/downloads/ext-backport175-AspectJ-src.zip"> the source code for it, that includes a small demo here</a>.

<p/>

Just set <code>aj.root
</code>
 in the <code>build.properties
</code>
 to the folder that contains <code>aspectjrt.jar
</code>
 and <code>aspectjtools.jar
</code>
 from a recent nightly build (will work for M3, does not for M2, so use a recent one!).
Then run <code>ant clean test
</code>
.

<p/>

Check the <code>build.xml
</code>
 file to understand how the different build steps are performed.

<p/>

In the IDE it will also popup pretty well. See for example the little green 
<code>@
</code>
 signs in the margin in this IntelliJ screenshot.
<a href="http://blogs.codehaus.org/people/avasseur/downloads/aj-bp.html" onclick="window.open('http://blogs.codehaus.org/people/avasseur/downloads/aj-bp.html','popup','width=917,height=648,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"  alt="@AspectJ in IntelliJ, with Java 1.3"><img alt="@AspectJ in IntelliJ, with Java 1.3" src="http://blogs.codehaus.org/people/avasseur/downloads/aj-bp.jpg" width="459" height="324" border="0" /></a>

<p/>

So now we have AspectJ @Aspect straight in IntelliJ.
Off course, you'd better use <a href="http://www.eclipse.org/ajdt/">Eclipse AJDT</a> to benefit from the rich user experience that it provides when dealing with software modularity thru AOP and AspectJ.

<p/>

Using Backport175 also allows to use custom annotations in the pointcuts under Java 1.3 to define stronger contract between the aspect and the application, as <a href="http://www.aspectprogrammer.org/blogs/adrian/2005/03/the_new_holy_tr.html">Adrian describes here</a> as the Holy Trinity (when you further add dependency injection)
(the demo don't include that but I let you try it).

<p/>

In a follow-up post I will also explain how the new AspectJ enhanced load time weaving ala AspectWerkz can work with Java 1.3 and 1.4 as well - since it has been a recurrent question.]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-06-23T11:31:48+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001120_javaone_2005_aop_distributed_java_and_more.html">
<title>JavaOne 2005 - AOP, distributed Java, and more</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001120_javaone_2005_aop_distributed_java_and_more.html</link>
<description><![CDATA[<p>I thought it would be interesting to post what kind of session and BOF I am planning to attend during <a href="http://java.sun.com/javaone/">JavaOne 2005</a> next week.</p>

<p>There are indeed interesting trends going on, and needless to say I don't really want to hear that the EJB (3) XML deployment descriptors are back or that kind of things. Instead, AOP, Annotations and distributed architectures will get my interest.</p>

<ul>
<li>
BOF-9888, Chasing 9s: Modeling and Measuring Availability of J2EE™ Applications (Sun, monday 7h30 PM)
</li>
<li>
TS-7659, Runtime Aspects With JVM™ Support (BEA JRockit off course, Tuesday 11h AM - <a href="http://blogs.codehaus.org/people/avasseur/archives/001107_jrockit_aop_and_aspectj_5_and_javaone_2005.html">don't miss it ! and meet us at the BEA and Eclipse booth</a>)
</li>
<li>
TS-7695, The Spring Framework: Introduction to Lightweight J2EE™ Architecture (Interface21, Tuesday 11h AM)
</li>
<li>
 TS-7212, Clustering, Consistency, and Caching: An Implementor's View of JSR 107 [JCache] (BEA, Tuesday 01h30 PM)
</li>
<li>
TS-7159, Java™ Platform Clustering: Present and Future (Sun, Tuesday 2h45 PM) (don't miss it, it is a sneak from Sun research labs, about transparent clustering)
</li>
<li>
BOF-9385, Apt Usage of APT: When and How to Use the Annotation Processing Tool (Chariot Solutions, Tuesday 7h30 PM) (I know they will give a quote to <a href="http://aspectj.org">AspectJ</a>)
</li>
<li>
BOF-9161, Exploring Annotation-Based Programming Through the APT and Mirror APIs (BEA/Sun, Tuesday 9h30 PM) (ha ! Annotations that drove <a href="http://aspectwerkz.codehaus.org">AspectWerkz</a> for a while)
</li>
<li>
BOF-9441, Practical Application of Aspects in Everyday Development (ALTERthought, Tuesday 10h30 PM) (AOP from the users - an evidence of adoption phases as regards AOP)
</li>
<li>
TS-5471, Jini™ and JavaSpaces™ Technologies on Wall Street (JPMorgan, GigaSpaces,others, Wednesday 11h AM)
</li>
<li>
TS-7429, Speculative Locking: Breaking the Scale Barrier (Azul, Wednesday 4h PM)
</li>
<li>
TS-7410, Network Attached Processing: Tapping 384-Way SMP, 256GB Java™ Technology Compute Bricks (Azul, Thursday 1h15 PM)
</li>
<li>
TS-7339, Data Grids for J2EE™ Platform Cluster Deployments (GemStone, Thursday 3h45 PM)
</li>
</ul>

<p>See you there !</p>]]></description>
<dc:subject>Technology</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-06-22T18:06:28+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001107_jrockit_aop_and_aspectj_5_and_javaone_2005.html">
<title>JRockit AOP and AspectJ 5 and JavaOne 2005</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001107_jrockit_aop_and_aspectj_5_and_javaone_2005.html</link>
<description><![CDATA[<p><a href="http://java.sun.com/javaone/">JavaOne 2005</a> will be a good opportunity for you to have an update on the<br />
AOP field. Last year we presented <a href="http://aspectwerkz.codehaus.org">AspectWerkz plain Java AOP</a> and its<br />
J2EE integration facilities. This year, several sessions will include<br />
AOP related sections and give testimony of interesting use cases, and<br />
as Jonas recently announce we will for the first time present<br />
the <a href="http://blogs.codehaus.org/people/jboner/archives/001094_jvm_support_for_aop_technical_session_at_javaone_2005.html">JRockit JVM support for AOP</a>.</p>

<p>Make sure you attend this technical session on Tuesday June 28 (TS-7659, "Runtime Aspects With JVM Support") and have a<br />
sight at what's next in the AOP galaxy. If you can't make it, visit us<br />
at the BEA booth where we will be eager to show you the JRockit JVM<br />
AOP support thru live demos.</p>

<p>You can also visit us at the Eclipse booth where we will show latest<br />
<a href="http://aspectj.org">AspectJ 5 and AJDT versions</a>. This includes <b>plain Java AOP</b> and<br />
<b>load-time weaving ala AspectWerkz</b> that I have been working on for some<br />
month since we merged with AspectJ, and many new things regarding Java<br />
5 support in AspectJ 5 (annotation matching, generics etc)</p>

<p>Meet you there !</p>]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-06-07T18:34:56+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001100_java_open_source_playing_with_sharks.html">
<title>Java Open Source playing with sharks</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001100_java_open_source_playing_with_sharks.html</link>
<description><![CDATA[<p>As a person largely involved in the Java Open Source landscape, I have been observing radical changes during the last 5 years in this area, and the <a href="http://www.theserverside.com/news/thread.tss?thread_id=34249">5 years birthday of Struts</a> makes me comment it some.</p>

<p>Five years ago, I was starting my own Struts clone for PHP to try to bring an MVC model to the rather new PHP OO stack I was using on a customer site. This project ended up pretty much nowhere (e-php on SF) since, well..., I could luckily do something way more interesting.<br />
But back at that time it was rather simple to start a small Open Source project and try to have it grow. Some were actually even considering you as a strange beast when you happened to be part of that world, one of my former employer beeing the first.</p>

<p>At that time, I also remember sales folks arguing that a Java developer had to have <b>"fluent in Struts"</b> in their resume to actually be a good Java Joe developer (before that you had to have "fluent in Javascript" in their mind, so we had made a big progress for the IT consultants thanks to Struts ;-) )</p>

<p>Most of the (good) Java Joe developers where using Apache projects from the Jakarta line mainly as their sole Open Source use in corporate projects, and Tomcat was pretty much the sole Open Source container that you could find in production.</p>

<p>At that time JBoss started to change the game by grabbing several Open Source fames and projects on board (Tomcat, and then Hibernate to name the most famous).<br />
Back in 2002, it became fairly common to see <b>"JBoss knowledge is a plus"</b> in job descriptions for IT consultants. Open Source had started to play with sharks, and you had to play with it, following the "fluent in Struts" move.</p>

<p>Next in the pie, Eclipse went bigger and bigger, and Open Source projects that were used and presented in conferences were more and more backed by someone that could afford it.<br />
At that time I boosted <a href="http://aspectwerkz.codehaus.org">AspectWerkz</a> by joining Jonas' first iterations, all that on my spare time, unpaid, for the fun of it, as most of the OSS committers, bringing my little Open Source load time weaving framework that I had started some month before (beSee on SF).</p>

<p>AOP and IoC started to gain in popularity, and Spring was doing its first moves. It became common to see <b>"fluent in Hibernate"</b> in job description, and I remember the first time I actually noticed it was in february 2003.</p>

<p>I have been pushing the AOP ball since that time as part of my BEA job, and  Open Source was more and more playing with sharks. AspectWerkz was backed by BEA, AspectJ revealed to be largely backed by IBM as an Eclipse technology project, and sucessfull projects that you could hear about in conferences where almost all backed by a shark - be it a big open source community like Apache, Eclipse, ObjectWeb that can afford its own events, or by a commercial vendor like BEA, IBM or JBoss.<br />
Even more, some projects happens to be backed by more than one shark. AspectWerkz and AspectJ is an evidence of it thru the <a href="http://aspectj.org">AspectJ 5</a> merger.</p>

<p>Back in 2004 the Spring fame became a shark by its own thanks to a well shapped service model around Rod' Interface21, that obviously adressed (and still adresses) Java Joe developer needs.</p>

<p>Last year I was wondering when I would see a <b>"fluent in Spring"</b> requirement in an IT job description, and it happened this morning, on the same line as "Tomcat, JBoss, Hibernate" for a "challenging J2EE architect opportunity" (<a href="http://offres.monster.fr/getjob.asp?JobID=30620015&WT.mc_n=MKT000125">interested?</a>). </p>

<p>I have the feeling that Open Source will not be anymore this hectic group of people working for free for the fun of it as that sound to be back in 2000. Open Source is becoming more and more a distribution channel or a big thing to take into account when thinking about return on investment. If you look closely at some open source projects, you 'll also realize that it is rather common that 80% if not more of the workload is handled by a group of people sitting on the same open space.</p>

<p>The recent <a href="http://www-1.ibm.com/press/PressServletForm.wss?MenuChoice=pressreleases&TemplateName=ShowPressReleaseTemplate&SelectString=t1.docunid=7658&TableName=DataheadApplicationClass&SESSIONKEY=any&WindowTitle=Press+Release&STATUS=publish">deal (backed by concrete M$) done around Geronimo</a> (project that was already backed by Apache) is yet another evidence. Open Source is playing with sharks, so you'd better love that. And if you do want to kickstart an Open Source project, you'd better think which shark will play with you if you want your jewel idea to sustain.</p>

<p>As a last evidence, almost every single IT service company in France finally spinned of an official department dedicated to Open Source, bridging  the gap with "SSLL" models (french acronym for open source service provider, doing consulting only on OSS stacks) . I have noticed this trend those last few months (Devoteam, Atos to name a few).<br />
This not to comment on the Eclipse phenomenon, with almost all software vendors joining it and shaping their product line in a new more or less anticipated direction.</p>

<p>Open Source is not anymore the thing you use to maximize revenues, or to make sure you recruit uptodate brains. It's the thing you have to play with straight within your strategy, no matter if you are a software vendor or an IT service company.</p>

<p>So what will be the next Open Source moves in the Java are(n)a ?<br />
Happy Open Source thoughts !</p>

<p>(note: dates in that post are those I remember and might be approximations. Aside, the job opportunities I am talking about are all for the French market, so you may expect some delta)</p>]]></description>
<dc:subject>Technology</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-06-01T12:14:31+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/001002_ejb_3_and_aop_the_ejb_interceptor_dilemna.html">
<title>EJB 3 and AOP: the EJB interceptor dilemna</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/001002_ejb_3_and_aop_the_ejb_interceptor_dilemna.html</link>
<description><![CDATA[<p>
In this post I present an implementation a subset of the EJB 3 specification (JSR-220) : the EJB interceptors. As of today no EJB 3 preview brings an implementation that seamlessly integrates with AOP, despite the concept similarities.<br/>
The proposed implementation is fully runnable out of any container, and introduce a specific extension to allow use of pointcut in EJB interceptors, thanks to AspectWerkz extensible AOP container.<br/>
Wants to know more about EJB 3 interceptors,  and how they are closed to AOP or different from AOP ? Read more.
</p>

<p>
<b>Should we consider EJB interceptor as AOP ?</b>
</p>

<p>
As you may know, the <a href="http://www.jcp.org/en/jsr/detail?id=220">EJB 3 specification (JSR-220)</a> defines 

<b>Interceptors for EJBs (stateless, statefull and message-driven)</b>. If it might be a good idea to spread an answer 

for the need of addressing cross-cutting concerns in J2EE and EJBs in particular, it might be a bad idea to do it for 

those of us (more and more numerous) familiar with AOP implementations like <a href="http://aspectj.org">AspectJ</a> and 

<a href="http://aspectwerkz.codehaus.org">AspectWerkz</a>, especially because huge limitations of what the specification 

allows us to do with those interceptors - at first sight and excluding any vendor specific extension.
</p>

<p>
The most anti-AOP concept in the specification is that the EJB that wants interceptor have to declare it explicitly 

using a @javax.ejb.Interceptor or @javax.ejb.Interceptors class level annotation - which breaks the obliviousness of 

aspects. That in favor of making things explicit, which might be good for J2EE users.
</p>

<p>
Further on, the EJB bean itself can have a method that intercept its own business method ie <i>the bean is the 

aspect</i> (that sounds like marketing isn'it ?). Well. That's a specification and is interesting in the sense that it 

democratize a technology.
So what can we do to democratize AOP as part of the EJB 3 specification ?
</p>

<div class="code"><pre>@javax.ejb.Stateless
@javax.ejb.Interceptor("<span class="quote">test.ejb3.MyInterceptor</span>")
<span class="category1">public</span> <span class="category1">class</span> MyEJBIsTheAspect {
 
     <span class="linecomment">// business method</span>
     <span class="category1">public</span> <span class="category1">int</span> businessSum(<span class="category1">int</span> i, <span class="category1">int</span> j) {
          <span class="category1">return</span> i + j;
      }
 
     <span class="linecomment">// interceptor method within the bean (the bean is the aspect)</span>
     @javax.ejb.AroundInvoke
     <span class="category1">public</span> <span class="category2">Object</span> interceptMySelf(InvocationContext ctx) <span class="category1">throws</span> <span class="category2">Exception</span> {
          System.out.println("<span class="quote">--&gt; MyEJBIsTheAspect.interceptMySelf</span>");
          System.out.println("<span class="quote">  method: </span>" + ctx.getMethod());
          <span class="category1">for</span> (<span class="category1">int</span> i = 0; i &lt; ctx.getParameters().length; i++) {
               <span class="category2">Object</span> o = ctx.getParameters()[i];
               System.out.println("<span class="quote">  args[</span>"+i+"<span class="quote">]: </span>" + o);
           }
          <span class="category1">return</span> ctx.proceed();
      }
 
}</pre></div>


<p>
<b>State of the art (not that much..) in JBoss and Oracle AS EJB 3 preview</b>
</p>

<p>
After having a look at <a href="http://jboss.org">JBoss EJB 3</a> and <a 

href="http://www.oracle.com/technology/tech/java/ejb30.html">OracleAS EJB 3</a> previews, I was even more disapointed. 

Both of them are <b>using a reflective based approach to invoke the interceptors</b>. This means that 

the performance of the interceptor will be bad, and that a <a 

href="http://www.aip.org/history/heisenberg/p08.htm">Heisenberg</a> effect will be inevitable and actually fairly big 

(no wonder that ones will use interceptor to gather performance metrics and thus as soon as you observe the bean, you 

are observing a different things than what actually happens).
</p>

<p>
Ones may say this is a microscopic view. It is. But when thinking about EJB 2 stories in the past a sound idea would be 

to make sure we don't waste resources where we can avoid it. And thinking about JBoss history around AOP, that's rather 

suprising that the EJB 3 interceptors are not cleanly integrated in their AOP framework. I personnaly consider that we 

have enough technology around to make it far better, and far more consistent with AOP. Given the impact that AOP will 

continue to have, ones would better figuring out how to do that now with EJB 3 - assuming that EJB 3 succeeds.
</p>

<p>
<b>AspectWerkz extensible container value proposal to EJB 3 interceptors</b>
</p>

<p>
I decided to give it a try with the <b>AspectWerkz extensible container</b>. As Jonas Bonér described it in a <a 

href="http://www.theserverside.com/articles/article.tss?l=AspectWerkzP1">TSS article</a>, AspectWerkz can be considered 

as a generic AOP runtime platform, in which ones can hook in any kind of AOP/AOP like programming model. AspectWerkz 

aspects are one, AspectJ aspects are another, and we have implementations for Spring AOP and AOP Alliance aspects. An 

<i>AspectModel</i> answers three essential properties: <i>what is the life cycle of the aspect</i>, <i>how to invoke 

it</i> and <i>how the programming model exposes the closure with wich the user proceed</i>.
</p>

<p>
It happens that <b>the EJB 3 interceptor can be seen as a very simple AOP programming model</b> in two ways:
<ul>
<li>ones can define interceptor class. An interceptor (advice) is thus a @javax.ejb.AroundInvoke annotated method with a 

specific signature (no interface, no mandatory method name) within a class - the interceptor class (aspect).</li>
<li>ones can define a @javax.ejb.AroundInvoke annotated method (advice) in the EJB itself (aspect): <b>the bean is the 

aspect !</b></li>
<li>the closure is defined with the interface javax.ejb.InvocationContext</li>
</ul>
</p>

<div class="code"><pre><span class="category1">public</span> <span class="category1">interface</span> javax.ejb.InvocationContext {
 	<span class="category1">public</span> <span class="category2">Object</span> getBean();
 	<span class="category1">public</span> <span class="category2">Method</span> getMethod();
 	<span class="category1">public</span> <span class="category2">Object</span>[] getParameters();
 	<span class="category1">public</span> <span class="category1">void</span> setParameters(<span class="category2">Object</span>[]);
 	<span class="category1">public</span> Context getEJBContext();
 	<span class="category1">public</span> java.util.Map getContextData();
 
 	<span class="category1">public</span> <span class="category2">Object</span> proceed() <span class="category1">throws</span> <span class="category2">Exception</span>;
}</pre></div>


<p>
The value proposal I am bringing here with the AspectWerkz extensible container is the following:
<ul>
<li>no reflection at all. See performance figure f.e at our <a 

href="http://docs.codehaus.org/display/AW/AOP+Benchmark">benchmark site</a></li>
<li>seamless integration of the interceptors with the aspects. They are made "aspect" thanks to AspectWerkz and the 

other aspect model (AspectWerkz aspect, AspectJ aspect, whatever aspect model registered in the runtime) coexists 

nicely</li>
<li>easy points for vendor specific extension:<ul>
    <li>real pointcut to narrow the matching of an interceptor method to a very precise set of bean methods</li>
    <li>life cycle control for the interceptor class</li>
    <li>supporting cflow(), args() and alike AOP semantics</li>
    <li>introducing high performant hot deployment and undeployment of EJB interceptors</li>
    </ul></li>
<li>"out of container" runtime available</li>
<li>rich integration patterns: application preparation (like ejbc / appc for faster deployment) or seamless 

deployment</li>
</ul>
</p>

<p>
<b>AspectWerkz extensible container details</b>
</p>

<p>
To better understand how things will looks like, you need some background in AspectWerkz:
</p>

<p>
The first key part is "org.codehaus.aspectwerkz.transform.inlining.spi.AspectModel". <b>We will provide two 

implementations of it</b>. One for interceptor class (the interceptor class is the aspect), and one for bean as 

interceptor (the bean is the aspect).
The second key part is in integrating the EJB interceptor closure "InvocationContext" that defines the "proceed()" 

method with the more general idea of "Joinpoint.proceed()" of the runtime. In short, this means that the interceptor 

will be entirely part of the aspect chain, and if there is a transaction aspect to handle EJB transaction boundaries, 

they will share the very same chain - as ones expects - thus making it easy for the implementation to organize 

precedence rules (as define in section 3.5.1 of JSR 220 for example).
As we already wrote this transaction aspect for EJB 3 in a previous <a 

href="http://www.theserverside.com/articles/article.tss?l=AspectWerkzP2">AspectWerkz TSS tutorial</a>, that's rather a 

simple idea and basic requirement.
</p>

<p>
The runtime will take care of aggregating the models depending on which aspect apply to which join point, each aspect 

having its specific AspectModel and each AspectModel implementation being responsible for generating what it needs:
</p>

<div class="code"><pre><span class="linecomment">// a closure to deal with the join points</span>
<span class="linecomment">// ie models org.codehaus.aspectwerkz.joinpoint.JoinPoint interface</span>
<span class="linecomment">// to fit with the transaction aspect, or any other aspect</span>
<span class="linecomment">// and javax.ejb.InvocationContext to fit EJB3 interceptors</span>
 <span class="category1">class</span> jitEJB3Closure <span class="category1">implements</span> JoinPoint, InvocationContex  
 {
     
     <span class="linecomment">// the closure hosts state, optimization makes it more complex than that</span>
 
     <span class="linecomment">// the target of the join point ie the intercepted ejb</span>
     <span class="linecomment">// which is also third aspect: remember the bean is the aspect !</span>
     <span class="category1">private</span> MyEJBIsTheAspect target;
 
     <span class="linecomment">// first aspect in the chain, statically compiled</span>
     <span class="category1">private</span> TXAspect aspect_0;
 
     <span class="linecomment">// second aspect: the interceptor class</span>
     <span class="category1">private</span> MyInterceptor aspect_1;           
   
     <span class="linecomment">// details skipped that makes those fields initalized as they should.</span>
 
     <span class="linecomment">// as defined in javax.ejb.InvocationContext</span>
     <span class="category1">public</span> <span class="category2">Method</span> getMethod() {...}             
 
     <span class="linecomment">// as defined in JoinPoint</span>
     <span class="category1">public</span> <span class="category2">Class</span> getTargetClass {...}           
 
     <span class="linecomment">// other methods as per each aspect model affecting the join point</span>
     ...
 
     <span class="linecomment">// generic proceed() method as defined in JoinPoint and InvocationContext</span>
     <span class="category1">public</span> <span class="category2">Object</span> proceed() <span class="category1">throws</span> <span class="category2">Throwable</span>    
     {
          <span class="linecomment">// sort of a loop to proceed with the advice chain</span>
          
          <span class="linecomment">// case first round: TX aspect</span>
          <span class="linecomment">// TX aspect</span>
          <span class="linecomment">// as defined in the "AspectWerkzAspectModel implements AspectModel"</span>
  	aspect_0.manageTX(<span class="category1">this</span>) 
          <span class="linecomment">// "this" is considered as the JoinPoint instance</span>
  
          ...
  
          <span class="linecomment">// case second round: interceptor class</span>
          <span class="linecomment">// as defined in the yet to be written</span>
          <span class="linecomment">// "EJBInterceptorModel  implements AspectModel"</span>
  	aspect_1.someNameOfYourChoice(<span class="category1">this</span>)        
          <span class="linecomment">// "this" is considered as the InvocationContext instance</span>
          
          ...
  
          <span class="linecomment">// case third round: the bean is the aspect</span>
          <span class="linecomment">// as defined in the yet to be written</span>
          <span class="linecomment">//  "EJBIsTheAspectModel implements AspectModel"</span>
  	target.interceptMyself(<span class="category1">this</span>)
          <span class="linecomment">// "this" is considered as the InvocationContext instance</span>
          ...
       }
 
    }</pre></div>


<p>
That may sound a bit of gory details, but that's actually simple once you get the idea of this closure acting for 

multiple AspectModel in mind. The code is actually <b>15O lines for the interceptor class model (EJBInterceptorModel) 

and 25 lines for the bean is the aspect model (EJBIsTheAspectModel)</b> thanks to some inheritance. It mainly deals with 
<ul>
<li>generating the InvocationContext methods (like getMethod(), getParameters())</li>
<li>dealing with the EJB 3 aspect life cycle ie<ul><li>
	push the EJB instance on stack for the EJBIsTheAspectModel</li>
	<li>create an interceptor class instance, bookeep it and push it on stack for the EJBInterceptorModel (as the spec 

does not specifies the life cycle, I will use a singleton model).</li>
</ul></li></ul>
</p>

<p>
<b>What about the deployment ?</b>
</p>

<p>
I presented the runtime, but there is an interesting topic as well: the deployment. AspectWerkz pioneered the aop.xml to 

define which
aspects are affecting the system. Obviously, we don't want that for EJB interceptor. We need to use the AspectWerkz API 

to register what we need in the system. The interesting concept here is that we will transform <b>what the EJB 

specification defines thanks to annotation (@javax.ejb.Interceptor, @javax.ejb.Interceptors, @javax.ejb.AroundInvoke) in 

real AOP pointcut that the AOP container understand</b>.
That is where a vendor may easily hook in an extension (ie introduce a new annotation for example) to refine the 

interceptor class life cycle, or to introduce a pointcut.
</p>

<p>
I am defining a class that will expose an API that will hide the AOP registration from the user or from the other parts 

of our spec. implementation.
</p>

<div class="code"><pre><span class="category1">public</span> <span class="category1">class</span> EJBInterceptorDeployer {
 
    <span class="category1">public</span> <span class="category1">static</span> <span class="category1">void</span> deploy(<span class="category2">String</span> ejbClassName, <span class="category2">ClassLoader</span> loader) {
        <span class="linecomment">// step 1 - interceptor class</span>
        
        <span class="linecomment">// read the ejbClass @Interceptor and @Interceptors class level annotation</span>
        <span class="linecomment">// for each interceptor class name found as value of those annotation</span>
        <span class="linecomment">//     get the @AroundInvoke method information</span>
        <span class="linecomment">//     deploy an aspect</span>
        <span class="linecomment">//         using the EJBInterceptorModel</span>
        <span class="linecomment">//         to the pointcut : "execution(!@javax.ejb.AroundInvoke !static * " + ejbClassName + ".*(..))"</span>
        <span class="linecomment">//</span>
        
        <span class="linecomment">// step 2 - @AroundInvoke method of the bean itself</span>
        <span class="linecomment">// find the @AroundInvoke method if any</span>
        <span class="linecomment">// deploy an aspect</span>
        <span class="linecomment">// 	using the EJBIsTheAspectModel</span>
        <span class="linecomment">//	to the same pointcut</span>
        
     }
 
  <span class="linecomment">// method making use of AspectWerkz aspect deployment API</span>
 
}</pre></div>


<p>
The thing to note about the deployer is that it is not using reflection. It is f.e. using our <a 

href="http://backport175.codehaus.org/">BackPort175</a> implementation to read the EJB annotations from the bytecode. If 

we were not doing so, we would trigger the EJB class loading while our system is not yet defined,
and the weaver would not be able to do the job when using load-time weaving approaches.
</p>

<p>
<b>What about running the system ?</b>
</p>

<p>
In the sample application, I am deploying the EJB using the EJBInterceptorDeployer presented in the previous section.
In a full blown container I would hook the call to it when the application or EJB deployer would register the EJB in the 

system.
The nice thing is that I can run my EJB and still have the interceptors when running as a standalone application by 

using AspectWerkz load time weaving, and a simple static block to declare which class is an EJB.
</p>

<p>
The sample application can be run with (for ones familiar with AspectWerkz, there is no aop.xml..)
</p>

<div class="code"><pre>java -javaagent:lib\aspectwerkz-jdk5-2.0.jar test.ejb3.Sample</pre></div>


<div class="code"><pre><span class="category1">public</span> <span class="category1">class</span> Sample {
 
     <span class="category1">static</span> {
          EJBInterceptorDeployer.deploy("<span class="quote">test.ejb3.MyEJBIsTheAspect</span>", Sample.class.getClassLoader());
      }
 
     <span class="category1">public</span> <span class="category1">static</span> <span class="category1">void</span> main(<span class="category2">String</span> args[]) <span class="category1">throws</span> <span class="category2">Throwable</span> {
          <span class="linecomment">// some one would do a lookup or inject for that when in the container</span>
          MyEJBIsTheAspect myEjb = <span class="category1">new</span> MyEJBIsTheAspect();
  
          System.out.println("<span class="quote">Calling the EJB</span>");
          <span class="category1">int</span> i = myEjb.businessSum(1, 2);
          System.out.println("<span class="quote">got : </span>" + i);
      }
}</pre></div>


<div class="code"><pre>AW EJB3 - Deploying test.ejb3.MyInterceptor <span class="category1">for</span> test.ejb3.MyEJBIsTheAspect
AW EJB3 - Deploying test.ejb3.MyEJBIsTheAspect <span class="category1">for</span> test.ejb3.MyEJBIsTheAspect
Calling the EJB
--&gt; MyInterceptor.interceptStandalone
  method: <span class="category1">public</span> <span class="category1">int</span> test.ejb3.MyEJBIsTheAspect.businessSum(<span class="category1">int</span>,<span class="category1">int</span>)
  args[0]: 1
  args[1]: 2
--&gt; MyEJBIsTheAspect.interceptMySelf
  method: <span class="category1">public</span> <span class="category1">int</span> test.ejb3.MyEJBIsTheAspect.businessSum(<span class="category1">int</span>,<span class="category1">int</span>)
  args[0]: 1
  args[1]: 2
got : 3</pre></div>



<p>
<b>Conclusion</b>
</p>

<p>
Though at first glance I found the interceptor part of the EJB 3 specification fairly odd, and was a bit sad that some 

important AOP concepts like precedence and aspect life cycle, as well as expressiveness of the pointcut language are 

completely sacrified, I must admit that it might help ones familiarize with AOP concepts.
</p>

<p>
It took 1h to implement the EJB 3 interceptor spec and have it perfectly integrated with AOP - unlike so far exposed EJB 

3 previews by JBoss and Oracle (though those are actual preview, while this article is more a technology focus and 

positionning).
It took 15 minutes more to implement a pointcut extension thru a new @org.codehaus.aspectwerkz.ejb3.AroundInvokeAOP 

annotation, that allows me to reuse the expressiveness of the pointcuts ie a vendor extension:
</p>

<div class="code"><pre><span class="category1">public</span> <span class="category1">class</span> MyInterceptor {
 
     @AroundInvoke
     @AroundInvokeAOP("<span class="quote">execution(* *.businessSum(..))</span>")
     <span class="category1">public</span> <span class="category2">Object</span> interceptStandalone(InvocationContext ctx) <span class="category1">throws</span> <span class="category2">Exception</span> {
          System.out.println("<span class="quote">--&gt; MyInterceptor.interceptStandalone</span>");
          System.out.println("<span class="quote">  method: </span>" + ctx.getMethod());
          <span class="category1">for</span> (<span class="category1">int</span> i = 0; i &lt; ctx.getParameters().length; i++) {
               <span class="category2">Object</span> o = ctx.getParameters()[i];
               System.out.println("<span class="quote">  args[</span>"+i+"<span class="quote">]: </span>" + o);
           }
          <span class="category1">return</span> ctx.proceed();
      }
}</pre></div>


<p>
Some more time would allow me to have further features, like f.e. supporting cflow and args pointcut, so that an 

interceptor may look like an advice as it looks like in AspectWerkz aspects, with static access to intercepted method 

arguments etc (ie no boxing in an Object[] array).
</p>

<p>
A next iteration would be to integrate with the AspectWerkz hot deployment feature, and this would bring in hot 

deployment of EJB interceptors at no cost - while still having everything statically compiled for the runtime to perform 

at its best.
</p>

<p>
This implementation may seems at first glance full of details, and perhaps like a hammer to address a simple part of the 

spec. I don't think so. I think <b>it address the very crucial point that so far everyone has skept</b> - including 

JBoss folks (that have a foot in the AOP trench): <b>it integrates seamlessly with the aspects and AOP concepts, and 

actually allow advanced user to apply more advanced AOP concepts as well ie bridging the gap between a commercial 

concept and needs (EJB interception) and a sound concept backed by years of research (AOP and cross-cutting)</b>.
</p>

<p>
So which vendor will be the first to have its EJB play well with AOP : like applying an interceptor thru a real 

pointcut, defining programmatic precedence etc, dealing with cflow and hotdeployment of interceptors, and all that with 

an implementation that can scale ?
</p>

<p>
<b>Want the source code ?</b>
This one is part of AspectWerkz CVS.
It can be browsed from <a 

href="http://cvs.aspectwerkz.codehaus.org/viewrep/aspectwerkz/aspectwerkz4/src/compiler-extensions/ejb3">here</a>.
</p>

<br/>
<br/>

<small>
<p>
Side note: my feedback on the specication:
</p>

<p>
There are some odd things in the 3.5 section of the JSR-220 that I have spot:
<ul><li>
- (sect. 3.5.1) an interceptor class or EJB can <i>only have one single</i> @AroundInvoke method (advice) in it, and its 

signature is (sect. 3.5.4) "@AroundInvoke Object someNameOfYourChoice(InvocationContext ctx) throws Exception". Why 

limitating that to having one single method in the interceptor class or EJB (sect. 3.5.1). My guess is that it is tied 

to the fact that precedence between advice would then be harder to define in the spec without new semantics.
Then one might wonder <i>why an interceptor is not defined as an interface</i> with one single method "intercept(...)" 

that the EJB could implement as well. Having this interface would suppress the need for @AroundInvoke which sounds like 

an annotation overuse (unless it is a door open for vendor extension as I will do below..). I'll be interested in EG 

feedback on that topic, especially in regards of the first limitation.
</li><li>
- interceptor components <i>life cycle</i> is unspecified but stateless. That sounds like a very important and powerfull 

concept of AOP (especially AspectJ) that has been left aside. It is probably an interesting door to provide vendor 

specific extension ie thread safe interceptor, per bean class interceptor, per bean instance interceptor, per 

application interceptor etc (but then interceptor component may not be stateless anymore.)
</li><li>
- (3.5) an interceptor intercepts all business method (or MessageListener methods for MDB). This means that every 

interceptor will be poluted with a code snip like "if (invocationContext.getMethod().getName().equals("doSomething")) 

..." ie ones will have to write sort of a pointcut in a very loosy way while AOP allow us to write that in a neat way 

(and further, a way that tools can easy understand to spot which method is intercepted by what).
</li><li>
- javax.ejb.InvocationContext is tied to EJB. What will happen when interceptors will end up somewhere else ?
</li></ul>
</p>

<p>
Fortunately, the implementation exposed in this article addresses those issues nicely from a vendor specific extension 

perspective.
</p>
</small>

<small>
<p>
Note: These are my own thoughts and not of my employer ..
</p>
</small>

]]></description>
<dc:subject>Technology</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-04-14T16:50:08+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/000993_bea_joins_eclipse.html">
<title>BEA joins Eclipse</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/000993_bea_joins_eclipse.html</link>
<description><![CDATA[<p>That's an exciting time for BEA.</p>

<p>We now have announced we are joining <a href="http://eclipse.org">Eclipse</a> with a number of interesting things in the pipe, ranging from <b>AOP</b> with the AspectWerkz/AspectJ effort leading to <a href="http://eclipse.org/aspectj">AspectJ 5</a>, to the <b>IDE part</b> that will shape up BEA WorkShop, and leading positions in the <b>Web Tools Platform</b>, and in the <b>JDT compiler</b> area.</p>

<p>Things were a bit odd when we shipped an <a href="http://blogs.codehaus.org/people/avasseur/archives/000923_aspectwerkz_aop_eclipse_plugin.html">AspectWerkz Eclispe plugin</a> some month ago, since everyone out there was thinking that there was a death match between <a href="http://www.bea.com/framework.jsp?CNT=index.htm&FP=/content/products/workshop">BEA WorkShop</a> and Eclipse... Didn't you thought that way ?</p>

<p>And don't say we have started to sneak in randomly just to catch up. Things are now ranging from the JVM with AOP work going on within <a href="http://www.bea.com/framework.jsp?CNT=index.htm&FP=/content/products/jrockit">JRockit</a> up to the IDE...</p>

<p>Read the news<br />
<a href="http://biz.yahoo.com/prnews/050222/sftu152_1.html">http://biz.yahoo.com/prnews/050222/sftu152_1.html</a></p>]]></description>
<dc:subject>Technology</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-02-23T17:14:23+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/000991_junit_test_cases_and_number_of_tests_.html">
<title>JUnit Test cases and number of tests ?</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/000991_junit_test_cases_and_number_of_tests_.html</link>
<description><![CDATA[<p>Last time I was reading about a project, folks were arguing they had many many tests.</p>

<p>But what is exactly this measurement ? Do we have to count the number of classes that extend <code>JUnit TestCase
</code>
, or the number of <code>test*(..)
</code>
 methods, or the number of calls to JUnit <code>assert*(..)
</code>
 ?</p>

<p>The current figures for AspectWerkz are pretty much those one:<br />
- 92 extends TestCase<br />
- 544 test*() methods<br />
- 1380 calls to assert*(..)</p>

<p>Off course, what would matter would be the coverage (that has several definitions as well), but still, the number of test in an interesting thing to define.</p>

<p>So how many tests do I have ?</p>]]></description>
<dc:subject>Technology</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-02-22T15:26:33+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/000986_writting_idea_plugins.html">
<title>Writting IDEA plugins</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/000986_writting_idea_plugins.html</link>
<description><![CDATA[<p>Today Jonas and I shipped <a href="http://backport175.codehaus.org">Backport175</a>, a back port of the JSR-175, the Java 5 Annotations spec.</p>

<p>This project comes with an Eclipse plugin and an IDEA plugin, so its time to say something about <a href="http://www.jetbrains.com/idea/">IDEA</a>...</p>

<p>I just like the architecture of the IDEA plugins. There is <b>very few docs</b> on the topic, some very bad javadoc, and some samples around but no books yet etc.<br />
Anyway, you can find some help on the <a href="http://www.intellij.net/forums/index.jsp?cat=8">IDEA forums</a>, and guys like the <a href="http://groovy.codehaus.org/IDEA's+OpenAPI+tips">Groovy</a> ones have written plugins as well, so you can find a bunch of code around.</p>

<p>The nice thing in IDEA plugins is that it s just code, a rather clear API, and a bit of IOC (IDEA is using <a href="http://www.picocontainer.org/">PicoContainer</a>). A plugin as just one XML descriptor.<br />
For an Eclipse plugin, you need a lot of XML, find what are the extension point, and dig in the docs and books, and get familiar with the Eclipse plugin wizardry. The game is very different, while for IDEA, it s just an API that you have to get familiar with.</p>

<p>What is missing the most in IDEA v4 is a <b>good plugin project wizard</b>, but if you have the chance to give a try to IDEA IRIDA, the <a href="http://intellij.net/auth.jsp">EAP</a> of the upcoming v5, then you have it, and it's as easy to debug your plugin as it is for a regular app.<br />
The great thing with IDEA is that you can write a very small Ant script to build the plugin. I would not even try to go there for Eclipse (perhaps I am wrong ...).</p>

<p>You can probably learn some in that space by comparing both Backport175 plugins. It will leads you thru<br />
- how to have a menu of your own to add / remove the feature to a given project (nature / actions and menu)<br />
- how to hook in in the build system (builder / compilation listener) <br />
- how to deal with markers</p>

<p>Off course, it is probably not the correct design neither for Eclipse nor for IDEA (I am far from beeing efficient in that plugin area) but it seems to do the job.</p>

<p><a href="http://cvs.backport175.codehaus.org/viewrep/backport175/intellij">IDEA plugin CVS</a><br />
<a href="http://cvs.backport175.codehaus.org/viewrep/backport175/eclipse">Eclipse plugin CVS</a></p>

<p>Thanks to JetBrains to allow free use of IDEA for OSS projects !</p>]]></description>
<dc:subject>Technology</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-02-15T18:02:15+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/000961_spring_pointcut_on_steroids.html">
<title>Spring pointcut on steroids</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/000961_spring_pointcut_on_steroids.html</link>
<description><![CDATA[<p><b>Three months ago</b> when we wrote the AWBench AOP benchmark suite, I had to hack some little Spring AOP aspect and pointcuts.</p>

<p>If you are familiar with Spring and know about AOP (AspectJ, AspectWerkz, JBoss etc), you know that <b>Spring pointcuts are rather ... well sadly un-intuitives</b>.<br />
They might be for new users, but not anymore when you have very basic AOP knowlegde, and you are more and more !</p>

<p>I could not resist and integrating Spring with AspectWerkz pointcut (yes, once again  for the third time, after the Spring container Jonas did and the extensible container we shipped.)</p>

<p>A Spring pointcut before the wedding with AspectWerkz - almost impossible to combine with other patterns unless you have your <i>"Mastering Spring XML"</i> in the pocket...<br />
<pre><br />
    &lt;bean id="theMethodExecutionGetTargetAndArgsAroundAdvisor1"<br />
        class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"&gt;<br />
        &lt;property name="advice"&gt;<br />
            &lt;ref local="theMethodExecutionGetTargetAndArgsAroundAdvice"/&gt;<br />
        &lt;/property&gt;<br />
        &lt;property name="pattern"&gt;<br />
            &lt;value&gt;.*aroundStackedWithArgAndTarget.*&lt;/value&gt;<br />
        &lt;/property&gt;<br />
    &lt;/bean&gt;<br />
</pre></p>

<p>Spring pointcut as a real pointcut thanks to the wedding with <b>AspectWerkzPointcutAdvisor</b><br />
<pre><br />
    &lt;bean id="theMethodExecutionAfterThrowingAdvisor"<br />
        class="awbench.spring.AspectWerkzPointcutAdvisor"&gt;<br />
        &lt;property name="advice"&gt;<br />
            &lt;ref local="theMethodExecutionAfterThrowingAdvice"/&gt;<br />
        &lt;/property&gt;<br />
        &lt;property name="expression"&gt;<br />
            &lt;value&gt;execution(* *..*.afterThrowingRTE(..))&lt;/value&gt;<br />
        &lt;/property&gt;<br />
    &lt;/bean&gt;<br />
</pre></p>

<p><br />
Such a basic code source is <a href="http://cvs.aspectwerkz.codehaus.org/viewrep/aspectwerkz/awbench/src/spring/awbench/spring/AspectWerkzPointcutAdvisor.java?r=1.1">there</a> and should perhaps be reviewed by Spring guys for some of the API details.</p>

<p><br />
The great news is that this will be part of a next release of Spring, and details will be handled by the AspectJ 5 engine instead. That was about time ;-)<br />
</p>]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-01-24T18:32:28+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/000958_aspectj_and_aspectwerkz_to_join_forces.html">
<title>AspectJ and AspectWerkz to Join Forces</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/000958_aspectj_and_aspectwerkz_to_join_forces.html</link>
<description><![CDATA[<p>Today we have finally announced that we are joining AspectJ to work on <b>AspectJ 5</b>.</p>

<p>We will focus on what has been the success of AspectWerkz<br />
- plain Java AOP, relying on an annotation defined aspect style<br />
- load time weaving, and integration in J2EE environment</p>

<p>The new team is backed by both IBM and BEA and the new project will be delivered in the coming months. One of the priority is to make sure that a smooth migration path exists from AspectWerkz to AspectJ 5.</p>

<p>That' s a great day for AspectWerkz and AspectWerkz users.<br />
<a href="http://blogs.codehaus.org/projects/aspectwerkz/archives/000957_aspectj_and_aspectwerkz_to_join_forces.html">Read more about it</a></p>]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2005-01-19T10:09:43+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/000934_yapb_aop_1234_released.html">
<title>YAPB AOP 1.2.3.4 released</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/000934_yapb_aop_1234_released.html</link>
<description><![CDATA[<p>I am pleased to announce the first release of YAPB AOP.</p>

<p><i>For those who don't like this April Fool like YAPB AOP, please read this post on The Server Side - <a href="http://www.theserverside.com/news/thread.tss?thread_id=30692">read</a><br />
Note: YAPBAOP is a real project with real source code and runnable demo !</i></p>

<p><br />
<b>Features</b><br />
YAPB AOP 1.2.3.4 is <b>Yet Another Proxy Based AOP</b> for Java.<br />
It is<br />
- proxy-based (AspectWerkz proxy)<br />
- pure java, no language extensions, no external tools needed<br />
- simple and intuitive<br />
- direct, programmatic configuration and un-configuration<br />
- j2ee friendly, no need to mess with class loading<br />
- supports AOP Alliance API for MethodInterception<br />
- JDK 1.5.0 annotations support to match on annotation<br />
- per instance programmatic interception<br />
- full speed</p>

<p><b>Sample code</b><br />
here is how YAPB AOP 1.2.3.4 use is simple:<br />
<p><br />
<pre><br />
// no aspect<br />
System.out.println(" ( no aspect )");<br />
YapbaopDemo me0 = new YapbaopDemo();<br />
me0.method();</p>

<p>System.out.println(" ( bind a new aspect )");<br />
Yapbaop.Handle handle = Yapbaop.bindAspect(DemoAspect.class, "* yapbaop.demo.YapbaopDemo.*(..)");<br />
YapbaopDemo me1 = (YapbaopDemo) Proxy.newInstance(YapbaopDemo.class);<br />
me1.method();</p>

<p>handle.unbind();</p>

<p>// get a new one but not using the proxy cache then..<br />
System.out.println(" ( unbind it and get a new proxy YapbaopDemo-2)");<br />
YapbaopDemo me2 = (YapbaopDemo) Proxy.newInstance(YapbaopDemo.class, false, false/*not advisable*/);<br />
me1.method();// still has advice<br />
me2.method();// no advice<br />
</pre><br />
</p></p>

<p><b>Extra features</b><br />
It was very boring to do and does not bring any value to the table, so please, stop inventing (is is the right word ?) YAPB AOP clones based on your favorite bytecode library / proxy library.</p>

<p>It took 40min to hack (time for a train trip, YAPB AOP are that easy today).</p>

<p>If you want to do something usefull, write an email to your favorite AOP framework representative (AspectJ, AspectWerkz, JBoss AOP, Spring AOP, dynAOP, joyAOP [RIP ?], jeetAOP [RIP ?], YAPB AOP [RIP]) and wonder how to<br />
- write some usefull reusable aspect<br />
- write some good article<br />
- provide a new feature, a performance improvement, a bug report or fix<br />
- go an apply to speak about it to the next conference you can find<br />
- imagine new things !</p>

<p><b>Download Now !</b><br />
- Get it <a href="http://people.codehaus.org/~avasseur/yapbaop-1.2.3.4.jar">there</a> (3 Mo jar since YAPBAOP is actually 1 class of 200 lines messed with a lot of dependancies so that you think it is a killing framework)<br />
- Run the demo with:<br />
<pre><br />
java -cp yapbaop-1.2.3.4.jar yapbaop.demo.YapbaopDemo<br />
</pre></p>

<p><b>Access the source code</b><br />
The framework - <a href="http://cvs.aspectwerkz.codehaus.org/viewrep/~raw,r=1.1/aspectwerkz/aspectwerkz4/src/compiler-extensions/aop-alliance/src/samples/yapbaop/core/Yapbaop.java">here</a><br />
The demo to play with - <a href="http://cvs.aspectwerkz.codehaus.org/viewrep/~raw,r=1.1/aspectwerkz/aspectwerkz4/src/compiler-extensions/aop-alliance/src/samples/yapbaop/demo/YapbaopDemo.java">here</a><br />
The AOP alliance aspect for the demo - <a href="http://cvs.aspectwerkz.codehaus.org/viewrep/~raw,r=1.1/aspectwerkz/aspectwerkz4/src/compiler-extensions/aop-alliance/src/samples/yapbaop/demo/DemoAspect.java">here</a></p>

<p><b>Write your own !</b><br />
Ever wanted to be an Open Source star [*] ? Write your own. Enroll now !<br />
[*] A wrong assumption seems to be that to be an Open Source star, ones have to write at least one YABP AOP. If you only contribute to the next big thing, you ll never be a star, so you 'd better start your own YA RIP framework instead of working with others - that's what mankind is about according to this wrong assumption.</p>

<p>Here are some ideas :<br />
- change the Yapbaop.bindAspect to support binding to a java.lang.reflect.Method<br />
- do the same with an array of java.lang.reflect.Method<br />
- do the same with 1+ Method Annotation(s)<br />
- add some filtering based on 1+ Class Annotation(s)</p>

<p><b>If you have read till there</b><br />
Thanks to read this post.<br />
If you dig YAPB AOP architecture, you will find that it is based on<br />
- AspectWerkz proxy<br />
- AspectWerkz extensible AOP container to support AOP Alliance aspect<br />
- AspectWerkz runtime as regards binding of aspects<br />
Quite interesting actuallly isn'it ?</p>]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2004-12-22T09:42:19+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/000923_aspectwerkz_aop_eclipse_plugin.html">
<title>AspectWerkz AOP Eclipse Plugin</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/000923_aspectwerkz_aop_eclipse_plugin.html</link>
<description><![CDATA[<p>Well, we for long have said that <b>plain Java AOP and annotation defined aspects</b> don't needs fancy GUI support, but I have to admit, this makes everyones life easier.</p>

<p>So I am pleased to announce the availability of the <b>AspectWerkz Eclipse Plugin</b> based on the 2.x releases.</p>

<p><a href="http://docs.codehaus.org/display/AW/Eclipse+plugin">Get it now, see the doc and the screenshots !</a></p>

<p>The plugin contains two almost disjunct features:<br />
<ul><br />
<li>an embedded compiler (a builder in the Eclipse plugin world) for our <b>Java 1.4 strongly typed annotations</b>. Just write the annotations as you would do with Java 5 but in JavaDoc (arrays, nested annotations etc are supported), and write one interface per annotation (where you would write an <b>@interface</b> with Java 5), and the plugin will do the trick when Eclipse will compile your code.<br />
The annotations are then accessible at runtime (using AspectWerkz <i>Annotations</i> API)and you can use them in your pointcuts (nothing new there).<br />
</li><br />
<li>a glue layer that  shows the <b>cross cutting view</b> that is add little markers in the gutter to remind you that this <i>piece of code at that line</i> (join point) is advised by this and that before advice in this and that aspect. <br />
</li><br />
</ul><br />
<p><i>(Each feature is a builder so you can deactivate them on a a per project basis if you don't like them / use them.)</i></p></p>

<p>Aside since your app will gets weaved, you can just click <i>run</i> and the aspects are in - nothing more to do.<br />
If you need to expose your dependencies jar files to the weaver, use the dedicated <b>AspectWerkz launch configuration</b> that will configure load time weaving for you.</p>

<p>Feedback welcome.<br />
Any volunteer for further evolution ?</p>

<p>The plugin ships for Eclipse 3 and Java 1.4. More to come on Java 5 later.</p>

<p>Alex</p>

<p><p><i>Oh forgot to say before <a href="http://www.jboss.org">others</a> make a story about that: yes we are the last one to write an Eclipse plugin, way (decades?) after AspectJ and some month after JBoss.</i></p></p>]]></description>
<dc:subject>AOP</dc:subject>
<dc:creator>avasseur</dc:creator>
<dc:date>2004-12-13T19:25:09+01:00</dc:date>
</item>
<item rdf:about="http://blogs.codehaus.org/people/avasseur/archives/000839_jaoo_2004_aop_coverage_day_1_and_2.html">
<title>JAOO 2004 AOP coverage - day 1 and 2</title>
<link>http://blogs.codehaus.org/people/avasseur/archives/000839_jaoo_2004_aop_coverage_day_1_and_2.html</link>
<description><![CDATA[<p>I am back from the <a href="http://www.jaoo.dk">JAOO conference</a> that is happening this week in Aarhus, a city in the west part of the Denmark.<br />
Jonas and I had the opportunity to speak there, and since I feel that there is only a little coverage of it in the blog<br />
community, I have decided to take care of that DK duty.</p>

<p>This post won't give you the right view on this conference, since I attented to my own fields related session aka AOP related, but anyway, you will have a minimum.</p>

<p><h2>The conference</h2></p>

<p>The conference is this year largely sponsored by Microsoft, among others of the .Net or Java ground. Great guys are speaking there, like Rod Johnson (Spring / Interface21 - you know him), Rickard Oberg (former JBoss ejb guy, closed source AOP/CMS lead at Senselogic) , Martin Fowler, Arno Schmidmeier (early AspectJ user, AOSD consultant), Peter Von der Ahé (javac Sun guy), Jonas Bonér and myself to name a few and a bunch of .Net guys.</p>

<p>Though the conference location was a bit far from the airport, the accomodation was good, lunches were fine, with DK stuff but not too much for a FR guy, and the monday night social party was pretty good.</p>

<p><h2>Day 1 - Keynote by Microsoft</h2></p>

<p>I have attended the monday keynote given by a Microsoft guy. It was a good insight to see what MS is attempting to achieve, thinking ahead the C# things while people are just excited about the upcoming release of a new Visual C# things.</p>

<p>it was interesting to hear about how clever is Microsoft when it leads to the latest Java 5 Tiger new features, which are some sort of compiler trick for most of them.<br />
In .Net, when you have an int, this one is an object, and there is boxing / unboxing features somehow, but the int himself is reflectively accessible. In the Java world we have blessed (or cursed as Jonas said...) primitive types (int ...) and boxed types (Integer etc), and Tiger provides boxing and unboxing but thru a compiler trick - that is the bytecode will make use of <i>yourInteger.intValue()</i> and <i>Integer.valueOf(yourint)</i> under the hood.</p>

<p>Microsoft gave a bunch of other samples, and admitted that it was somehow easier to start a good language desgin from scratch that sketching on an existing one.</p>

<p><h2>Day 1 - Sessions</h2></p>

<p>I did not attended more on monday morning since I had to prepare some for our own session and I hope to see someone providing feedback on it since it is not fair to write it myself but still...</p>

<p><h3>Annotation driven AOP with AspectWerkz</h3></p>

<p>Jonas and I were giving a talk in the J2SE track on Annotation and AOP.<br />
We started with an AOP crash course just to get everyone on the train.<br />
Then we explained how Tiger annotations are used in AspectWerkz to have <i>annotation defined aspects</i> (something that JBoss has recently lazily followed).</p>

<p>Annotations are also used in AspectWerkz as a matching mechanism, and we went thru a sample where it is perfectely safe to refactor your methods without taking care about the underlying AOP without any whatever IDE plugings.</p>

<p>You can check our slides <a href="http://aspectwerkz.codehaus.org/downloads/papers/JAOO2004-AnnotationDrivenAOP.zip">there</a>, but for the impatient, here is how our strongly typed matching aspect looks like for <i>annotation driven AOP</i>. As you can see, there is no string based, wildcard based magic there.</p>

<pre>
// Annotation driven AOP
// Sample of strongly typed matching
// in AspectWerkz AOP with annotations

<p>@Service<br />
public class Math {</p>

<p>  @Async<br />
  public Result complexComputation(Arguments args) {<br />
    ...// this may take a while - we should do it in another thread<br />
  }<br />
}  </p>

<p>public class AsyncAspect {</p>

<p>  @Around<br />
  @Within(Service.class)<br />
  @Execution(Async.class)<br />
  Object doAsynchronously(JoinPoint joinpoint) {<br />
      ...<br />
  }<br />
}<br />
</pre></p>

<p>The session went fine, and the room was pretty much full, with around 400 attendees and after the session we met and chatted some with Rickard Oberg.</p>

<p>After that we had a sort of J2SE panel, which turned out to be a BOF since the JAOO crew had not provided us with a moderator. It ended up in discussing some details and pitfalls in the new Tiger features, like generics and static import.</p>

<p><h2>Night 1 - All conferences are about social events</h2></