class OmnifacesPlugin {

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

    private boolean initialized;

    public void init() {
        if (!initialized) {
            LOGGER.info("Omnifaces plugin initialized.");
            initialized = true;
        }
    }

    @OnClassLoadEvent(classNameRegexp = "org.omnifaces.ApplicationListener")
    public static void patchApplicationListener(CtClass ctClass) throws CannotCompileException, NotFoundException {<FILL_FUNCTION_BODY>}

    @OnClassLoadEvent(classNameRegexp = "org.omnifaces.cdi.viewscope.ViewScopeContext")
    public static void patchViewScopeContext(ClassPool classPool, CtClass ctClass) throws CannotCompileException, NotFoundException {
        HaCdiCommons.transformContext(classPool, ctClass);
    }

}

        ctClass.getDeclaredMethod("contextInitialized").insertAfter(
            "{" +
                PluginManagerInvoker.buildInitializePlugin(OmnifacesPlugin.class) +
                PluginManagerInvoker.buildCallPluginMethod(OmnifacesPlugin.class, "init") +
            "}"
        );
    
<no_super_class>