handle = factory.createInstance();
} catch (Exception e) {
throw UndertowServletMessages.MESSAGES.couldNotInstantiateComponent(servletInfo.getName(), e);
}
instance = handle.getInstance();
instance.init(new ServletConfigImpl(servletInfo, servletContext));
//if a servlet implements FileChangeCallback it will be notified of file change events
final ResourceManager resourceManager = servletContext.getDeployment().getDeploymentInfo().getResourceManager();
if(instance instanceof ResourceChangeListener && resourceManager.isResourceChangeListenerSupported()) {
resourceManager.registerResourceChangeListener(changeListener = (ResourceChangeListener) instance);
}