• 0.26.0

Useful Java AOP Aspects:

Useful Java AOP Aspects is a collection of useful AOP aspects and Java annotations which allow you to modify the behavior of your Java application without writing lots of duplicate code.

For example, you may want to retry HTTP resource downloading in case of a failure. You can implement a full do/while cycle yourself or you can annotate the method with @RetryOnFailure and let one of our AOP aspects do the work for you:

public class MyResource {
  @RetryOnFailure
  public String load(URL url) {
    return url.openConnection().getContent();
  }
}

jcabi-aspects works together only with AspectJ, an aspect oriented programming (AOP) framework. At the moment, we offer the following aspects (we extend this list every few months):

After you add these annotations to your code, you should configure your build system to "weave" your binaries after compilation. (This is mandatory! Without this step, annotations will have absolutely no effect)!

If you have any questions, please submit an issue to Github.

Also, check these blog articles, they are explaining how the library works, in details:

Cutting Edge Version

If you want to use a current version of the product, you can do it with this configuration in your pom.xml:

<repositories>
  <repository>
    <id>oss.sonatype.org</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
  </repository>
</repositories>
<dependencies>
  <dependency>
    <groupId>com.jcabi</groupId>
    <artifactId>jcabi-aspects</artifactId>
    <version>0.26.0</version>
  </dependency>
</dependencies>