/** * Requests a load of the code for the specified split point. If the load * fails, <code>loadErrorHandler</code> will be invoked. If it succeeds, then * the code will be installed, and the code is expected to invoke its own * on-success hooks, including a call to either * {@link #leftoversFragmentHasLoaded()} or {@link #fragmentHasLoaded(int)}. * * @param splitPoint the split point whose code needs to be loaded */ void inject(int splitPoint, LoadTerminatedHandler loadErrorHandler) { pendingDownloadErrorHandlers[splitPoint] = loadErrorHandler; if (!isInitial(splitPoint)) { requestedExclusives.add(splitPoint); } startLoadingNextFragment(); }
/** * Requests a load of the code for the specified split point. If the load * fails, <code>loadErrorHandler</code> will be invoked. If it succeeds, then * the code will be installed, and the code is expected to invoke its own * on-success hooks, including a call to either * {@link #leftoversFragmentHasLoaded()} or {@link #fragmentHasLoaded(int)}. * * @param splitPoint the split point whose code needs to be loaded */ void inject(int splitPoint, LoadTerminatedHandler loadErrorHandler) { pendingDownloadErrorHandlers[splitPoint] = loadErrorHandler; if (!isInitial(splitPoint)) { requestedExclusives.add(splitPoint); } startLoadingNextFragment(); }
/** * Request that a sequence of split points be prefetched. Code for the split * points in <code>splitPoints</code> will be downloaded and installed * whenever there is nothing else to download. Each call to this method * overwrites the entire prefetch queue with the newly specified one. */ public void setPrefetchQueue(int... runAsyncSplitPoints) { if (prefetchQueue == null) { prefetchQueue = new BoundedIntQueue(numEntries); } prefetchQueue.clear(); for (int sp : runAsyncSplitPoints) { prefetchQueue.add(sp); } startLoadingNextFragment(); }
/** * Request that a sequence of split points be prefetched. Code for the split * points in <code>splitPoints</code> will be downloaded and installed * whenever there is nothing else to download. Each call to this method * overwrites the entire prefetch queue with the newly specified one. */ public void setPrefetchQueue(int... runAsyncSplitPoints) { if (prefetchQueue == null) { prefetchQueue = new BoundedIntQueue(numEntries); } prefetchQueue.clear(); for (int sp : runAsyncSplitPoints) { prefetchQueue.add(sp); } startLoadingNextFragment(); }
/** * Initialize {@link #remainingInitialFragments} if it isn't already. */ private void initializeRemainingInitialFragments() { if (remainingInitialFragments == null) { remainingInitialFragments = new BoundedIntQueue(initialLoadSequence.length + 1); for (int sp : initialLoadSequence) { remainingInitialFragments.add(sp); } remainingInitialFragments.add(leftoversFragment()); } }
/** * Initialize {@link #remainingInitialFragments} if it isn't already. */ private void initializeRemainingInitialFragments() { if (remainingInitialFragments == null) { remainingInitialFragments = new BoundedIntQueue(initialLoadSequence.length + 1); for (int sp : initialLoadSequence) { remainingInitialFragments.add(sp); } remainingInitialFragments.add(leftoversFragment()); } }
/** * Requests a load of the code for the specified split point. If the load * fails, <code>loadErrorHandler</code> will be invoked. If it succeeds, then * the code will be installed, and the code is expected to invoke its own * on-success hooks, including a call to either * {@link #leftoversFragmentHasLoaded()} or {@link #fragmentHasLoaded(int)}. * * @param splitPoint the split point whose code needs to be loaded */ void inject(int splitPoint, LoadTerminatedHandler loadErrorHandler) { pendingDownloadErrorHandlers[splitPoint] = loadErrorHandler; if (!isInitial(splitPoint)) { requestedExclusives.add(splitPoint); } startLoadingNextFragment(); }
/** * Request that a sequence of split points be prefetched. Code for the split * points in <code>splitPoints</code> will be downloaded and installed * whenever there is nothing else to download. Each call to this method * overwrites the entire prefetch queue with the newly specified one. */ public void setPrefetchQueue(int... runAsyncSplitPoints) { if (prefetchQueue == null) { prefetchQueue = new BoundedIntQueue(numEntries); } prefetchQueue.clear(); for (int sp : runAsyncSplitPoints) { prefetchQueue.add(sp); } startLoadingNextFragment(); }
/** * Initialize {@link #remainingInitialFragments} if it isn't already. */ private void initializeRemainingInitialFragments() { if (remainingInitialFragments == null) { remainingInitialFragments = new BoundedIntQueue(initialLoadSequence.length + 1); for (int sp : initialLoadSequence) { remainingInitialFragments.add(sp); } remainingInitialFragments.add(leftoversFragment()); } }