当前位置: 首页>>代码示例>>Java>>正文


Java CacheCreationException类代码示例

本文整理汇总了Java中com.octo.android.robospice.persistence.exception.CacheCreationException的典型用法代码示例。如果您正苦于以下问题:Java CacheCreationException类的具体用法?Java CacheCreationException怎么用?Java CacheCreationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CacheCreationException类属于com.octo.android.robospice.persistence.exception包,在下文中一共展示了CacheCreationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCacheManager

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
@Override
public CacheManager createCacheManager(Application app) throws CacheCreationException {
    LruCache<String, Templates> templatesCache = new LruCache<>(DEFAULT_CACHE_SIZE);
    LruCache<String, Lists> listsCache = new LruCache<>(DEFAULT_CACHE_SIZE);

    LruCacheObjectPersister templatesPersister;
    LruCacheObjectPersister listsPersister;

    templatesPersister = new LruCacheObjectPersister(Templates.class, templatesCache);
    listsPersister = new LruCacheObjectPersister(Lists.class, listsCache);

    CacheManager cacheManager = new CacheManager();
    cacheManager.addPersister(templatesPersister);
    cacheManager.addPersister(listsPersister);
    return cacheManager;
}
 
开发者ID:stairs,项目名称:intermine-android,代码行数:17,代码来源:RoboSpiceService.java

示例2: createCacheManager

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
    CacheManager cacheManager = new CacheManager();
    cachePersister = new RetrofitObjectPersisterFactory(application, getConverter());
    cacheManager.addPersister(cachePersister);
    return cacheManager;
}
 
开发者ID:Rexee,项目名称:Robospice-Retrofit-2,代码行数:8,代码来源:RetrofitSpiceService.java

示例3: createCacheManager

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
    return new CacheManager() {
        @Override
        public <T> T saveDataToCacheAndReturnData(T data, Object cacheKey) throws CacheSavingException, CacheCreationException {

            return data;
        }
    };
}
 
开发者ID:mrprona92,项目名称:SecretBrand,代码行数:11,代码来源:LocalSpiceService.java

示例4: createCacheManager

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
    CacheManager cacheManager = new CacheManager();

    // TODO: This should be injected via dagger
    cacheManager.addPersister(new FileJsonCacheFactory(application).create());
    return cacheManager;
}
 
开发者ID:mmastrac,项目名称:progscrape-android,代码行数:9,代码来源:SpiceService.java

示例5: createCacheManager

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
  CacheManager cachemanager = new CacheManager();
  for (Iterator iterator = mExtensionMap.values().iterator(); iterator.hasNext(); ((Extension) iterator
      .next()).onCacheManager(application, cachemanager)) {}
  return cachemanager;
}
 
开发者ID:offerHere,项目名称:offer,代码行数:8,代码来源:CoreService.java

示例6: createGeneFavoritesPersister

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
private LruCacheObjectPersister<Gene> createGeneFavoritesPersister() {
    LruCache<Object, CacheItem<Gene>> geneCache = new LruCache<>(DEFAULT_GENE_FAVORITES_CACHE_SIZE);

    try {
        InFileObjectPersister<Gene> inFilePersister = new GsonObjectPersister((Application) mContext, Gene.class);
        LruCacheObjectPersister<Gene> persister = new LruCacheObjectPersister<>(inFilePersister, geneCache);
        persister.setAsyncSaveEnabled(true);
        return persister;
    } catch (CacheCreationException e) {
        Log.e(TAG, "Failed to create gene favorites persister!", e);
    }
    return null;
}
 
开发者ID:stairs,项目名称:intermine-android,代码行数:14,代码来源:BaseStorage.java

示例7: createCacheManager

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
    CacheManager cacheManager = new CacheManager();


    OrmLiteUriMatcher matcher = OrmLiteUriMatcher.getInstance(DefaultUriMatcher.class, DefaultContract.CONTENT_AUTHORITY);

    // init
    RoboSpiceDatabaseHelper databaseHelper = new RoboSpiceDatabaseHelper(application, DefaultDatabaseHelper.DATABASE_NAME, DefaultDatabaseHelper.DATABASE_VERSION);
    InDatabaseObjectPersisterFactory inDatabaseObjectPersisterFactory = new InDatabaseObjectPersisterFactory( application, databaseHelper, matcher.getClassToNotificationUriMap() );
    cacheManager.addPersister(inDatabaseObjectPersisterFactory);
    return cacheManager;
}
 
开发者ID:blandware,项目名称:android-atleap,代码行数:14,代码来源:NetworkService.java

示例8: createCacheManager

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
    CacheManager cacheManager = new CacheManager();
    TestUriMatcher matcher = SQLiteUriMatcher.getInstance(TestUriMatcher.class, TestContract.CONTENT_AUTHORITY);

    // init
    RoboSpiceDatabaseHelper databaseHelper = new RoboSpiceDatabaseHelper(application, TestDatabaseHelper.DATABASE_NAME, TestDatabaseHelper.DATABASE_VERSION);
    InDatabaseObjectPersisterFactory inDatabaseObjectPersisterFactory = new InDatabaseObjectPersisterFactory( application, databaseHelper, matcher.getClassToNotificationUriMap() );
    cacheManager.addPersister(inDatabaseObjectPersisterFactory);
    return cacheManager;
}
 
开发者ID:blandware,项目名称:android-atleap,代码行数:12,代码来源:TestRobospiceService.java

示例9: createCacheManager

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
@Override
public CacheManager createCacheManager(Application application) {
    CacheManager cacheManager = new CacheManager();

    JacksonObjectPersisterFactory jacksonObjectPersisterFactory;
    try {
        jacksonObjectPersisterFactory = new JacksonObjectPersisterFactory(application);
        cacheManager.addPersister(jacksonObjectPersisterFactory);
    } catch (CacheCreationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    return cacheManager;
}
 
开发者ID:kmonaghan,项目名称:Broadsheet.ie-Android,代码行数:16,代码来源:BroadsheetServices.java

示例10: createCacheManager

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
@Override
public CacheManager createCacheManager( Application application ) {
    CacheManager cacheManager = new CacheManager();

    // init
    InFileStringObjectPersister inFileStringObjectPersister;
    InFileInputStreamObjectPersister inFileInputStreamObjectPersister;
    Jackson2ObjectPersisterFactory inJSonFileObjectPersisterFactory;
    try {
        inFileStringObjectPersister = new InFileStringObjectPersister(application);
        inFileInputStreamObjectPersister = new InFileInputStreamObjectPersister(application);
        inJSonFileObjectPersisterFactory = new Jackson2ObjectPersisterFactory(application);
    } catch (CacheCreationException e) {
        e.printStackTrace();
        return null;
    }


    inFileStringObjectPersister.setAsyncSaveEnabled( true );
    inFileInputStreamObjectPersister.setAsyncSaveEnabled( true );
    inJSonFileObjectPersisterFactory.setAsyncSaveEnabled( true );

    cacheManager.addPersister( inFileStringObjectPersister );
    cacheManager.addPersister( inFileInputStreamObjectPersister );
    cacheManager.addPersister( inJSonFileObjectPersisterFactory );
    return cacheManager;
}
 
开发者ID:gina-alaska,项目名称:gina-puffinfeeder-android-viewer,代码行数:28,代码来源:JsonSpiceService.java

示例11: RetrofitObjectPersister

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
public RetrofitObjectPersister(Application application, Converter.Factory converter, Class<T> clazz, File cacheFolder, Retrofit retrofit) throws CacheCreationException {
    super(application, clazz, cacheFolder);
    this.converter = converter;
    this.retrofit = retrofit;
}
 
开发者ID:Rexee,项目名称:Robospice-Retrofit-2,代码行数:6,代码来源:RetrofitObjectPersister.java

示例12: RetrofitObjectPersisterFactory

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
public RetrofitObjectPersisterFactory(Application application, Converter.Factory converter) throws CacheCreationException {
    super(application);
    this.converter = converter;
}
 
开发者ID:Rexee,项目名称:Robospice-Retrofit-2,代码行数:5,代码来源:RetrofitObjectPersisterFactory.java

示例13: createInFileObjectPersister

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
@Override
public <DATA> InFileObjectPersister<DATA> createInFileObjectPersister(Class<DATA> clazz, File cacheFolder) throws CacheCreationException {
    return new RetrofitObjectPersister<DATA>(getApplication(), converter, clazz, cacheFolder, retrofit);
}
 
开发者ID:Rexee,项目名称:Robospice-Retrofit-2,代码行数:5,代码来源:RetrofitObjectPersisterFactory.java

示例14: createCacheManager

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
@Override
public CacheManager createCacheManager(Application application) throws CacheCreationException {
    return new CacheManager();
}
 
开发者ID:guilhermesgb,项目名称:android-bulking,代码行数:5,代码来源:OfflineSpiceService.java

示例15: create

import com.octo.android.robospice.persistence.exception.CacheCreationException; //导入依赖的package包/类
public FileJsonCache create() throws CacheCreationException {
    return new FileJsonCache(application, JsonObject.class, new File(application.getCacheDir(), "json"));
}
 
开发者ID:mmastrac,项目名称:progscrape-android,代码行数:4,代码来源:FileJsonCacheFactory.java


注:本文中的com.octo.android.robospice.persistence.exception.CacheCreationException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。