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/02/21 10:46:27 UTC

[jira] Created: (FELIX-2115) The api offers no way to have a timeout or cancel the resolution if it takes too long

The api offers no way to have a timeout or cancel the resolution if it takes too long
-------------------------------------------------------------------------------------

                 Key: FELIX-2115
                 URL: https://issues.apache.org/jira/browse/FELIX-2115
             Project: Felix
          Issue Type: Improvement
          Components: Bundle Repository (OBR)
            Reporter: Guillaume Nodet


One way would be either to add some methods to the Resolver such as:
   boolean resolve(long timeout)
   void cancel();

I'd be much happier if we could use a Future instead.
   Future<Boolean> resolve();

This would make it easier for the user because he doesn't have to start a thread on its own.
However this breaks compatibility.
We could therefore use something like:
   Future<Boolean> startResolve();

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


[jira] Resolved: (FELIX-2115) The api offers no way to have a timeout or cancel the resolution if it takes too long

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

Guillaume Nodet resolved FELIX-2115.
------------------------------------

       Resolution: Fixed
    Fix Version/s: bundlerepository-1.6.0
         Assignee: Guillaume Nodet

Committing to https://svn.apache.org/repos/asf/felix/trunk ...
	M	bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
	M	bundlerepository/src/test/java/org/apache/felix/bundlerepository/ResolverImplTest.java
	A	org.osgi.service.obr/src/main/java/org/osgi/service/obr/InterrupteResolutionException.java
	M	org.osgi.service.obr/src/main/java/org/osgi/service/obr/Resolver.java
Committed r912549

I've added an exception instead of throwing a RuntimeException so that users can handle that one correctly.

> The api offers no way to have a timeout or cancel the resolution if it takes too long
> -------------------------------------------------------------------------------------
>
>                 Key: FELIX-2115
>                 URL: https://issues.apache.org/jira/browse/FELIX-2115
>             Project: Felix
>          Issue Type: Improvement
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> One way would be either to add some methods to the Resolver such as:
>    boolean resolve(long timeout)
>    void cancel();
> I'd be much happier if we could use a Future instead.
>    Future<Boolean> resolve();
> This would make it easier for the user because he doesn't have to start a thread on its own.
> However this breaks compatibility.
> We could therefore use something like:
>    Future<Boolean> startResolve();

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


[jira] Commented: (FELIX-2115) The api offers no way to have a timeout or cancel the resolution if it takes too long

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

Guillaume Nodet commented on FELIX-2115:
----------------------------------------

Yeah, I suppose so too.  I was gonna propose something even more disruptive, which is to split the outcome of the resolution from the Resolver and have something like
    Future<Resolution> resolve();
But that might be a bit too disruptive.

Unless, there is some problems, I'm gonna go for the minimal api changes, i.e. just modify the resolve() method in this way:
   boolean resolve() throws InterruptedException;

To cancel a resolution, the user would have to call Thread#interrupt() on the resolution thread and this would abort the resolution and throw an InterruptedException.


> The api offers no way to have a timeout or cancel the resolution if it takes too long
> -------------------------------------------------------------------------------------
>
>                 Key: FELIX-2115
>                 URL: https://issues.apache.org/jira/browse/FELIX-2115
>             Project: Felix
>          Issue Type: Improvement
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>
> One way would be either to add some methods to the Resolver such as:
>    boolean resolve(long timeout)
>    void cancel();
> I'd be much happier if we could use a Future instead.
>    Future<Boolean> resolve();
> This would make it easier for the user because he doesn't have to start a thread on its own.
> However this breaks compatibility.
> We could therefore use something like:
>    Future<Boolean> startResolve();

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


[jira] Commented: (FELIX-2115) The api offers no way to have a timeout or cancel the resolution if it takes too long

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

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

Seems like the easiest way to get it done.

> The api offers no way to have a timeout or cancel the resolution if it takes too long
> -------------------------------------------------------------------------------------
>
>                 Key: FELIX-2115
>                 URL: https://issues.apache.org/jira/browse/FELIX-2115
>             Project: Felix
>          Issue Type: Improvement
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>
> One way would be either to add some methods to the Resolver such as:
>    boolean resolve(long timeout)
>    void cancel();
> I'd be much happier if we could use a Future instead.
>    Future<Boolean> resolve();
> This would make it easier for the user because he doesn't have to start a thread on its own.
> However this breaks compatibility.
> We could therefore use something like:
>    Future<Boolean> startResolve();

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


[jira] Closed: (FELIX-2115) The api offers no way to have a timeout or cancel the resolution if it takes too long

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

Carsten Ziegeler closed FELIX-2115.
-----------------------------------


> The api offers no way to have a timeout or cancel the resolution if it takes too long
> -------------------------------------------------------------------------------------
>
>                 Key: FELIX-2115
>                 URL: https://issues.apache.org/jira/browse/FELIX-2115
>             Project: Felix
>          Issue Type: Improvement
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>             Fix For: bundlerepository-1.6.0
>
>
> One way would be either to add some methods to the Resolver such as:
>    boolean resolve(long timeout)
>    void cancel();
> I'd be much happier if we could use a Future instead.
>    Future<Boolean> resolve();
> This would make it easier for the user because he doesn't have to start a thread on its own.
> However this breaks compatibility.
> We could therefore use something like:
>    Future<Boolean> startResolve();

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


[jira] Commented: (FELIX-2115) The api offers no way to have a timeout or cancel the resolution if it takes too long

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

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

I am not sure we can go with a Future, unless we roll our own. However, some functionality in this area sounds reasonable. David Savage (I think) asked for something like this in the framework resolver too.

> The api offers no way to have a timeout or cancel the resolution if it takes too long
> -------------------------------------------------------------------------------------
>
>                 Key: FELIX-2115
>                 URL: https://issues.apache.org/jira/browse/FELIX-2115
>             Project: Felix
>          Issue Type: Improvement
>          Components: Bundle Repository (OBR)
>            Reporter: Guillaume Nodet
>
> One way would be either to add some methods to the Resolver such as:
>    boolean resolve(long timeout)
>    void cancel();
> I'd be much happier if we could use a Future instead.
>    Future<Boolean> resolve();
> This would make it easier for the user because he doesn't have to start a thread on its own.
> However this breaks compatibility.
> We could therefore use something like:
>    Future<Boolean> startResolve();

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