You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2010/03/01 10:34:05 UTC

[jira] Created: (FELIX-2144) Add global requirements and capabilities

Add global requirements and capabilities
----------------------------------------

                 Key: FELIX-2144
                 URL: https://issues.apache.org/jira/browse/FELIX-2144
             Project: Felix
          Issue Type: New Feature
          Components: Bundle Repository (OBR)
            Reporter: Guillaume Nodet
            Assignee: Guillaume Nodet
             Fix For: bundlerepository-1.6.0


Global constraints on resources would be useful to be able to add constraints to the resolution like:
  * do not use a resource
  * add version range to used resources ...



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840370#action_12840370 ] 

Richard S. Hall commented on FELIX-2144:
----------------------------------------

Technically, the timestamp can still be calculated by looping through all resources doing Resource.getRepository().getLastModified()...it is more redundant, but largely equivalent to looping through all repositories. Of course, if we keep the double linking removed, then this won't work.

I don't have an issue with separating the deployer from the resolver, but can we do this in a way that can still be easily wrapped into the original OSGi API? But if we want to avoid majorly changing the original API, then keeping the double linking between Resource and Repository seems easier.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839768#action_12839768 ] 

Richard S. Hall commented on FELIX-2144:
----------------------------------------

I generally like to avoid providing many ways to do the same thing.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839752#action_12839752 ] 

Guillaume Nodet commented on FELIX-2144:
----------------------------------------

The goal is to be able to direct a bit and constraint the set of available resources.
Another way would be to simply allow the resolver to be given a set of resources to resolve against instead of repositories.
This is actually what is done to support those global constraints (i.e. filter the resources before starting the resolution).

This way, the user could choose to use local resources, remote resources and more importantly, which one.
This could also be used to filter for licensing reasons or such.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FELIX-2144) Add global requirements and capabilities

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed FELIX-2144.
-----------------------------------


> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839755#action_12839755 ] 

Richard S. Hall commented on FELIX-2144:
----------------------------------------

Well, since the user can pass in their own repository now, couldn't they just do this already by passing in a repository that does the filtering?

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839810#action_12839810 ] 

Guillaume Nodet commented on FELIX-2144:
----------------------------------------

I do agree that the API is not clean.   Though I disagree that we offer multiple ways.  Imho the user should not have to implement a Repository object.

I'm considering adding a new method to the RepositoryAdmin interface instead:
    Resolver resolver(Resource[] resources);

This would make a clean and intuitive API while still not forcing the user to implement the Repository object.  Furthermore, the resolver really does not care about repositories.  There are some problems however:
   * the deployer part does care about repositories (mostly about timestamp)
   * the resolver still has to know how to order resources (prefer local over remote), so this would mean moving the isLocal() method from the Repository to the Resource interface (which actually makes more sense)


> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839843#action_12839843 ] 

Richard S. Hall commented on FELIX-2144:
----------------------------------------

Yeah, I agree that is an issue and I agree that it is likely a conceptual flaw in the original API...we have a similar situation with Requirement.getResource().

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840224#action_12840224 ] 

Richard S. Hall commented on FELIX-2144:
----------------------------------------

We can still make the repository accessible from the Resource if we want, but still only pass resources into the Resolver. Then the deployer can still get the repos from the selected set of resources.

Regarding Java 5 and collections, sure as long as the resulting JAR file is still compatible with older JVMs...we can look into "-target jsr14"...I am thinking about this for the framework too.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840012#action_12840012 ] 

Richard S. Hall commented on FELIX-2144:
----------------------------------------

Yeah, I suppose that would work.

In reality, I am a little torn on this. The new approach I have for the framework resolver uses double linking between capabilities and modules, since it does simplify some aspects of the implementation (I also use double linking between modules and bundles, but that is not relevant here). I do not, however, use double linking between requirements and modules, although I thought about doing it for consistency. I actually view the double linking as somewhat bad form, but it really does help implementation-wise.

It is not 100% clear to me what we should do here.

I agree that the resolver doesn't really care about repositories and we could just pass in one big array of all resources and not pass in any repositories to it at all. Then this would solve this issue and clean things up quite a bit.

Personally, I think getting all resources from a repo as an array doesn't make sense for efficiency purposes, but we have no choice given the Repository interface. So making such a change would result in something that it not really change the resolver algorithm at all. So, maybe that is the way we should go.

More long term, I think we should get back some sort of resource accessor interface (like an immutable list) from the repos, but I think this approach would still work with that too (i.e., we'd just pass in an accessor instead of an array).

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-2144) Add global requirements and capabilities

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved FELIX-2144.
------------------------------------

    Resolution: Fixed

Committing to https://svn.apache.org/repos/asf/felix/trunk ...
	M	bundlerepository/src/main/java/org/apache/felix/bundlerepository/Resolver.java
	M	bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/ResolverImpl.java
Committed r917434


> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839742#action_12839742 ] 

Richard S. Hall commented on FELIX-2144:
----------------------------------------

It is not clear to me how much sense "global requirements" make once we get to the point of supporting multiple resource types. It might make a little sense when all the resources are bundles, but if they are configurations or whatnot it will make make too much sense. Seems like added complexity with little long-term benefit.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839761#action_12839761 ] 

Guillaume Nodet commented on FELIX-2144:
----------------------------------------

Yeah, that makes sense too.  I must admit I haven't thought about this ;-)
I think it's the same kind of issues as with using requirements instead of resources: it all comes down to whether we want a minimal interface or a more user friendly one.   I'd like to avoid forcing the user to implement any class from the model (resource, requirement, capability, repository) unless absolutely necessary.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839768#action_12839768 ] 

Richard S. Hall edited comment on FELIX-2144 at 3/1/10 5:32 PM:
----------------------------------------------------------------

I generally like to avoid providing many ways to do the same thing. Besides, it seems the whole point of making these things interfaces is so that we can have different implementations provided.

      was (Author: rickhall):
    I generally like to avoid providing many ways to do the same thing.
  
> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839846#action_12839846 ] 

Guillaume Nodet commented on FELIX-2144:
----------------------------------------

Well, I actually find the Requirement#getResource() very useful to diagnose the resolution output.
Because this is currently the only way to really understand the resolution by leveraging the
    Requirement[] Resolver#getReason(Resource resource)
method, which can be used to draw a kind of dependency graph.

If we remove the Requirement#getResource()  method, we'd need another way to build this graph.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840225#action_12840225 ] 

Richard S. Hall commented on FELIX-2144:
----------------------------------------

If we did want to eliminate some of the double linking, we could also add a method like Repository.hasResource() or something to determine if a resource is owned by a particular repo. But if we switch to passing in resources to the resolver, then I am not sure if this is completely necessary. What do you think?

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840361#action_12840361 ] 

Guillaume Nodet commented on FELIX-2144:
----------------------------------------

The timestamp calculation might be a bit more difficult.  Would the deployer be split from the resolver, I would have less problems using Resource[] for the resolver, but the timestamp calculation based on repositories performed by the deployer makes that a bit more difficult.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839847#action_12839847 ] 

Richard S. Hall commented on FELIX-2144:
----------------------------------------

Understood, but these double-linking methods make it more difficult for us to mix and match these concepts.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840059#action_12840059 ] 

Guillaume Nodet commented on FELIX-2144:
----------------------------------------

One problem is that the resolver does not care about repositories, but the deployer does.  Unfortunately, both things are conflated in the Resolver interface, which makes it mandatory to use a Repository so that we can retrieve and check the timestamps.

I'm less worried about using double links as an implementation detail for optimization, but the more I think about it, the more I think the API should not expose that.

Now that we have our own API, I'm thinking we can switch to Java 5 and use Collection<Resource> instead of arrays.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839815#action_12839815 ] 

Richard S. Hall commented on FELIX-2144:
----------------------------------------

I understand that is your view, I just disagree with it. A repository is a set of resources. Passing in an array of resources is equivalent to passing in a repository backed by those resources.

Regarding isLocal(), I agree that it probably makes more sense to have it on Resource than Repository.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839901#action_12839901 ] 

Guillaume Nodet commented on FELIX-2144:
----------------------------------------

For this very problem, we could use something like

public interface Reason {
    Requirement getRequirement();
    Resource getResource();
}

and modify the getReason() method to return a Reason[] instead of Requirement[].

I suppose the Capability#getResource() should also be removed.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (FELIX-2144) Add global requirements and capabilities

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839742#action_12839742 ] 

Richard S. Hall edited comment on FELIX-2144 at 3/1/10 5:04 PM:
----------------------------------------------------------------

It is not clear to me how much sense "global requirements" make once we get to the point of supporting multiple resource types. It might make a little sense when all the resources are bundles, but if they are configurations or whatnot it will not make too much sense. Seems like added complexity with little long-term benefit.

      was (Author: rickhall):
    It is not clear to me how much sense "global requirements" make once we get to the point of supporting multiple resource types. It might make a little sense when all the resources are bundles, but if they are configurations or whatnot it will make make too much sense. Seems like added complexity with little long-term benefit.
  
> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2144) Add global requirements and capabilities

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12839838#action_12839838 ] 

Guillaume Nodet commented on FELIX-2144:
----------------------------------------

I see your point, but I think there is a problem.   A repository is a bit more than just an array of resources: it has a timestamp and a URL.  In addition the Resource can be used to retrieve its Repository using Resource#getRepository() method, which kinda implies a Resource object can only be contained in a single Repository (i'm not talking about having actual duplicate bundles of course).
So letting the user implement its own repository by simply wrapping an array of Resource[] would lead to
      repository.getResource()[0].getRepository() != repository
which should be avoided (or the api changed somehow).

Maybe removing the 
    Repository Resource#getRepository() 
and adding a 
   void RepositotyAdmin#repository(Resource[] resources) 
along with moving the isLocal() method from the Repository to the Resource would work.

> Add global requirements and capabilities
> ----------------------------------------
>
>                 Key: FELIX-2144
>                 URL: https://issues.apache.org/jira/browse/FELIX-2144
>             Project: Felix
>          Issue Type: New Feature
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> Global constraints on resources would be useful to be able to add constraints to the resolution like:
>   * do not use a resource
>   * add version range to used resources ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.