String moduleID = newContext.getDeploymentInfo().getModuleID();
PolicyContext.setContextID(moduleID);
// set the default subject if needed
if (ContextManager.getCurrentCaller() == null) {
Subject defaultSubject = ejbDeployment.getDefaultSubject();
if (defaultSubject != null) {
ContextManager.setCallers(defaultSubject, defaultSubject);
geronimoCallContext.clearCallers = true;
}
}
// apply run as
Subject runAsSubject = ejbDeployment.getRunAs();
geronimoCallContext.callers = ContextManager.pushNextCaller(runAsSubject);
newContext.set(GeronimoCallContext.class, geronimoCallContext);
}