/* */ {
/* 154 */ EJBContainer ec = (EJBContainer)this.container;
/* */
/* 156 */ Principal callerPrincipal = null;
/* */
/* 158 */ RealmMapping rm = (RealmMapping)this.container.getSecurityManager(RealmMapping.class);
/* */
/* 160 */ SecurityContext sc = SecurityContextAssociation.getSecurityContext();
/* 161 */ if (sc == null)
/* */ {
/* 163 */ SecurityDomain domain = (SecurityDomain)ec.resolveAnnotation(SecurityDomain.class);
/* 164 */ String unauth = domain.unauthenticatedPrincipal();
/* 165 */ if ((unauth != null) && (unauth.length() > 0) &&
/* 166 */ (domain.unauthenticatedPrincipal() != null))
/* 167 */ callerPrincipal = new SimplePrincipal(unauth);
/* */ }
/* */ else
/* */ {
/* 171 */ EJBAuthorizationHelper helper = new EJBAuthorizationHelper(sc);
/* 172 */ callerPrincipal = helper.getCallerPrincipal(rm);
/* */ }
/* */
/* 175 */ if (callerPrincipal == null)
/* */ {
/* 178 */ callerPrincipal = sc.getUtil().getUserPrincipal();
/* 179 */ if (rm != null) {
/* 180 */ callerPrincipal = rm.getPrincipal(callerPrincipal);
/* */ }
/* */ }
/* 183 */ if (callerPrincipal == null)
/* */ {
/* 185 */ SecurityDomain domain = (SecurityDomain)ec.resolveAnnotation(SecurityDomain.class);