* @return RunAsIdentity for the servet if one exists, null otherwise
*/
@XmlTransient
public RunAsIdentityMetaData getRunAsIdentity(String ejbName)
{
RunAsIdentityMetaData identity = runAsIdentity.get(ejbName);
if (identity == null)
{
JBossEnterpriseBeanMetaData ejb = this.getEnterpriseBean(ejbName);
if (ejb != null)
{
// Check for a ejb-jar.xml run-as only specification
synchronized (runAsIdentity)
{
SecurityIdentityMetaData si = ejb.getSecurityIdentity();
if(si != null)
{
RunAsMetaData runAs = si.getRunAs();
if (runAs != null)
{
String roleName = runAs.getRoleName();
identity = new RunAsIdentityMetaData(roleName, null);
runAsIdentity.put(ejbName, identity);
}
}
}
}