[jboss-cvs] JBossAS SVN: r57523 - branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 9 22:34:21 EDT 2006
Author: anil.saldhana at jboss.com
Date: 2006-10-09 22:34:20 -0400 (Mon, 09 Oct 2006)
New Revision: 57523
Modified:
branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/AuthenticationInterceptorFactory.java
branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RoleBasedAuthorizationInterceptorFactory.java
branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RunAsSecurityInterceptorFactory.java
Log:
EJBTHREE-732: Consolidate security mgr lookup
Modified: branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/AuthenticationInterceptorFactory.java
===================================================================
--- branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/AuthenticationInterceptorFactory.java 2006-10-10 02:32:28 UTC (rev 57522)
+++ branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/AuthenticationInterceptorFactory.java 2006-10-10 02:34:20 UTC (rev 57523)
@@ -48,7 +48,7 @@
SecurityDomain securityAnnotation = (SecurityDomain) advisor.resolveAnnotation(SecurityDomain.class);
if (securityAnnotation != null)
{
- domain = ctx.lookup(preProcessSecurityDomain(securityAnnotation.value()));
+ domain = SecurityDomainManager.getSecurityManager(securityAnnotation.value(),ctx);
}
}
catch (NamingException e)
@@ -77,19 +77,6 @@
public String getName()
{
return getClass().getName();
- }
-
- /**
- * Ensure that the security domain is of the proper format
- * @param domainValue
- * @return
- */
- private String preProcessSecurityDomain(String domainValue)
- {
- if(domainValue.startsWith("java:/jaas"))
- return domainValue;
- else
- return "java:/jaas/" + domainValue;
- }
+ }
}
Modified: branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RoleBasedAuthorizationInterceptorFactory.java
===================================================================
--- branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RoleBasedAuthorizationInterceptorFactory.java 2006-10-10 02:32:28 UTC (rev 57522)
+++ branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RoleBasedAuthorizationInterceptorFactory.java 2006-10-10 02:34:20 UTC (rev 57523)
@@ -46,7 +46,7 @@
{
InitialContext ctx = container.getInitialContext();
org.jboss.annotation.security.SecurityDomain securityAnnotation = (org.jboss.annotation.security.SecurityDomain) advisor.resolveAnnotation(org.jboss.annotation.security.SecurityDomain.class);
- domain = ctx.lookup(preProcessSecurityDomain(securityAnnotation.value()));
+ domain = SecurityDomainManager.getSecurityManager(securityAnnotation.value(), ctx);
}
catch (NamingException e)
{
@@ -76,19 +76,7 @@
public String getName()
{
return getClass().getName();
- }
+ }
- /**
- * Ensure that the security domain is of the proper format
- * @param domainValue
- * @return
- */
- private String preProcessSecurityDomain(String domainValue)
- {
- if(domainValue.startsWith("java:/jaas"))
- return domainValue;
- else
- return "java:/jaas/" + domainValue;
- }
}
Modified: branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RunAsSecurityInterceptorFactory.java
===================================================================
--- branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RunAsSecurityInterceptorFactory.java 2006-10-10 02:32:28 UTC (rev 57522)
+++ branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/security/RunAsSecurityInterceptorFactory.java 2006-10-10 02:34:20 UTC (rev 57523)
@@ -28,21 +28,15 @@
import org.jboss.aop.Advisor;
import org.jboss.aop.InstanceAdvisor;
import org.jboss.aop.advice.AspectFactory;
-import org.jboss.aop.joinpoint.Joinpoint;
-import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.joinpoint.Joinpoint;
import org.jboss.logging.Logger;
import org.jboss.security.AuthenticationManager;
import org.jboss.security.RealmMapping;
-import org.jboss.security.RunAsIdentity;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.ejb3.Container;
+import org.jboss.security.RunAsIdentity;
import org.jboss.ejb3.EJBContainer;
import org.jboss.ejb3.tx.NullInterceptor;
import org.jboss.annotation.security.RunAsPrincipal;
-import java.security.Principal;
-import java.util.Set;
-import java.util.Iterator;
import java.util.HashSet;
public class RunAsSecurityInterceptorFactory implements AspectFactory
@@ -86,7 +80,7 @@
{
InitialContext ctx = container.getInitialContext();
org.jboss.annotation.security.SecurityDomain securityAnnotation = (org.jboss.annotation.security.SecurityDomain) advisor.resolveAnnotation(org.jboss.annotation.security.SecurityDomain.class);
- domain = ctx.lookup("java:/jaas/" + securityAnnotation.value());
+ domain = SecurityDomainManager.getSecurityManager(securityAnnotation.value(), ctx);
}
catch (NamingException e)
{
More information about the jboss-cvs-commits
mailing list