Weld 3.0.0.Final - the first implementation of CDI 2.0!

2017-5-15   release   Martin Kouba

I am very pleased to announce the release of Weld 3.0.0.Final - the first implementation of CDI 2.0! I would like to thank not only to everyone involved in this particular release but also to the Weld community as a whole and also to all active CDI EG members who invested a lot of energy into the specification process!

/**
 * TODO: Continue to deliver bugfixes and improvements
 */
public class WeldTeam extends OpenSourceCommunity {

  @Inject
  @AwesomeNews
  Event<String> event;

  public void release() {
    // Fire asynchronously so that we don't need to wait for observer notification before we start celebrating!
    event.fireAsync("CDI 1.2 is dead, long live CDI 2.0!");
    celebrate();
  }

}
Note
Weld 3 is an IMPORTANT MILESTONE. Therefore, we’re preparing a special blogpost summarizing all the important stuff that was added. Expect the Tour around Weld 3 blogpost within a few days.

Let’s sum up the notable changes since 3.0.0.CR2:

  • Weld defines two non-portable notification options to configure the notification of asynchronous observer methods (see also Notification options for more info):

    • weld.async.notification.mode - the notification mode, possible values are: SERIAL (default) and PARALLEL

    • weld.async.notification.timeout - the notification timeout (in milliseconds) after which the returned completion stage must be completed.

      • If the time expires the stage is completed exceptionally with a CompletionException holding the java.util.concurrent.TimeoutException as its cause

      • The expiration does not abort the notification of the observers

  • Session replication - handle situation when HTTPSessionBean might not be serializable (WELD-2346)

  • Fire @Initialied(RequestScoped.class)/@Destroyed(RequestScoped.class) events for a @PostConstruct callback if the request context was activated for the specific callback

  • Weld SE

    • It’s possible to easily register a org.jboss.weld.bootstrap.api.Service during container bootstrap (WELD-2360)

    • Any javax.enterprise.inject.spi.CDI method can now be called during AfterDeploymentValidation (WELD-2371)

    • ContainerInitialized and ContainerShutdown now implement toString() (WELD-2354)

  • Weld Servlet

    • Fixed usage of Jandex on Tomcat when using unpackWars=false (WELD-2357)

  • Added option to disable Jandex in Weld SE and Weld Servlet (WELD-2374)

  • Development tools

    • If a deployment validation fails and the development mode is enabled a simple validation HTML report (which contains a lot of useful information) is generated

      • Users are encouraged to always attach this report when asking a question on the mailing list or any other communication channel

  • Updated documentation and migration notes for integrators

  • Examples cleanup (dropped GAE support, etc.)

WildFly Patch

As usual, a patch for WildFly is available. This time the target platforms are WildFly 10.1.0.Final and WildFly 11.0.0.Alpha1. If you’re not familiar with patching WildFly, check the FAQ.