AppCacheFactory.java 1.56 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.cq.mobile.ui.AppCacheDataSource
 *  org.apache.felix.scr.annotations.Component
 *  org.apache.felix.scr.annotations.Reference
 *  org.apache.felix.scr.annotations.Service
 *  org.apache.sling.api.resource.Resource
 */
package com.adobe.cq.mobile.ui.impl;

import com.adobe.cq.mobile.appcache.impl.AppCacheManagerAdapterFactory;
import com.adobe.cq.mobile.ui.AppCacheDataSource;
import com.adobe.cq.mobile.ui.impl.AppCacheDataSourceImpl;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.resource.Resource;

@Component(immediate=1, metatype=0)
@Service(value={AppCacheFactory.class})
public class AppCacheFactory {
    @Reference
    private AppCacheManagerAdapterFactory appCacheManagerAdapterFactory;

    public AppCacheDataSource getAppCache(Resource resource) {
        AppCacheDataSourceImpl ds = new AppCacheDataSourceImpl(resource, this.appCacheManagerAdapterFactory);
        return ds;
    }

    protected void bindAppCacheManagerAdapterFactory(AppCacheManagerAdapterFactory appCacheManagerAdapterFactory) {
        this.appCacheManagerAdapterFactory = appCacheManagerAdapterFactory;
    }

    protected void unbindAppCacheManagerAdapterFactory(AppCacheManagerAdapterFactory appCacheManagerAdapterFactory) {
        if (this.appCacheManagerAdapterFactory == appCacheManagerAdapterFactory) {
            this.appCacheManagerAdapterFactory = null;
        }
    }
}