if (realmName != null) {
appClientContainerGBeanData.setAttribute("realmName", realmName);
appClientContainerGBeanData.setAttribute("callbackHandlerClassName", callbackHandlerClassName);
} else if (geronimoAppClient.isSetDefaultSubject()) {
GerSubjectInfoType subjectInfoType = geronimoAppClient.getDefaultSubject();
SubjectInfo subjectInfo = buildSubjectInfo(subjectInfoType);
appClientContainerGBeanData.setAttribute("defaultSubject", subjectInfo);
appClientContainerGBeanData.setReferencePattern("CredentialStore", credentialStoreName);
} else if (earContext.getSecurityConfiguration() != null) {
//beware a linkage error if we cast this to SubjectInfo
String realm = ((SecurityConfiguration) earContext.getSecurityConfiguration()).getDefaultSubjectRealm();
String id = ((SecurityConfiguration) earContext.getSecurityConfiguration()).getDefaultSubjectId();
if (realm != null) {
SubjectInfo subjectInfo = new SubjectInfo(realm, id);
appClientContainerGBeanData.setAttribute("defaultSubject", subjectInfo);
appClientContainerGBeanData.setReferencePattern("CredentialStore", credentialStoreName);
}
}
appClientContainerGBeanData.setReferencePattern("JNDIContext", jndiContextName);