Subject roleDesignate = new Subject();
Set principalSet = new HashSet();
Iterator realmPrincipals = role.getRealmPrincipals().iterator();
while (realmPrincipals.hasNext()) {
RealmPrincipalInfo realmPrincipal = (RealmPrincipalInfo) realmPrincipals.next();
java.security.Principal principal = ConfigurationUtil.generateRealmPrincipal(realmPrincipal.getRealm(), realmPrincipal.getDomain(), realmPrincipal, classLoader);
principalSet.add(principal);
if (realmPrincipal.isDesignatedRunAs()) roleDesignate.getPrincipals().add(principal);
}
Iterator domainPrincipals = role.getLoginDomainPrincipals().iterator();
while (domainPrincipals.hasNext()) {
LoginDomainPrincipalInfo domainPrincipal = (LoginDomainPrincipalInfo) domainPrincipals.next();