@Override public void onCreate() { super.onCreate(); httpRequestFactory = createRequestFactory(); }
@Override public void onCreate() { super.onCreate(); restTemplate = createRestTemplate(); }
@Override protected T executeWhenBound(SpiceService spiceService) throws CacheSavingException, CacheCreationException { return spiceService.putDataInCache(cacheKey, data); } }
@Override public boolean onUnbind(final Intent intent) { isBound = false; showNotificationIfNotBoundAndHasPendingRequestsOtherwiseHideNotification(); stopIfNotBoundAndHasNoPendingRequests(); return true; }
public class AppSingleton extends Application{ private static AppSingleton ourInstance = new AppSingleton(); private SpiceManager spiceManager= new SpiceManager(RoboSpiceService.class); public static AppSingleton getInstance() { return ourInstance; } public SpiceManager getSpiceManager() { return spiceManager; } }
@Override protected Void executeWhenBound(SpiceService spiceService) { spiceService.removeAllDataFromCache(clazz); return null; } }
/** * Override this method to increase the number of core threads used to * process requests. This method will have no effect if you override * {@link #getExecutorService()}. * @return the number of threads used to process requests. Defaults to * {@link #DEFAULT_THREAD_COUNT}. */ public int getCoreThreadCount() { return getThreadCount(); }
@Override protected List<Object> executeWhenBound(SpiceService spiceService) throws CacheLoadingException, CacheCreationException { return spiceService.getAllCacheKeys(clazz); } }
@Override protected Void executeWhenBound(SpiceService spiceService) { spiceService.removeDataFromCache(clazz, cacheKey); return null; } }
/** * Default constructor. */ public SpiceService() { mSpiceServiceBinder = new SpiceServiceBinder(this); }
@Override protected T executeWhenBound(SpiceService spiceService) throws CacheLoadingException, CacheCreationException { return spiceService.getDataFromCache(clazz, cacheKey); } }
@Override protected Date executeWhenBound(SpiceService spiceService) throws CacheCreationException { try { return spiceService.getDateOfDataInCache(clazz, cacheKey); } catch (CacheLoadingException ex) { return null; } } }
@Override protected Void executeWhenBound(SpiceService spiceService) { spiceService.addSpiceServiceListener(spiceServiceListener); return null; } }
@Override protected Boolean executeWhenBound(SpiceService spiceService) throws CacheSavingException, CacheCreationException { return spiceService.isDataInCache(clazz, cacheKey, cacheExpiryDuration); } }
@Override protected Void executeWhenBound(SpiceService spiceService) { spiceService.setFailOnCacheError(failOnCacheError); return null; } }
@Override public IBinder onBind(final Intent intent) { isBound = true; showNotificationIfNotBoundAndHasPendingRequestsOtherwiseHideNotification(); return mSpiceServiceBinder; }
@Override public void run() { dontNotifyRequestListenersForRequestInternal(request); } });
@Override public void run() { dontNotifyAnyRequestListenersInternal(); } });
@Override protected Void executeWhenBound(SpiceService spiceService) { spiceService.removeAllDataFromCache(); return null; } }
/** * Override this method to increase the number of maximum threads used to * process requests. This method will have no effect if you override * {@link #getExecutorService()}. * @return the number of threads used to process requests. Defaults to * {@link #DEFAULT_THREAD_COUNT}. */ public int getMaximumThreadCount() { return getThreadCount(); }