public void handleRequest(final HttpServerExchange exchange) throws Exception {
SecurityContext sc = exchange.getAttachment(UndertowSecurityAttachments.SECURITY_CONTEXT_ATTACHMENT);
RunAsIdentityMetaData identity = null;
RunAs old = null;
try {
final ServletChain servlet = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY).getCurrentServlet();
identity = runAsIdentityMetaDataMap.get(servlet.getManagedServlet().getServletInfo().getName());
RunAsIdentity runAsIdentity = null;
if (identity != null) {
UndertowLogger.ROOT_LOGGER.tracef("%s, runAs: %s", servlet.getManagedServlet().getServletInfo().getName(), identity);
runAsIdentity = new RunAsIdentity(identity.getRoleName(), identity.getPrincipalName(), identity.getRunAsRoles());
}
old = SecurityActions.setRunAsIdentity(runAsIdentity, sc);
// Perform the request