http://docs.jboss.org/weld/reference/1.0.0/en-US/html_single/#d0e3997
This portion of the spec looks particularly interesting. Seam has the concept of raising events and observing them via the @RaiseEvent and @Observer annotations.
It is possible in Seam to use the Events API as follows to raise an event:
Events.instance().raiseEvent("foo.bar");
Obviously this is not a typesafe solution so the CDI version has made this typesafe.
Is the other intention to allow more fine-grained control in terms of when the event is raised?
There are five kinds of transactional observers:
*
IN_PROGESS observers are called immediately (default)
AFTER_SUCCESS observers are called during the after completion phase of the transaction, but only if the transaction completes successfully
*
AFTER_FAILURE observers are called during the after completion phase of the transaction, but only if the transaction fails to complete successfully
*
AFTER_COMPLETION observers are called during the after completion phase of the transaction
*
BEFORE_COMPLETION observers are called during the before completion phase of the transaction
Using this technique, we could do audit logging or error logging for tx's... pretty cool...