Stack<Callers> callersStack = threadLocal.get();
GeronimoStandardContext context = (GeronimoStandardContext) parent;
Wrapper wrapper = event.getWrapper();
String runAsRole = wrapper.getRunAs();
Subject runAsSubject = context.getSubjectForRole(runAsRole);
Callers oldCallers = ContextManager.pushNextCaller(runAsSubject);
callersStack.push(oldCallers);
}
} else if (event.getType().equals(InstanceEvent.AFTER_SERVICE_EVENT)) {
Container parent = event.getWrapper().getParent();
if (parent instanceof GeronimoStandardContext) {
Stack<Callers> callersStack = threadLocal.get();
Callers oldCallers = callersStack.pop();
ContextManager.popCallers(oldCallers);
}
}
}