code: private Subject getSubject()
     {
        return AccessController.doPrivileged(new PrivilegedAction<Subject>()
        {
           /**
            * run method
            */
           public Subject run()
           {
              try
              {
                 String domain = recoverSecurityDomain;
  
                 if (domain != null && subjectFactory != null)
                 {
                    Subject subject = SecurityActions.createSubject(subjectFactory, domain);
                       
                    Set<PasswordCredential> pcs = SecurityActions.getPasswordCredentials(subject);
                    if (!pcs.isEmpty())
                    {
                       for (PasswordCredential pc : pcs)
                       {
                          pc.setManagedConnectionFactory(mcf);
                       }
                    }
  
                    log.debugf("Recovery Subject=%s", subject);
  
                    return subject;
                 }
                 else
                 {
                    log.noCrashRecoverySecurityDomain(jndiName);
                 }
              }
              catch (Throwable t)
              {
                 log.exceptionDuringCrashRecoverySubject(jndiName, t.getMessage(), t);
              }
  
              return null;
           }
        });
     }
docs: This method provide the Subject used for the XA Resource Recovery
  integration with the XAResourceRecoveryRegistry.
  
  This isn't done through the SecurityAssociation functionality of JBossSX
  as the Subject returned here should only be used for recovery.
  
  @return The recovery subject; <code>null</code> if no Subject could be created