Friday, October 26, 2007

JBoss AOP 2.0.0.beta2 released!

JBoss AOP 2.0.0.beta2 has been released. Thanks to the team, and especially Flavia for staying up all night working on last minute fixes.

You can download it here, and view the release notes here.

One major feature that is new in this release is the ability to intercept arrays as requested by the JBoss Cache guys.

Monday, October 8, 2007

Just Java 2007

Just Java 2007 took place last week, from October 3rd to October 5th.

It was a great event. I would like to thank all attendants that watched my presentation on the first day, as well as all presenters that picked a JBoss-based theme to expose.

Being the first time I did a presentation on such an event, it was a very nice professional experience for me. I hope this is the first time of many more to come :)

Monday, October 1, 2007

JBoss AOP 1.5.6.GA released

JBoss AOP 1.5.6.GA was released on Friday. There were some problems with uploading the dist to sourceforge, so I have replaced it with a fresh copy. The release notes can be found here and it can be got from the downloads page.

JBoss AOP 1.5.6.GA is the version that will go in JBoss AS 4.2.2.GA.

Monday, September 17, 2007

JBoss AOP 2.0.0.beta1 released

JBoss AOP 2.0.0.beta1 has been released. It contains a number of new features and bug fixes. The release notes with the changes since the previous release can be found here.

Tuesday, July 17, 2007

Just Java 2007 - Brazil

I'm glad to announce that my submission to Just Java 2007 Conference (a Brazilian Java conference) has been accepted!

All Just Java 2007 attendants are invited to join me on October 5th, 15:30h, to participate on my presentation entitled "JBoss AOP: Tópicos Avançados de Programação Orientada a Aspectos" ("JBoss AOP - Advanced Topics on Aspect-Oriented Programming"). I wold like to thank Kabir for kindly providing me material for this work.

Besides, we will have several other interesting works on JBoss (a raw English translation is provided in parentheses):
  • "JBoss 5 e as novidades do Application Server Opensource Lider do Mercado " ("JBoss 5 and what is new on the Market Lead Opensource Application Server") - Edgar Silva
  • "Produtividade com o framework JBoss Seam e o RedHat Developer Studio" ("Productivity with JBoss Seam and Red Hat Developer Studio") - Givanildo Santana do Nascimento
  • "JBoss Rules: Mudando as Regras do Jogo" ("JBoss Rules: Changing the Rules of the Game") - Edson Tirelli
  • "JBoss: EJB3, JMS, JMX e Schedulers " ("JBoss: EJB3, JMS, JMX and Schedulers") - Leandro Lima
  • "JBoss Cache - Distribuido, transacionado, alta-performance POJO cache"("JBoss Cache - A distributed, transaction-enabled POJO Cache") - Marcio Augusto Paes de Moraes
  • "JBoss: Uma avalanche de Soluções Open-Source para SOA" ("JBoss - An avalanche of Open-Source SOA Solutions") - Edgar Silva

People interested in AOP might also enjoy the following:
  • "Spring AOP no ambiente corporativo" ("Spring AOP on enterprise environment") - Eduardo Issao Ito

For more information, refer to the links:

Friday, June 15, 2007

JBoss AOP 2.0.0.alpha5 released

The JBoss AOP team have just released JBoss AOP 2..0.0.alpha5, which now contains most
of the core functionality that will go into the GA release. Please download it and
help test it out, and keep the feedback coming via our user forum.
The release zip files from 2.0.0.alpha5 onwards will now be hosted on instead of at (JBoss AOP 1.5.x will continue to be hosted at

The release contains documentation and an AOP tutorial to quickly get you up and running with JBoss AOP. This release is packaged differently from previous releases.
To help you upgrade to JBoss AOP 2.0.0 in an existing JBoss Application Server instance, we provide Ant scripts under

  • jboss-40-install/jboss-aop-jdk14.deployer/
    (to replace the existing AOP 1.5.x. JDK 1.4 deployer)

  • jboss-40-install/jboss-aop-jdk50.deployer/
    (to replace the existing AOP 1.5.x. JDK 5 deployer)

Simply modify the file in one of these directories to point to the JBoss server you want to patch with the new release, before running Ant.

We obviously support all the features from previous alphas.
The main new standout feature this time is Before/After/Throwing/Finally advices which are more lightwight than the traditional Around advices since we avoid the allocation of
the Invocation object that drives the advice chain in the case of Around advices. A simple example of an around advice:

public class POJO{
public void method(){}

<aop><aspect class="AroundAspect"/>
<bind pointcut="execution(void POJO->method())">
<advice aspect="AroundAspect" name="around"/>

public class AroundAspect{
public Object around(MethodInvocation inv){
System.out.println("Entering aspect");
return inv.invokeNext();
System.out.println("Leaving aspect");


The same functionality can be implemented as a pair of Before and After advices:
public class POJO{
public void method(){}

<aop><aspect class="BeforeAfterAspect"/>
<bind pointcut="execution(void POJO->method())">
<before aspect="BeforeAfterAspect" name="before"/>
<after aspect="BeforeAfterAspect" name="after"/>

public class BeforeAfterAspect{
public void before(){
System.out.println("Entering aspect");

public void after(){
System.out.println("Leaving aspect");

We can also access things like the typed target method arguments and return type from the new style advice methods

public class POJO{
public static int multiply(int i1, int i2){
return i * l;

<aspect class="BeforeAfterAspect"/>
<bind pointcut="execution(void POJO->multiply())">
<before aspect="BeforeAfterAspect" name="before"/>
<after aspect="BeforeAfterAspect" name="after"/>

public class BeforeAfterAspect{
public void before(@Arg int i, @Arg int j){
System.out.println("Multiplying " + i + " by " + j);

public int after(@Return int rtn){
//Let's always make the number positive
if (i < 0){
return i * (-1);
return i;

In the above example, if we call

int result = POJO.multiply(3, -10);

The advice method parameters need to be annotated. @Arg ensures that the first argument to BeforeAfterAspect.before() will
be 3, the second will be -10; The @Return annotation ensures that the rtn argument to POJO.after() will
contain the result of calling POJO.mulitply(), so it will have the value -30. The advice will override this value and make this possible
so result ends up being 30.

We also support other arguments to advice methods such as:

  • @JoinPoint - access to the method, constructor or field called

  • @Target - access to the target instance being called

  • @Thrown - access to the exception thrown in an after or finally advice

  • @Args - a mutable array of the arguments passed in to the target jounpoint

  • @Caller - the calling instance when using caller pointcuts

Please see the tutorials that come with the release for more information about how to use before/after/throwing/finally advice.

Thanks to Flavia Rainone for all her hard work on this release, and to all our users for the feedback on the forum. If you are using JBoss AOP, or just have
some time to kill, and you want to help out, get in touch via or design forum.
You can also mail Flavia or me directly.