// Path: framework/src/main/java/com/kifile/android/cornerstone/core/DataProvider.java
// public interface DataProvider<DATA> {
// 
//     void setFetcher(DataFetcher<DATA> fetcher);
// 
//     /**
//      * Add the observer into watch list, when data changed, notify it.
//      *
//      * @param observer
//      */
//     void registerDataObserver(DataObserver<DATA> observer);
// 
//     /**
//      * Remove observer from watch list.
//      *
//      * @param observer
//      */
//     void unregisterDataObserver(DataObserver<DATA> observer);
// 
//     /**
//      * Refresh data.
//      */
//     void refresh();
// 
//     /**
//      * Notify observers data changed.
//      */
//     void notifyDataChanged();
// 
//     DATA getData();
// 
//     /**
//      * @return If the data need update, return true.
//      */
//     boolean isDataNeedUpdate();
// 
//     /**
//      * Release the resources when destroy. If the worker thread is working, stop it.
//      */
//     void release();
// }


import com.kifile.android.cornerstone.core.AbstractDataProviderManager;
import com.kifile.android.cornerstone.core.DataProvider;
package com.kifile.android.cornerstone.impl;


/**
 * Cornerstone is a simple implement of {@link AbstractDataProviderManager}.
 *
 * @author kifile
 */
public class Cornerstone extends AbstractDataProviderManager {

    private static Cornerstone sInstance;

    private Cornerstone() {
        // Make Cornerstone singleton.
    }

    /**
     * Use singleton here.
     *
     * @return
     */
    public static Cornerstone getInstance() {
        if (sInstance == null) {
            synchronized (Cornerstone.class) {
                if (sInstance == null) {
                    sInstance = new Cornerstone();
                }
            }
        }
        return sInstance;
    }

// Path: framework/src/main/java/com/kifile/android/cornerstone/core/DataProvider.java
// public interface DataProvider<DATA> {
// 
//     void setFetcher(DataFetcher<DATA> fetcher);
// 
//     /**
//      * Add the observer into watch list, when data changed, notify it.
//      *
//      * @param observer
//      */
//     void registerDataObserver(DataObserver<DATA> observer);
// 
//     /**
//      * Remove observer from watch list.
//      *
//      * @param observer
//      */
//     void unregisterDataObserver(DataObserver<DATA> observer);
// 
//     /**
//      * Refresh data.
//      */
//     void refresh();
// 
//     /**
//      * Notify observers data changed.
//      */
//     void notifyDataChanged();
// 
//     DATA getData();
// 
//     /**
//      * @return If the data need update, return true.
//      */
//     boolean isDataNeedUpdate();
// 
//     /**
//      * Release the resources when destroy. If the worker thread is working, stop it.
//      */
//     void release();
// }


// Path: framework/src/main/java/com/kifile/android/cornerstone/impl/Cornerstone.java
import com.kifile.android.cornerstone.core.AbstractDataProviderManager;
import com.kifile.android.cornerstone.core.DataProvider;

package com.kifile.android.cornerstone.impl;


/**
 * Cornerstone is a simple implement of {@link AbstractDataProviderManager}.
 *
 * @author kifile
 */
public class Cornerstone extends AbstractDataProviderManager {

    private static Cornerstone sInstance;

    private Cornerstone() {
        // Make Cornerstone singleton.
    }

    /**
     * Use singleton here.
     *
     * @return
     */
    public static Cornerstone getInstance() {
        if (sInstance == null) {
            synchronized (Cornerstone.class) {
                if (sInstance == null) {
                    sInstance = new Cornerstone();
                }
            }
        }
        return sInstance;
    }

    public static void registerProvider(String key, Class<? extends DataProvider> providerClazz) {