/* */ }
/* 78 */ SecurityIdentity si = null;
/* 79 */ SecurityContext sc = SecurityActions.getSecurityContext();
/* 80 */ SecurityContext invSC = (SecurityContext)invocation.getMetaData("security", "context");
/* */
/* 82 */ SecurityDomain domain = (SecurityDomain)this.container.resolveAnnotation(SecurityDomain.class);
/* */
/* 84 */ boolean domainExists = (domain != null) && (domain.value() != null) && (domain.value().length() > 0);
/* */ Principal p;
/* 91 */ if (domainExists)
/* */ {
/* 93 */ p = null;
/* 94 */ Object cred = null;
/* */
/* 97 */ if ((sc == null) && (invSC == null))
/* */ {
/* 99 */ sc = SecurityActions.createSecurityContext(domain.value());
/* 100 */ SecurityActions.setSecurityContext(sc);
/* */ }
/* */
/* 103 */ if (shelper.isLocalCall(mi))
/* */ {
/* 105 */ if (sc == null)
/* 106 */ throw new IllegalStateException("Security Context null on Local call");
/* 107 */ si = sc.getUtil().getSecurityIdentity();
/* */ }
/* */ else
/* */ {
/* 111 */ if ((invSC == null) && (sc == null)) {
/* 112 */ throw new IllegalStateException("Security Context is not available");
/* */ }
/* */
/* 115 */ if (invSC != null)
/* */ {
/* 117 */ sc = invSC;
/* 118 */ p = sc.getUtil().getUserPrincipal();
/* 119 */ cred = sc.getUtil().getCredential();
/* 120 */ String unprefixed = SecurityUtil.unprefixSecurityDomain(domain.value());
/* 121 */ sc = SecurityActions.createSecurityContext(p, cred, null, unprefixed);
/* */
/* 125 */ SecurityActions.setSecurityContext(sc);
/* 126 */ sc.getUtil().setSecurityIdentity(invSC.getUtil().getSecurityIdentity());
/* */ }