[cdi-dev] Can an observer be both async and sync?

John Ament john.ament at spartasystems.com
Sun Mar 5 19:42:09 EST 2017


Section 10.4.4 has the following section which got me thinking


public void refreshOnDocumentUpdate(@Observes(notifyObserver=IF_EXISTS) @Updated Document doc) { ... }

public void asyncRefreshOnDocumentUpdate(@ObservesAsync(notifyObserver=IF_EXISTS) @Updated Document doc) { ... }


I'm wondering, is it OK to have an observer method defined like this?


public void asyncRefreshOnDocumentUpdate(@Observes(notifyObserver=IF_EXISTS) @ObservesAsync(notifyObserver=IF_EXISTS) @Updated Document doc) { ... }


I don't see anything against this in the spec, but I suspect most people are going to think this shouldn't work.  So I'm asking the question - should it work?


John



________________________________
NOTICE: This e-mail message and any attachments may contain confidential, proprietary, and/or privileged information which should be treated accordingly. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this message, and destroy all physical and electronic copies. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20170306/32b3861a/attachment-0001.html 


More information about the cdi-dev mailing list