Red Hat

In Relation To Jozef Hartinger

In Relation To Jozef Hartinger

Weld 2.0.1.Final

Posted by Jozef Hartinger    |       |    Tagged as Weld

Weld 2.0.1.Final has been released. This is mainly a bug-fixing release with 20 issues fixed since the previous one. For details, see the release notes.

Our focus is now shifting towards WildFly and its Weld integration in order to provide a CDI 1.1 compliant container. For details about CDI 1.1, see Pete's blog post. Furthermore, we plan frequent releases of Weld to continue, so expect another release in early July at the latest!

[ Distribution ] [ Release notes ] [ Documentation ] [ CDI 1.1 Javadoc ]

Weld 2.0.0.Final released

Posted by Jozef Hartinger    |       |    Tagged as Weld

I am pleased to announce the release of Weld 2.0.0.Final, the reference implementation of Contexts and Dependency Injection for Java EE 1.1 (JSR 346). For a list of major changes in CDI 1.1 see the specification.

The reference implementation will soon be available in GlassFish 4 and WildFly (formerly JBoss Application Server). In the meantime you can check snapshots of the application servers.

As always, Weld artifacts can be obtained from maven or you can use a distribution bundle.

Along with the Weld release comes the final release of the Technology Compatibility Kit (TCK) for CDI 1.1. Martin Kouba did an excellent job writing new tests and keeping the TCK in sync with the almost never-ending stream of specification changes. The TCK splits the specification into 1550 testable assertions out of which 96.71% is covered by TCK tests.

I would like to thank to everyone who lent a hand and helped delivering these releases, especially: Martin Kouba, Pete Muir, Marko Lukša, Stuart Douglas, Marek Schmidt, Ron Šmeral, Tomáš Remeš, JJ Snyder, Phil Zampino, Tomaž Cerar, Hardy Ferentschik, Lincoln Baxter III, Matúš Abaffy and others.

[ Distribution (Weld, CDI TCK)] [ Documentation (Weld, CDI TCK)] [ Javadoc (CDI 1.1, Weld SPI)] [ Issue tracker]

Weld 2.0.0.Beta3

Posted by Jozef Hartinger    |       |    Tagged as Weld

Weld 2.0.0.Beta3 has been released. This is another step towards CDI 1.1 but mainly a bug fixing release. As promised, the reference guide has been updated to reflect recent changes in Weld. See the release notes for details.

[ Distribution (Weld, CDI TCK)] [Release notes (Weld, CDI TCK)] [ CDI 1.1 PRD Javadoc ]

Weld 2.0.0.Beta2 released!

Posted by Jozef Hartinger    |       |    Tagged as Weld

The 2.0.0.Beta2 release of Weld comes less than a month after the previous release. We planned a spin this short to give you a chance to try out the CDI 1.1 preview implementation before going away for the winter break. Several bugs have been fixed. In addition, this release implements the latest changes in the CDI 1.1 specification (see the release notes for details).

JBoss AS

It's easy to upgrade your existing JBoss AS 7 installations with Weld 2. Check the installer (packaged within the distribution bundle) and follow the instructions. You'll need JBoss AS 7.1.1.Final or better.

Happy Holidays Everyone!

[ Distribution (Weld, CDI TCK)] [Release notes (Weld, CDI TCK)] [ CDI 1.1 PRD Javadoc ]

Weld 2.0.0.Beta1

Posted by Jozef Hartinger    |       |    Tagged as Weld

Weld 2.0.0.Beta1 has been released. Weld 2 is the reference implementation of CDI 1.1. This release implements the Public Review Draft of CDI 1.1. You can read more about the CDI draft in Pete’s blog post.

Out of the large number of changes that the draft introduces, I would highlight the following:

Global enablement and ordering of interceptors, decorators and alternatives

An often misunderstood and disliked part of CDI is enablement of interceptors, decorators and alternatives. CDI 1.0 requires each interceptor / decorator / alternative to be explicitly enabled in each bean archive where it should be used.

CDI 1.1 enhances this concept and provides a way of enabling interceptors, decorators and alternatives globally. Such globally enabled component is only defined in a single bean archive and defines a priority which determines its global ordering. Lower priority interceptors and decorators are called first. For alternatives, if there are multiple enabled alternatives matching the same injection point, the alternative with higher priority wins.

<decorators>
    <class priority="100">org.mycompany.myfwk.TimestampLogger</class>
    <class priority="200">org.mycompany.myfwk.IdentityLogger</class>
</decorators>

Alterable contexts and explicit dependency destruction

CDI 1.1 adds an ability to save resources by destroying existing contextual instances. On the SPI part the AlterableContext interface is introduced which exposes the destroy() operation. If a contextual reference is accessed after the underlying instance has been destroyed, a new instance is transparently initialized by the CDI container.

Furthermore, the built-in Instance bean now exposes a destroy() operation which can be used for:

  • releasing dependent instances obtained using Instance
  • destroying normal-scoped instances (a shortcut to the SPI approach above)

Decoration of built-in beans

The realm of decorators has been expanded to support decoration of CDI built-in beans. The following built-in beans support decoration:

  • Event
  • Instance
  • Conversation
  • HttpServletRequest / HttpSession / ServletContext
  • InjectionPoint
  • Principal
  • UserTransaction

The hottest candidates for new extensions are Event (event ordering) and Conversation (conversation begin/end events)

Filtering of ProcessAnnotatedType events based on annotations present

CDI 1.1 introduces the @WithAnnotations annotation. This annotation can be used on extension observer methods to more precisely specify the events an observer method is interested in.

void observeTypesWithInject(@Observes @WithAnnotations(Inject.class) ProcessAnnotatedType<?> event) {
    // TODO: process types
}

In the example above the extension observer method is only notified of AnnotatedTypes which define the @Inject annotation. The specified annotation can appear on the type or any supertype, on any field, method or constructor declared by the type or a supertype, or on any parameter of any method or constructor declared by the type or a supertype. The annotation may be applied as a meta-annotation on any annotation considered.

This allows for both simpler implementation of CDI extensions and faster CDI containers as the additional information exposed via @WithAnnotations allows containers to perform bootstrap optimizations.


Besides implementing the specification changes, this release also fixes more than 30 bugs. We also worked on Weld’s performance. Bootstrap performance of large deployments is now significantly better and we also tuned runtime performace of CDI-bound interceptors a bit.

As always, this release is accompanied with a CDI TCK release with tests for the new CDI 1.1 features.

UPDATE: There is no ready-made AS7 distribution this time. Instead, the Weld bundle contains an installer that you can use to patch any existing JBoss AS 7.1.1.Final or better with Weld 2. Just follow the instructions in the readme file.

Give Weld 2 a try and give us feedback. Note that CDI 1.1 is not yet final so if you do not like something in CDI there’s still time to improve it!

[ Distribution (Weld, CDI TCK)] [Release notes (Weld, CDI TCK)] [ CDI 1.1 PRD Javadoc ]

Weld 2.0.0.Alpha3

Posted by Jozef Hartinger    |       |    Tagged as Weld

Weld 2.0.0.Alpha3 has been released. This is purely a bugfixing release with more than 30 issues resolved. For a complete list of changes, see release notes. This release also comes along with and updated TCK for CDI 1.1.

[ Distribution (Weld, CDI TCK) ] [ JBoss AS 7.1.1.Final with Weld 2.0.0.Alpha3 ] [Release notes (Weld, CDI TCK)] [ CDI 1.1 EDR1 Javadoc ]

Weld 2.0.0.Alpha2 released

Posted by Jozef Hartinger    |       |    Tagged as Weld

Weld 2.0.0.Alpha2 has just been released. Weld 2 is an implementation of JSR-346 (CDI 1.1). The highlights of the new version are:

  • Significant improvement of memory usage. Our benchmarks show that the memory footprint of Weld 2 has been reduced by 50 - 80% compared to Weld 1. This has been achieved mostly by rewriting the metadata layer and separating metadata needed for Weld bootstrap from metadata used at runtime.
  • Concurrent bean deployer and bean validator. These two components speed up Weld bootstrap by leveraging capabilities of multi-core CPUs. The bootstrap time improvement is most significant in large deployments. We plan on reducing bootstrap time even more in future releases.
  • Stuart removed the Javassist dependency entirely and switched to jboss-classfilewriter
  • Around 30 bug fixes, mostly picked from the 1.x branches (most of the credit here goes to Stuart, Ales and Marko)

Furthermore, a new version of the CDI 1.1 TCK has been released. The TCK currently provides a solid coverage (90.60%) of the JSR-346 Early Draft

[ Distribution (Weld, CDI TCK) ] [ JBoss AS 7.1.1.Final with Weld 2.0.0.Alpha2 ] [Release notes (Weld, CDI TCK)] [ CDI 1.1 EDR1 Javadoc ]

Weld 2.0.0.Alpha1 released!

Posted by Jozef Hartinger    |       |    Tagged as Weld

I am very proud to announce the very first alpha release of Weld 2. Weld is the reference implementation of Contexts and Dependency Injection for Java EE (CDI). In the 2.x series of Weld releases, we will be focusing on JSR-346 which is the next version (1.1) of the CDI specification.

The Alpha1 release is a feature-complete implementation of the Early Draft of CDI 1.1. Pete blogged about the news in the early draft some time ago. The following list just highlights some of the new features I consider the most important:

The main reason for building a reference implementation is to prove a specification and reveal potential problem early. While implementing the Early Draft of JSR-346, several issues emerged that were previously unseen. If you are interested in these issues or have an idea of how to address them, feel free to share you opinions in the issue comments or the JSR-346 mailing list. Also, if you want to contribute to Weld 2, now is the right time. Since we are hosted on github forking and playing with Weld is extremely easy.

In addition to our efforts on the Weld side, Martin Kouba has been working on the Technology Compatibility Kit (TCK) for JSR-346. The Alpha1 version of the CDI 1.1 TCK is released along with the Weld release. Martin did a great job and delivered a solid test coverage of the new features. He also migrated the entire testsuite to Arquillian, which enabled us to develop new tests faster while at the same time using more extensive scenarios (such as multiple web applications inside of an enterprise archive).

Weld and CDI TCK artifacts can be obtained from Maven or from a distribution bundle (see the links below). We tried our best to make it easy for you to test-drive the new features. Therefore, we also provide a special build of JBoss AS 7.1.0.CR1 enhanced with Weld 2 :-)

For the next release (Alpha 2), our plan is to look into improving non-functional characteristics of Weld such as memory footprint and start-up time.

[ Distribution (Weld, CDI TCK) ] [ JBoss AS 7.1.0.CR1b with Weld 2.0.0.Alpha1 ] [ Issue tracker (Weld, CDI TCK) ] [ CDI 1.1 EDR1 Javadoc ]

back to top