class WildFlyELResolverPlugin {

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

    public static final String PURGE_CLASS_CACHE_METHOD_NAME = "$$ha$resetCache";

    @Init
    Scheduler scheduler;

    @Init
    ClassLoader appClassLoader;

    /**
     * Hook on BeanELResolver class and for each instance: - ensure plugin is
     * initialized - register instances using registerBeanELResolver() method.
     *
     * @param ctClass
     *            the ct class
     * @param classPool
     *            the class pool
     * @throws CannotCompileException
     *             the cannot compile exception
     * @throws NotFoundException
     *             the not found exception
     */
    @OnClassLoadEvent(classNameRegexp = "javax.el.BeanELResolver")
    public static void beanELResolverRegisterVariable(CtClass ctClass, ClassPool classPool) throws CannotCompileException, NotFoundException {<FILL_FUNCTION_BODY>}

    /**
     * Hook on BeanELResolver class and for each instance: - ensure plugin is
     * initialized - register instances using registerBeanELResolver() method.
     *
     * @param ctClass
     *            the ct class
     * @param classPool
     *            the class pool
     * @throws CannotCompileException
     *             the cannot compile exception
     * @throws NotFoundException
     *             the not found exception
     */
    @OnClassLoadEvent(classNameRegexp = "org.jboss.el.cache.BeanPropertiesCache")
    public static void beanPropertiesCache(CtClass ctClass, ClassPool classPool) throws CannotCompileException, NotFoundException {
        for (CtConstructor constructor : ctClass.getDeclaredConstructors()) {
            constructor.insertAfter("java.lang.ClassLoader $$cl = Thread.currentThread().getContextClassLoader();" + PluginManagerInvoker.buildInitializePlugin(WildFlyELResolverPlugin.class, "$$cl"));
        }
        LOGGER.info("Patched org.jboss.el.cache.BeanPropertiesCache");
    }

    /**
     * Hook on org.jboss.el.cache.BeanPropertiesCache.SoftConcurrentHashMap
     * class and for each instance: - ensure plugin is initialized - register
     * instances using registerBeanELResolver() method
     *
     * @param ctClass
     *            the ct class
     * @param classPool
     *            the class pool
     * @throws CannotCompileException
     *             the cannot compile exception
     * @throws NotFoundException
     *             the not found exception
     */
    @OnClassLoadEvent(classNameRegexp = "org.jboss.el.cache.BeanPropertiesCache.SoftConcurrentHashMap")
    public static void beanPropertiesCacheSoftConcurrentHashMap(CtClass ctClass, ClassPool classPool) throws CannotCompileException, NotFoundException {
        ctClass.addMethod(CtMethod.make("public java.util.Set entrySet() { return map.entrySet();}", ctClass));
        LOGGER.info("Patched org.jboss.el.cache.BeanPropertiesCache$SoftConcurrentHashMap");
    }

    /**
     * Hook on BeanELResolver class and for each instance: - ensure plugin is
     * initialized - register instances using registerBeanELResolver() method.
     *
     * @param ctClass
     *            the ct class
     * @param classPool
     *            the class pool
     * @throws CannotCompileException
     *             the cannot compile exception
     * @throws NotFoundException
     *             the not found exception
     */
    @OnClassLoadEvent(classNameRegexp = "org.jboss.el.cache.FactoryFinderCache")
    public static void factoryFinderCache(CtClass ctClass, ClassPool classPool) throws CannotCompileException, NotFoundException {
        for (CtConstructor constructor : ctClass.getDeclaredConstructors()) {
            constructor.insertAfter("java.lang.ClassLoader $$cl = Thread.currentThread().getContextClassLoader();" + //
                    PluginManagerInvoker.buildInitializePlugin(WildFlyELResolverPlugin.class, "$$cl"));
        }
        LOGGER.info("Patched org.jboss.el.cache.FactoryFinderCache");
    }

    /**
     * Invalidate class cache.
     *
     * @param original
     *            the original
     * @throws Exception
     *             the exception
     */
    @OnClassLoadEvent(classNameRegexp = ".*", events = LoadEvent.REDEFINE)
    public void invalidateClassCache(Class<?> original) throws Exception {
        LOGGER.trace("Running invalidateClassCache {}", appClassLoader);
        PurgeWildFlyBeanELResolverCacheCommand cmd = new PurgeWildFlyBeanELResolverCacheCommand(appClassLoader, original.getName());
        scheduler.scheduleCommand(cmd, 250, DuplicateSheduleBehaviour.SKIP);
    }

    /**
     * Initialize instance.
     *
     * @param pluginConfiguration
     *            the plugin configuration
     */
    @Init
    public void initializeInstance(PluginConfiguration pluginConfiguration) {
        LOGGER.info("WildFlyELResolver plugin initialized");
    }
}

        for (CtConstructor constructor : ctClass.getDeclaredConstructors()) {
            constructor.insertAfter("java.lang.ClassLoader $$cl = Thread.currentThread().getContextClassLoader();" + PluginManagerInvoker.buildInitializePlugin(WildFlyELResolverPlugin.class, "$$cl"));
        }

        LOGGER.info("Patched JbossELResolver");
    
<no_super_class>