// If ejb, use isCallerInRole
if (isContainerContextAContainerObject() && roleName == null){
ComponentInvocation componentInvocation =
Switch.getSwitch().getInvocationManager().getCurrentInvocation();
EJBContext ejbcontext = (EJBContext)componentInvocation.context;
Set s = groupNameSecurityMap.keySet();
Iterator i = s.iterator();
while (i.hasNext()){
String entry = (String)i.next();
boolean isInRole = false;
try{
isInRole = ejbcontext.isCallerInRole(entry);
} catch (Exception ex){
_logger.log(Level.FINE,"asciPasswordAuthentication::caller not in role "+entry);
}
if (isInRole){
return (Principal)groupNameSecurityMap.get(entry);