configureDefaultServlet(defaultServlet, earContext, moduleName, knownServletMappings, moduleContext);
}
}
private GBeanData configureDefaultServlet(Object defaultServlet, EARContext earContext, AbstractName moduleName, Set knownServletMappings, EARContext moduleContext) throws GBeanNotFoundException, GBeanAlreadyExistsException {
GBeanData servletGBeanData = getGBeanData(kernel, defaultServlet);
AbstractName defaultServletObjectName = earContext.getNaming().createChildName(moduleName, (String) servletGBeanData.getAttribute("servletName"), NameFactory.SERVLET);
servletGBeanData.setAbstractName(defaultServletObjectName);
servletGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
Set<String> defaultServletMappings = new HashSet<String>((Collection<String>) servletGBeanData.getAttribute("servletMappings"));
defaultServletMappings.removeAll(knownServletMappings);
servletGBeanData.setAttribute("servletMappings", defaultServletMappings);
moduleContext.addGBean(servletGBeanData);
return servletGBeanData;
}