private List<AccessRule> getInclusions(Map<BundleDescription, ArrayList<AccessRule>> map, BundleDescription desc) { ArrayList<AccessRule> rules; if (desc.getHost() != null) rules = map.get((BundleDescription) desc.getHost().getSupplier()); else rules = map.get(desc); return rules != null ? rules : new ArrayList<AccessRule>(); }
List<BundleDescription> getBundleDependencies() { synchronized (this.monitor) { if (dependencies == null) return new ArrayList<>(0); ArrayList<BundleDescription> required = new ArrayList<>(dependencies.size()); for (Iterator<BundleDescription> iter = dependencies.iterator(); iter.hasNext();) { BundleDescription dep = iter.next(); if (dep != this && dep.getHost() == null) required.add(dep); } return required; } }
private AccessRule[] getInclusions(Map<BundleDescription, ArrayList<AccessRule>> map, BundleDescription desc) { ArrayList<AccessRule> rules; if (desc.getHost() != null) rules = map.get((BundleDescription) desc.getHost().getSupplier()); else rules = map.get(desc); return (rules == null || rules.size() == 0) ? new AccessRule[0] : rules.toArray(new AccessRule[rules.size()]); }
protected Collection<BundleDescription> findReferences(BundleDescription desc) { if (desc != null) { // don't return any callers for fragments (since no one can depend on a fragment if (desc.getHost() == null) { BundleDescription[] dependents = desc.getDependents(); return Arrays.asList(dependents); } // for fragment, need to get the host bundle return Arrays.asList(desc.getHost().getHosts()); } return Collections.emptyList(); }
private void basicAddImmediateDependents(BundleDescription root) { BundleDescription[] dependents = root.getDependents(); for (int i = 0; i < dependents.length; i++) { BundleDescription toAdd = dependents[i]; if (toAdd.getHost() == null && !allDependents.contains(toAdd)) { allDependents.add(toAdd); } } } }
private void basicAddImmediateDependents(BundleDescription root) { BundleDescription[] dependents = root.getDependents(); for (int i = 0; i < dependents.length; i++) { BundleDescription toAdd = dependents[i]; if (toAdd.getHost() == null && !allDependents.contains(toAdd)) { allDependents.add(toAdd); } } } }
private boolean checkExtensionBundle(BundleDescription sameName) { if (sameName.getHost() == null || !sameName.isResolved()) return true; // only do this extra check for resolved fragment bundles // only add fragments if they are not for the system bundle if (((BundleDescription) sameName.getHost().getSupplier()).getBundleId() != 0) return true; // never do this for resolved system bundle fragments return false; }
private Map<BundleDescription, ArrayList<AccessRule>> retrieveVisiblePackagesFromState(StateHelper helper, BundleDescription desc) { Map<BundleDescription, ArrayList<AccessRule>> visiblePackages = new HashMap<>(); addVisiblePackagesFromState(helper, desc, visiblePackages); if (desc.getHost() != null) addVisiblePackagesFromState(helper, (BundleDescription) desc.getHost().getSupplier(), visiblePackages); return visiblePackages; }
protected void setAdditionalAttributes(Element plugin, BundleDescription bundle) { // always make sure launcher fragments are flat; or else you will have launching problems HostSpecification host = bundle.getHost(); boolean unpack = (host != null && host.getName().equals("org.eclipse.equinox.launcher")) //$NON-NLS-1$ ? true : CoreUtility.guessUnpack(bundle); plugin.setAttribute("unpack", Boolean.toString(unpack)); //$NON-NLS-1$ }
private BundleDescription getSystemBundleDescription() { BundleDescription bundle = state.getBundle(0); if (bundle == null || bundle.getHost() != null) { // null or a // fragment bundle. return null; } return (EquinoxConstants.FW_SYMBOLIC_NAME.equals(bundle.getSymbolicName()) ? bundle : null); }
private BundleDescription getSystemBundleDescription() { BundleDescription bundle = state.getBundle(0); if (bundle == null || bundle.getHost() != null) { // null or a // fragment bundle. return null; } return (EquinoxConstants.FW_SYMBOLIC_NAME.equals(bundle.getSymbolicName()) ? bundle : null); }
private Map<BundleDescription, ArrayList<AccessRule>> retrieveVisiblePackagesFromState(BundleResolutionState bundleResolutionState, BundleDescription desc) { Map<BundleDescription, ArrayList<AccessRule>> visiblePackages = new HashMap<BundleDescription, ArrayList<AccessRule>>(); StateHelper helper = bundleResolutionState.getStateHelper(); addVisiblePackagesFromState(helper, desc, visiblePackages); if (desc.getHost() != null) addVisiblePackagesFromState(helper, (BundleDescription) desc.getHost().getSupplier(), visiblePackages); return visiblePackages; }
private Map<BundleDescription, ArrayList<Rule>> retrieveVisiblePackagesFromState(BundleDescription desc) { Map<BundleDescription, ArrayList<Rule>> visiblePackages = new HashMap<>(); StateHelper helper = Platform.getPlatformAdmin().getStateHelper(); addVisiblePackagesFromState(helper, desc, visiblePackages); if (desc.getHost() != null) addVisiblePackagesFromState(helper, (BundleDescription) desc.getHost().getSupplier(), visiblePackages); return visiblePackages; }
@Override public synchronized boolean isFragment() throws CoreException { init(); if (fBundleDescription == null) { baselineDisposed(getBaseline()); } return fBundleDescription.getHost() != null; }
public static IPluginModel findHostFor(IFragmentModel fragment) { BundleDescription desc = getBundleDescription(fragment); if (desc != null) { HostSpecification spec = desc.getHost(); if (spec != null) { IPluginModelBase host = PluginRegistry.findModel(spec.getName()); if (host instanceof IPluginModel) return (IPluginModel)host; } } return null; }
public static IPluginModel findHostFor(IFragmentModel fragment) { BundleDescription desc = getBundleDescription(fragment); if (desc != null) { HostSpecification spec = desc.getHost(); if (spec != null) { IPluginModelBase host = PluginRegistry.findModel(spec.getName()); if (host instanceof IPluginModel) return (IPluginModel) host; } } return null; }
private IPluginModelBase createExternalModel(BundleDescription desc) { ExternalPluginModelBase model = null; if (desc.getHost() == null) model = new ExternalPluginModel(); else model = new ExternalFragmentModel(); model.load(desc, this); model.setBundleDescription(desc); model.setEnabled(true); return model; }
@Override void load(BundleDescription bundleDescription, PDEState state) { HostSpecification host = bundleDescription.getHost(); fPluginId = host.getName(); VersionRange versionRange = host.getVersionRange(); if (versionRange != null) { fPluginVersion = versionRange.getMinimum() != null ? versionRange.getMinimum().toString() : null; fMatchRule = PluginBase.getMatchRule(versionRange); } fPatch = state.isPatchFragment(bundleDescription.getBundleId()); super.load(bundleDescription, state); }
private ExportedPackageImpl createExportedPackage(ExportPackageDescription description) { BundleDescription exporter = description.getExporter(); if (exporter == null || exporter.getHost() != null) return null; Object userObject = exporter.getUserObject(); if (!(userObject instanceof BundleLoaderProxy)) { BundleHost bundle = (BundleHost) framework.getBundle(exporter.getBundleId()); if (bundle == null) return null; userObject = bundle.getLoaderProxy(); } return new ExportedPackageImpl(description, (BundleLoaderProxy) userObject); }
private Image getObjectImage(IProductPlugin obj) { Version version = (obj.getVersion() != null && obj.getVersion().length() > 0 && !obj.getVersion().equals(ICoreConstants.DEFAULT_VERSION)) ? Version.parseVersion(obj.getVersion()) : null; BundleDescription desc = TargetPlatformHelper.getState().getBundle(obj.getId(), version); if (desc != null) { return desc.getHost() == null ? get(PDEPluginImages.DESC_PLUGIN_OBJ) : get(PDEPluginImages.DESC_FRAGMENT_OBJ); } return get(PDEPluginImages.DESC_PLUGIN_OBJ, F_ERROR); }