org.apache.shindig.gadgets.preload
Class ConcurrentPreloaderService
java.lang.Object
org.apache.shindig.gadgets.preload.ConcurrentPreloaderService
- All Implemented Interfaces:
- PreloaderService
public class ConcurrentPreloaderService
- extends Object
- implements PreloaderService
Preloads will be fetched concurrently using the injected ExecutorService, and they can be read
lazily using the returned map of futures.
The last preloaded object always executes in the current thread to avoid creating unnecessary
additional threads when we're blocking the current request anyway.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConcurrentPreloaderService
@Inject
public ConcurrentPreloaderService(ExecutorService executor,
Preloader preloader)
preload
public Collection<PreloadedData> preload(Gadget gadget)
- Description copied from interface:
PreloaderService
- Begin all preload operations.
- Specified by:
preload in interface PreloaderService
- Parameters:
gadget - The gadget that the operations will be performed for.
- Returns:
- The preloads for the gadget.
preload
public Collection<PreloadedData> preload(Collection<Callable<PreloadedData>> tasks)
- Description copied from interface:
PreloaderService
- Execute preloads with a specific set of preload tasks.
- Specified by:
preload in interface PreloaderService
Copyright © 2007-2012. All Rights Reserved.