class RpcFilterContainer {

    private List<String>                    filterIds     = new CopyOnWriteArrayList<String>();

    private List<String>                    filterClasses = new CopyOnWriteArrayList<String>();

    private boolean                         alreadyLoad   = false;
    private final Object                    LOAD_LOCK     = new Object();

    private List<Filter>                    filters       = new CopyOnWriteArrayList<Filter>();

    private static final RpcFilterContainer INSTANCE      = new RpcFilterContainer();

    public static RpcFilterContainer getInstance() {
        return INSTANCE;
    }

    /**
     * 增加 Filter id
     *
     * @param filterId id
     */
    public void addFilterId(String filterId) {
        if (StringUtils.hasText(filterId)) {
            filterIds.add(filterId);
        }
    }

    /**
     * 增加 Filter 实例
     *
     * @param filterClass 实例
     */
    public void addFilterClass(String filterClass) {
        if (StringUtils.hasText(filterClass)) {
            filterClasses.add(filterClass);
        }
    }

    /**
     * 获取所有的 Filter 实例
     *
     * @param applicationContext Spring 上下文
     * @return 所有的 Filter 实例
     */
    public List<Filter> getFilters(ApplicationContext applicationContext) {
        if (applicationContext != null) {
            if (!alreadyLoad) {
                synchronized (LOAD_LOCK) {
                    if (!alreadyLoad) {
                        loadFilters(applicationContext);
                        alreadyLoad = true;
                    }
                }
            }

            return filters;

        } else {
            throw new SofaBootRpcRuntimeException("The applicationContext should not be null");
        }
    }

    /**
     * 加载并持有所有的 Filter id 或实例
     *
     * @param applicationContext Spring 上下文
     */
    private void loadFilters(ApplicationContext applicationContext) {<FILL_FUNCTION_BODY>}
}

        for (String filterId : filterIds) {
            filters.add((applicationContext.getBean(filterId, Filter.class)));
        }
        for (String clazz : filterClasses) {
            Class filterClass;
            try {
                filterClass = Class.forName(clazz);
            } catch (ClassNotFoundException e) {
                throw new SofaBootRpcRuntimeException("Can not find filter class " + clazz + " ", e);
            }
            if (Filter.class.isAssignableFrom(filterClass)) {
                try {
                    filters.add((Filter) filterClass.newInstance());
                } catch (Exception e) {
                    throw new SofaBootRpcRuntimeException("Error happen when create instance of "
                                                          + filterClass + " ", e);
                }
            } else {
                throw new SofaBootRpcRuntimeException("The class of " + clazz
                                                      + " should be a subclass of Filter");
            }
        }
    
<no_super_class>