FileDocCategorySizeDatePackage
RunAsSecurityInterceptorFactory.javaAPI DocJBoss 4.2.13447Fri Jul 13 21:02:28 BST 2007org.jboss.aspects.security

RunAsSecurityInterceptorFactory

public class RunAsSecurityInterceptorFactory extends Object implements org.jboss.aop.advice.AspectFactory
Comment
author
William DeCoste
version
$Revision: 57186 $

Fields Summary
Constructors Summary
Methods Summary
public java.lang.ObjectcreatePerClass(org.jboss.aop.Advisor advisor)

      AuthenticationManager manager = (AuthenticationManager)advisor.getDefaultMetaData().getMetaData("security", "authentication-manager");
      RealmMapping mapping = (RealmMapping)advisor.getDefaultMetaData().getMetaData("security", "realm-mapping");
      if (manager == null)
      {
         SecurityDomain domain = (SecurityDomain)advisor.resolveAnnotation(SecurityDomain.class);
         if (domain == null) throw new RuntimeException("Unable to determine security domain");
         try
         {
            manager = (AuthenticationManager)new InitialContext().lookup("java:/jaas/" + domain.value());
         }
         catch (NamingException e)
         {
            throw new RuntimeException(e);  //To change body of catch statement use Options | File Templates.
         }
         mapping = (RealmMapping)manager;
      }
      if (manager == null) throw new RuntimeException("Unable to find Security Domain");
      return new RunAsSecurityInterceptor(manager, mapping);
   
public java.lang.ObjectcreatePerInstance(org.jboss.aop.Advisor advisor, org.jboss.aop.InstanceAdvisor instanceAdvisor)

      throw new RuntimeException("PER_VM not supported for this interceptor factory, only PER_CLASS");
   
public java.lang.ObjectcreatePerJoinpoint(org.jboss.aop.Advisor advisor, org.jboss.aop.joinpoint.Joinpoint jp)

      throw new RuntimeException("PER_VM not supported for this interceptor factory, only PER_CLASS");
   
public java.lang.ObjectcreatePerJoinpoint(org.jboss.aop.Advisor advisor, org.jboss.aop.InstanceAdvisor instanceAdvisor, org.jboss.aop.joinpoint.Joinpoint jp)

      throw new RuntimeException("PER_VM not supported for this interceptor factory, only PER_CLASS");
   
public java.lang.ObjectcreatePerVM()

      throw new RuntimeException("PER_VM not supported for this interceptor factory, only PER_CLASS");
   
public java.lang.StringgetName()

      return getClass().getName();