RunAs runAsAn = (RunAs)ainfo.getAnnotation();
for (EjbContext ejbContext : ejbContexts) {
EjbDescriptor ejbDesc = ejbContext.getDescriptor();
// override by xml
if (ejbDesc.getUsesCallerIdentity() != null) {
continue;
}
String roleName = runAsAn.value();
Role role = new Role(roleName);
// add Role if not exists
ejbDesc.getEjbBundleDescriptor().addRole(role);
RunAsIdentityDescriptor runAsDesc = new RunAsIdentityDescriptor();
runAsDesc.setRoleName(roleName);
ejbDesc.setUsesCallerIdentity(false);
if (ejbDesc.getRunAsIdentity() == null) {
ejbDesc.setRunAsIdentity(runAsDesc);
}
}
return getDefaultProcessedResult();
RunAs runAsAn = (RunAs)ainfo.getAnnotation();
for (WebComponentContext webCompContext : webCompContexts) {
WebComponentDescriptor webDesc = webCompContext.getDescriptor();
// override by xml
if (webDesc.getRunAsIdentity() != null) {
continue;
}
String roleName = runAsAn.value();
Role role = new Role(roleName);
// add Role if not exists
webDesc.getWebBundleDescriptor().addRole(role);
RunAsIdentityDescriptor runAsDesc = new RunAsIdentityDescriptor();
runAsDesc.setRoleName(roleName);
webDesc.setRunAsIdentity(runAsDesc);
}
return getDefaultProcessedResult();