use of com.octo.android.robospice.persistence.exception.CacheCreationException in project robospice by stephanenicolas.
the class GoogleHttpClientSpiceTestService method createCacheManager.
@Override
public CacheManager createCacheManager(Application application) {
CacheManager cacheManager = new CacheManager();
try {
JacksonObjectPersisterFactory jacksonObjectPersisterFactory = new JacksonObjectPersisterFactory(application, new File("/"));
cacheManager.addPersister(jacksonObjectPersisterFactory);
} catch (CacheCreationException e) {
Ln.e(e);
}
return cacheManager;
}
use of com.octo.android.robospice.persistence.exception.CacheCreationException in project robospice by stephanenicolas.
the class SpiceService method onCreate.
@Override
public void onCreate() {
super.onCreate();
try {
cacheManager = createCacheManager(getApplication());
} catch (CacheCreationException e) {
Ln.e(e);
stopSelf();
return;
}
if (cacheManager == null) {
Ln.e(new CacheCreationException("createCacheManager() can't create a null cacheManager"));
stopSelf();
return;
}
final RequestListenerNotifier progressReporter = createRequestRequestListenerNotifier();
final SpiceServiceListenerNotifier spiceServiceListenerNotifier = createSpiceServiceListenerNotifier();
final RequestProcessorListener requestProcessorListener = createRequestProcessorListener();
final ExecutorService executorService = getExecutorService();
final NetworkStateChecker networkStateChecker = getNetworkStateChecker();
final RequestProgressManager requestProgressManager = createRequestProgressManager(requestProcessorListener, progressReporter, spiceServiceListenerNotifier);
final RequestRunner requestRunner = createRequestRunner(executorService, networkStateChecker, requestProgressManager);
requestProcessor = createRequestProcessor(cacheManager, requestProgressManager, requestRunner);
requestProcessor.setFailOnCacheError(DEFAULT_FAIL_ON_CACHE_ERROR);
notification = createDefaultNotification();
isCreated = true;
Ln.d("SpiceService instance created.");
}
Aggregations