[seam-commits] Seam SVN: r10846 - modules/trunk/security/src/main/java/org/jboss/seam/security.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Sun May 10 20:47:39 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-05-10 20:47:38 -0400 (Sun, 10 May 2009)
New Revision: 10846

Modified:
   modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java
Log:
throw exception if more than one authenticator is found

Modified: modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java	2009-05-10 10:29:42 UTC (rev 10845)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java	2009-05-11 00:47:38 UTC (rev 10846)
@@ -377,11 +377,16 @@
       final IdentityManager identityManager = manager.getInstanceByType(IdentityManager.class);
       
       Set<Bean<Authenticator>> authenticators = manager.resolveByType(Authenticator.class);
-      if (authenticators.size() > 0)
+      if (authenticators.size() == 1)
       {
          Bean<Authenticator> authenticatorBean = authenticators.iterator().next();
          authenticator = manager.getInstance(authenticatorBean);
       }
+      else if (authenticators.size() > 1)
+      {
+         throw new IllegalStateException("More than one Authenticator bean found - please ensure " +
+               "only one Authenticator implementation is provided");
+      }      
       else
       {
          authenticator = null;




More information about the seam-commits mailing list