[
https://issues.apache.org/jira/browse/FELIX-692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12837738#action_12837738
]
Arjun Panday commented on FELIX-692:
------------------------------------
Well, I wouldn't pretend i was trying to resolve issue FELIX-2106, since it
didn't exist at the time, and actually, i think it is different:
Issue 2106 deals with the management of several (temporary) remote
repositories, while this one focuses on the local resources, asking for the
locally installed bundles and the local system bundle to be treated as 2 new
independant repositories.
The issues are somewhat related but they have very different focuses.
As for the API vs URL vs something else issue:
- i thought the "fake URL" was acceptable since it concerns only bundles
already installed locally and therefore not to be downloaded
- on the other hand (and as the title suggests) i wouldn't mind an API: it
would make things more clear, rather than a hidden convention inside the
implementation.
For the time being, i've been using my patched version (quite successfully so
far) and calling
obr.removeRepository(new URL("local://installed"));
in my code before the call to discoverResources(), but it's one of these "you
have to know the trick" kind of patterns, rather than a clear feature.
As Richard suggests, maybe the RepositoryAdminImpl could be registered with
both standard and extended interfaces, and we could then access the extended
service API directly.
Guillaume, the patch contains quite a few changes as well as new classes.. i
don't think a diff will be more readable; untar the file somewhere and then use
a tool like meld to review the differences; it's a whole lot easier.
Thanks everyone for your attention on the issue :)
> OBR should provide an API for resolving bundles dependencies regardless of
> locally installed bundles
> ----------------------------------------------------------------------------------------------------
>
> Key: FELIX-692
> URL: https://issues.apache.org/jira/browse/FELIX-692
> Project: Felix
> Issue Type: Improvement
> Components: Bundle Repository (OBR)
> Reporter: Arjun Panday
> Assignee: Guillaume Nodet
> Priority: Minor
> Fix For: bundlerepository-1.6.0
>
> Attachments: bundlerepository.tgz
>
>
> Currently the dependencies that are installed locally are stripped from the
> OBR Resolver response, because it is assumed that the new bundles are to be
> installed locally. But i cannot use the OBR to launch a separate JVM or store
> the result for later reference...
> It would be interesting to have a pure Resolver API, distinct from the OBR's
> "installation process".
> And/Or, as Richard Hall suggested, the OBR could provide better control over
> the repositories used during the resolve process (specifically the local
> repository).
> (see thread "OBR and the referral tag" in [email protected])
> Merely as a hint and for what it's worth, here's how i slightly modified the
> Resolver in bundlerepository 1.0.3 to serve my purpose (avoid ignoring
> locally installed bundles):
> @@ -308,6 +309,7 @@ public class ResolverImpl implements Resolver
> */
> private List searchLocalResources(Requirement req)
> {
> + String systemPackages = (String)
> m_context.getBundle(0).getHeaders().get("Export-Package");// only match
> system bundle
> List matchingCandidates = new ArrayList();
> Resource[] resources = m_local.getResources();
> for (int resIdx = 0; (resources != null) && (resIdx <
> resources.length); resIdx++)
> @@ -315,7 +317,8 @@ public class ResolverImpl implements Resolver
> Capability[] caps = resources[resIdx].getCapabilities();
> for (int capIdx = 0; (caps != null) && (capIdx < caps.length);
> capIdx++)
> {
> - if (req.isSatisfied(caps[capIdx]))
> + if (req.isSatisfied(caps[capIdx])
> + && systemPackages.indexOf(caps[capIdx].getName()) != -1)
> // only match system bundle
> {
> matchingCandidates.add(resources[resIdx]);
> }
> @@ -91,7 +91,7 @@ public class LocalRepositoryImpl implements Repository
> synchronized (this)
> {
> m_snapshotTimeStamp = m_currentTimeStamp = new Date().getTime();
> - bundles = m_context.getBundles();
> + bundles = new Bundle[]{ m_context.getBundle(0) }; // only match
> system bundle... m_context.getBundles();
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.