class JvmFilterHolder {

    private final List<JvmFilter> JVM_FILTERS    = new CopyOnWriteArrayList<>();

    private final AtomicBoolean   FILTERS_SORTED = new AtomicBoolean(false);

    public void addJvmFilter(JvmFilter f) {
        JVM_FILTERS.add(f);
        FILTERS_SORTED.compareAndSet(true, false);
    }

    public void clearJvmFilters() {
        JVM_FILTERS.clear();
    }

    private void sortJvmFilters() {
        if (FILTERS_SORTED.compareAndSet(false, true)) {
            JVM_FILTERS.sort(AnnotationAwareOrderComparator.INSTANCE);
        }
    }

    public List<JvmFilter> getJvmFilters() {
        sortJvmFilters();
        return JVM_FILTERS;
    }

    public static boolean beforeInvoking(JvmFilterContext context) {
        List<JvmFilter> filters = context.getSofaRuntimeContext().getJvmFilterHolder()
            .getJvmFilters();
        for (JvmFilter filter : filters) {
            if (!filter.before(context)) {
                return false;
            }
        }
        return true;
    }

    public static boolean afterInvoking(JvmFilterContext context) {<FILL_FUNCTION_BODY>}
}

        List<JvmFilter> filters = context.getSofaRuntimeContext().getJvmFilterHolder()
            .getJvmFilters();
        for (int i = filters.size() - 1; i >= 0; --i) {
            if (!filters.get(i).after(context)) {
                return false;
            }
        }
        return true;
    
<no_super_class>