private Module installWebappModule(ServletContext servletContext, Resource resource, Dictionary<String, String> headers) { String contextPath = servletContext.getContextPath(); Resource association = NamedResourceAssociation.getResource(contextPath); resource = association != null ? association : resource; AttachableSupport context = new AttachableSupport(); context.putAttachment(SERVLET_CONTEXT_KEY, servletContext); Module module; try { Runtime runtime = RuntimeLocator.getRequiredRuntime(); ClassLoader classLoader = servletContext.getClassLoader(); module = runtime.installModule(classLoader, resource, headers, context); } catch (RuntimeException rte) { throw rte; } catch (ModuleException ex) { throw new IllegalStateException(ex); } return module; }
private Module installWebappModule(ServletContext servletContext, Resource resource, Dictionary<String, String> headers) { String contextPath = servletContext.getContextPath(); Resource association = NamedResourceAssociation.getResource(contextPath); resource = association != null ? association : resource; AttachableSupport context = new AttachableSupport(); context.putAttachment(SERVLET_CONTEXT_KEY, servletContext); Module module; try { Runtime runtime = RuntimeLocator.getRequiredRuntime(); ClassLoader classLoader = servletContext.getClassLoader(); module = runtime.installModule(classLoader, resource, headers, context); } catch (RuntimeException rte) { throw rte; } catch (ModuleException ex) { throw new IllegalStateException(ex); } return module; }