webAppContext = new WebAppContext(securityHandler, sessionHandler, servletHandler, null);
//wrap the web app context with the jndi handler
GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager);
this.componentContext = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext, userTransaction, kernel, classLoader);
contextHandler = new ComponentContextHandler(webAppContext, this.componentContext);
//install jasper injection support if required
if (contextCustomizer != null) {
Map<String, Object> servletContext = new HashMap<String, Object>();
Map<Class, Object> customizerContext = new HashMap<Class, Object>();
customizerContext.put(Map.class, servletContext);
customizerContext.put(Context.class, JettyWebAppContext.this.componentContext);
contextCustomizer.customize(customizerContext);
for (Map.Entry<String, Object> entry: servletContext.entrySet()) {
webAppContext.setAttribute(entry.getKey(), entry.getValue());
}
}
// localize access to next
{
//install the other handlers inside the web app context
AbstractHandler next = sessionHandler;
next = new ThreadClassloaderHandler(next, classLoader);
next = new InstanceContextHandler(next, unshareableResources, applicationManagedSecurityResources, trackedConnectionAssociator);
next = new UserTransactionHandler(next, userTransaction);
webAppContext.setHandler(next);
//install another component context handler for the lifecycle chain
next = new ComponentContextHandler(next, this.componentContext);
lifecycleChain = (AbstractImmutableHandler) next;
}
MimeTypes mimeTypes = new MimeTypes();
mimeTypes.setMimeMap(mimeMap);
webAppContext.setMimeTypes(mimeTypes);