<div dir="ltr"><div class="gmail_extra"><div>Hi all,<br></div><div><br></div><div>The CDI spec defines the "Transactional observer methods" (§10.4.5) with a TransactionPhase :</div><div><br></div><div><font face="monospace, monospace">public enum TransactionPhase {</font></div><div><font face="monospace, monospace"> IN_PROGRESS,</font></div><div><font face="monospace, monospace"> BEFORE_COMPLETION,</font></div><div><font face="monospace, monospace"> AFTER_COMPLETION,</font></div><div><font face="monospace, monospace"> AFTER_FAILURE,</font></div><div><font face="monospace, monospace"> AFTER_SUCCESS</font></div><div><font face="monospace, monospace">}</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">void onDocumentUpdate(@Observes(<b>during=AFTER_SUCCESS</b>) @Updated Document doc) { ... }</font></div><div><br></div><div><br></div><div>Now that there is a new Security specification coming along, it would be helpful to be able to <b>observe before/after the user logs-in or logs-out</b>, for example. First I thought "well, the Security spec defines a set of events, fires them, and we just have to observe them". But what about the "during" phase ? What would make more sense in such use case ? Using the same "during" mechanism or events ?</div><div><br></div><div><font face="monospace, monospace">public enum LoginPhase {</font></div><div><font face="monospace, monospace"> BEFORE_LOGIN,</font></div><div><font face="monospace, monospace"> AFTER_LOGIN,</font></div><div><font face="monospace, monospace"> BEFORE_LOGOUT,</font></div><div><font face="monospace, monospace"> AFTER_LOGOUT,</font></div><div><font face="monospace, monospace">}</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">void onLogout(@Observes(<b>during=BEFORE_LOGOUT</b>) User user) { ... }</font></div><div><br></div><div><br></div><div>Any thoughts ?</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Antonio Goncalves <br>Software architect, Java Champion and Pluralsight author<br><br><a href="http://www.antoniogoncalves.org" target="_blank">Web site</a> | <a href="http://twitter.com/agoncal" target="_blank">Twitter</a> | <a href="http://www.linkedin.com/in/agoncal" target="_blank">LinkedIn</a> | <a href="http://pluralsight.com/training/Authors/Details/antonio-goncalves" target="_blank">Pluralsight</a> | <a href="http://www.parisjug.org" target="_blank">Paris JUG</a> | <a href="http://www.devoxx.fr" target="_blank">Devoxx France</a></div></div>
</div></div>