[jboss-cvs] JBossAS SVN: r67995 - projects/security/security-jboss-sx/trunk/jbosssx/src/main/org/jboss/security/auth/spi.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Dec 6 11:23:11 EST 2007


Author: anil.saldhana at jboss.com
Date: 2007-12-06 11:23:11 -0500 (Thu, 06 Dec 2007)
New Revision: 67995

Modified:
   projects/security/security-jboss-sx/trunk/jbosssx/src/main/org/jboss/security/auth/spi/Util.java
Log:
SECURITY-98: take into consideration suspendResume

Modified: projects/security/security-jboss-sx/trunk/jbosssx/src/main/org/jboss/security/auth/spi/Util.java
===================================================================
--- projects/security/security-jboss-sx/trunk/jbosssx/src/main/org/jboss/security/auth/spi/Util.java	2007-12-06 13:31:03 UTC (rev 67994)
+++ projects/security/security-jboss-sx/trunk/jbosssx/src/main/org/jboss/security/auth/spi/Util.java	2007-12-06 16:23:11 UTC (rev 67995)
@@ -92,9 +92,9 @@
    {
       Logger log = aslm.log;      
       boolean trace = log.isTraceEnabled();
-      Enumeration users = roles.propertyNames();
+      Enumeration<?> users = roles.propertyNames();
       SimpleGroup rolesGroup = new SimpleGroup("Roles");
-      ArrayList groups = new ArrayList();
+      ArrayList<Group> groups = new ArrayList<Group>();
       groups.add(rolesGroup);
       while (users.hasMoreElements() && targetUser != null)
       {
@@ -168,23 +168,26 @@
       Logger log = aslm.log;
       boolean trace = log.isTraceEnabled();
       Connection conn = null;
-      HashMap setsMap = new HashMap();
+      HashMap<String,Group> setsMap = new HashMap<String,Group>();
       PreparedStatement ps = null;
       ResultSet rs = null;
       
-      TransactionManagerLocator tml = new TransactionManagerLocator();
-      TransactionManager tm;
-      try
+      TransactionManager tm = null;
+      
+      if(suspendResume)
       {
-         tm = tml.getTM("java:/TransactionManager");
-      }
-      catch (NamingException e1)
-      {
-         throw new RuntimeException(e1);
-      }
-      if(tm == null)
-         throw new IllegalStateException("Transaction Manager is null");
-
+         TransactionManagerLocator tml = new TransactionManagerLocator();
+         try
+         {
+            tm = tml.getTM("java:/TransactionManager");
+         }
+         catch (NamingException e1)
+         {
+            throw new RuntimeException(e1);
+         }
+         if(tm == null)
+            throw new IllegalStateException("Transaction Manager is null");
+      }      
       Transaction tx = null;
       if (suspendResume)
       {




More information about the jboss-cvs-commits mailing list