class UndertowTransformer {

    private static AgentLogger LOGGER = AgentLogger.getLogger(UndertowTransformer.class);

    @OnClassLoadEvent(classNameRegexp = "io.undertow.servlet.core.DeploymentManagerImpl")
    public static void patchWebappLoader(CtClass ctClass) throws NotFoundException, CannotCompileException, ClassNotFoundException {<FILL_FUNCTION_BODY>}
}


        try {
            ctClass.getDeclaredMethod("deploy").insertBefore( "{" +
                    "org.hotswap.agent.plugin.undertow.PrefixingResourceManager rm=" +
                        "new org.hotswap.agent.plugin.undertow.PrefixingResourceManager(originalDeployment.getResourceManager());" +
                    "originalDeployment.setResourceManager(rm);" +
                    UndertowPlugin.class.getName() + ".init(originalDeployment.getClassLoader(),rm);" +
                "}"
            );
        } catch (NotFoundException e) {
            LOGGER.error("io.undertow.servlet.core.DeploymentManagerImpl does not contain start() method.");
        }

        try {
            ctClass.getDeclaredMethod("stop").insertBefore(
                    PluginManagerInvoker.buildCallCloseClassLoader("originalDeployment.getClassLoader()") +
                    UndertowPlugin.class.getName() + ".close(originalDeployment.getClassLoader());"
            );
        } catch (NotFoundException e) {
            LOGGER.error("orgio.undertow.servlet.core.DeploymentManagerImpl does not contain stop() method.");
        }

    
<no_super_class>