Forces the update (replacement) or removal of packages exported by the specified bundles.
If no bundles are specified, this method will update or remove any packages exported by any bundles that were previously updated or uninstalled since the last call to this method. The technique by which this is accomplished may vary among different Framework implementations. One permissible implementation is to stop and restart the Framework.
This method returns to the caller immediately and then performs the following steps on a separate thread:
- Compute a graph of bundles starting with the specified bundles. If no bundles are specified, compute a graph of bundles starting with bundle updated or uninstalled since the last call to this method. Add to the graph any bundle that is wired to a package that is currently exported by a bundle in the graph. The graph is fully constructed when there is no bundle outside the graph that is wired to a bundle in the graph. The graph may contain {@code UNINSTALLED} bundles that are currently stillexporting packages.
- Each bundle in the graph that is in the {@code ACTIVE} state will bestopped as described in the {@code Bundle.stop} method.
- Each bundle in the graph that is in the {@code RESOLVED} state isunresolved and thus moved to the {@code INSTALLED} state. The effect ofthis step is that bundles in the graph are no longer {@code RESOLVED}.
- Each bundle in the graph that is in the {@code UNINSTALLED} state isremoved from the graph and is now completely removed from the Framework.
- Each bundle in the graph that was in the {@code ACTIVE} state priorto Step 2 is started as described in the {@code Bundle.start} method,causing all bundles required for the restart to be resolved. It is possible that, as a result of the previous steps, packages that were previously exported no longer are. Therefore, some bundles may be unresolvable until another bundle offering a compatible package for export has been installed in the Framework.
- A framework event of type {@code FrameworkEvent.PACKAGES_REFRESHED}is fired.
For any exceptions that are thrown during any of these steps, a {@code FrameworkEvent} of type {@code ERROR} is firedcontaining the exception. The source bundle for these events should be the specific bundle to which the exception is related. If no specific bundle can be associated with the exception then the System Bundle must be used as the source bundle for the event.
@param bundles The bundles whose exported packages are to be updated orremoved, or {@code null} for all bundles updated oruninstalled since the last call to this method.
@throws SecurityException If the caller does not have{@code AdminPermission[System Bundle,RESOLVE]} and the Javaruntime environment supports permissions.
@throws IllegalArgumentException If the specified {@code Bundle}s were not created by the same framework instance that registered this {@code PackageAdmin} service.