ensureNotInitialized();
try {
if (deploymentInfo.getServlets().containsKey(servletName)) {
return null;
}
ServletInfo servlet = new ServletInfo(servletName, (Class<? extends Servlet>) deploymentInfo.getClassLoader().loadClass(className));
deploymentInfo.addServlet(servlet);
deployment.getServlets().addServlet(servlet);
return new ServletRegistrationImpl(servlet, deployment);
} catch (ClassNotFoundException e) {
throw UndertowServletMessages.MESSAGES.cannotLoadClass(className, e);