[jboss-cvs] jboss-seam/doc/reference/en/modules ...
Shane Bryzak
sbryzak at redhat.com
Mon Dec 3 00:08:30 EST 2007
User: sbryzak2
Date: 07/12/03 00:08:30
Modified: doc/reference/en/modules security.xml
Log:
JBSEAM-2303
Revision Changes Path
1.88 +29 -0 jboss-seam/doc/reference/en/modules/security.xml
(In the diff below, changes in quantity of whitespace are not shown.)
Index: security.xml
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/doc/reference/en/modules/security.xml,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -b -r1.87 -r1.88
--- security.xml 15 Nov 2007 07:22:01 -0000 1.87
+++ security.xml 3 Dec 2007 05:08:30 -0000 1.88
@@ -228,6 +228,35 @@
</sect3>
+ <sect3>
+ <title>Special Considerations</title>
+
+ <para>
+ When writing an authenticator method, it is important that it is kept minimal and free from
+ any side-effects. This is because there is no guarantee as to how many times the authenticator
+ method will be called by the security API, and as such it may be invoked multiple times during
+ a single request. Because of this, any special code that should execute upon a successful or
+ failed authentication should be written by implementing an event observer. See the section on
+ Security Events further down in this chapter for more information about which events are
+ raised by Seam Security.
+ </para>
+
+ <para>
+ To give an example, let's say that upon a successful login that some user statistics must be
+ updated. We would do this by writing an event observer for the
+ <literal>org.jboss.seam.security.loginSuccessful</literal> event, like this:
+ </para>
+
+ <programlisting><![CDATA[ @In UserStats userStats;
+
+ @Observer("org.jboss.seam.security.loginSuccessful")
+ public void updateUserStats()
+ {
+ userStats.setLastLoginDate(new Date());
+ userStats.incrementLoginCount();
+ }]]></programlisting>
+ </sect3>
+
</sect2>
<sect2>
More information about the jboss-cvs-commits
mailing list