[webbeans-dev] syntax problem in @Observes annotation

Dan Allen dan.j.allen at gmail.com
Fri Jun 19 17:58:05 EDT 2009


In section 10.5.4 and 10.5.6, the spec requires that the @Observes
annotation define a notify parameter which accepts the Notify enum. However,
the Java compiler does not allow an annotation to define a method named
notify().

public @interface Observes
{
    Notify notify() default Notify.SYNCHRONOUSLY;
}

This annotation parameter will need to be renamed. I suggest
"notifyObserver".

public void observerMethod(@Observes(notifyObserver=IF_EXISTS) EventType
event)

-Dan

-- 
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20090619/8f03b84d/attachment.html 


More information about the weld-dev mailing list