Skip to content

Releases: jcabi/jcabi-aspects

ArrayMap#with(Map)

27 Sep 12:18
Compare
Choose a tag to compare

New method with(Map) added to immutable ArrayMap. Now you can merge maps like that:

Map<String, String> map = new ArrayMap<String, String>()
  .with("first", "hello!")
  .with(new ArrayMap<String, String>().with("second", "boom!"))
  .with("third", "foo");

@Parallel annotation

23 Sep 16:36
Compare
Choose a tag to compare

@Parallel annotation introduced for methods execution in parallel threads. This is going to be a very useful technique for unit testing, when you need to verify thread-safety of an object. For example:

public class FooTest {
  @Test
  public void fooIsThreadSafe() {
    Foo foo = new Foo();
    new Runnable() {
      @Override
      @Parallel(threads = 10)
      public void run() {
        foo.doSomething();
      }
    }
  }
}

Method doSomething() will be executed in ten parallel threads. If any of the threads throw an exception method, annotated method also throws.

All threads will start at the same time.

Only void returning methods can be annotated.

@Quietly and extra attributes for @ScheduleWithFixedDelay

18 Sep 13:26
Compare
Choose a tag to compare

@Quietly annotation was introduced in #1, which makes possible elegant (if we may call them so) swallowing of exceptions:

@Quietly
public void process(String data) {
  throw new IllegalStateException("this exception will never bubble up");
}

@ScheduleWithFixedDelay annotation got three new attributes in #2, which makes its shutdown behaviour more configurable and predictable. Now you can tell exactly how long you want to wait for threads termination on close() call and how many times you want to call shutdownNow() when threads are not responding.

Besides than, @RetryOnFailure now reports total waiting time in log.

Basic Annotations, Stable Version

18 Sep 12:37
Compare
Choose a tag to compare

This is the first release in the project since we branched form the main jcabi reactor. The version is stable and proven to work in a few commercial projects already.