You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Richard S. Hall (JIRA)" <ji...@apache.org> on 2009/09/21 14:36:17 UTC

[jira] Created: (FELIX-1625) Refactor bundle cache to simplify management

Refactor bundle cache to simplify management
--------------------------------------------

                 Key: FELIX-1625
                 URL: https://issues.apache.org/jira/browse/FELIX-1625
             Project: Felix
          Issue Type: Improvement
          Components: Framework
    Affects Versions: felix-2.0.0
            Reporter: Richard S. Hall
            Assignee: Richard S. Hall
             Fix For: felix-2.2.0


Currently, bundle cache management is a little clumsy since it spreads responsibility for managing the class across different layers. Also, it is not as efficient as it could be, since it opens the JAR file for each bundle twice when starting up. We should refactor the bundle cache to try to consolidate its management as much as possible. Since bundles already hold a reference to their archive, we don't actually need a separate bundle cache object to do this. Instead, we should try to make the operations on bundle responsible for cache management.

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


[jira] Commented: (FELIX-1625) Refactor bundle cache to simplify management

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

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

So, Marcel, I am to read your comment as a +1 for putting back the ability to be able to replace the cache implementation?

> Refactor bundle cache to simplify management
> --------------------------------------------
>
>                 Key: FELIX-1625
>                 URL: https://issues.apache.org/jira/browse/FELIX-1625
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: felix-2.0.0
>            Reporter: Richard S. Hall
>            Assignee: Richard S. Hall
>             Fix For: felix-2.2.0
>
>
> Currently, bundle cache management is a little clumsy since it spreads responsibility for managing the class across different layers. Also, it is not as efficient as it could be, since it opens the JAR file for each bundle twice when starting up. We should refactor the bundle cache to try to consolidate its management as much as possible. Since bundles already hold a reference to their archive, we don't actually need a separate bundle cache object to do this. Instead, we should try to make the operations on bundle responsible for cache management.

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


[jira] Commented: (FELIX-1625) Refactor bundle cache to simplify management

Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757964#action_12757964 ] 

Marcel Offermans commented on FELIX-1625:
-----------------------------------------

Yes, that's the short summary of what I was trying to say. :)

> Refactor bundle cache to simplify management
> --------------------------------------------
>
>                 Key: FELIX-1625
>                 URL: https://issues.apache.org/jira/browse/FELIX-1625
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: felix-2.0.0
>            Reporter: Richard S. Hall
>            Assignee: Richard S. Hall
>             Fix For: felix-2.2.0
>
>
> Currently, bundle cache management is a little clumsy since it spreads responsibility for managing the class across different layers. Also, it is not as efficient as it could be, since it opens the JAR file for each bundle twice when starting up. We should refactor the bundle cache to try to consolidate its management as much as possible. Since bundles already hold a reference to their archive, we don't actually need a separate bundle cache object to do this. Instead, we should try to make the operations on bundle responsible for cache management.

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


[jira] Commented: (FELIX-1625) Refactor bundle cache to simplify management

Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757887#action_12757887 ] 

Marcel Offermans commented on FELIX-1625:
-----------------------------------------

Please also consider supporting nested Felix instances that might want to use a different BundleCache. When trying different approaches for converting a client application based on OSGi to a web based application, one of the things I experimented with is the creation of a Felix instance per web session. Those instances shared their life cycle with the session and, unless you want to be able to persist those sessions, an in-memory bundle cache would be great for such short-lived instances. However, this would not be the bundle cache I'd like to have for the main Felix instance in that case.

In the end I decided to not yet go for this approach btw, because there currently are no tools to effectively debug and test such a setup with multiple embedded frameworks (for example, I would like to have shell commands to list such instances and "jump into them" so all shell commands apply to these embedded instances (again for debugging and diagnostics). I still think it is a valid (future) use case though.

> Refactor bundle cache to simplify management
> --------------------------------------------
>
>                 Key: FELIX-1625
>                 URL: https://issues.apache.org/jira/browse/FELIX-1625
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: felix-2.0.0
>            Reporter: Richard S. Hall
>            Assignee: Richard S. Hall
>             Fix For: felix-2.2.0
>
>
> Currently, bundle cache management is a little clumsy since it spreads responsibility for managing the class across different layers. Also, it is not as efficient as it could be, since it opens the JAR file for each bundle twice when starting up. We should refactor the bundle cache to try to consolidate its management as much as possible. Since bundles already hold a reference to their archive, we don't actually need a separate bundle cache object to do this. Instead, we should try to make the operations on bundle responsible for cache management.

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


[jira] Closed: (FELIX-1625) Refactor bundle cache to simplify management

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

Richard S. Hall closed FELIX-1625.
----------------------------------

    Resolution: Fixed

I made the bundle cache methods instance-based, rather than static so the previous approach to replacing the cache still works. As a result, I will close this issue since the other refactoring is still worthwhile.

> Refactor bundle cache to simplify management
> --------------------------------------------
>
>                 Key: FELIX-1625
>                 URL: https://issues.apache.org/jira/browse/FELIX-1625
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: felix-2.0.0
>            Reporter: Richard S. Hall
>            Assignee: Richard S. Hall
>             Fix For: felix-2.2.0
>
>
> Currently, bundle cache management is a little clumsy since it spreads responsibility for managing the class across different layers. Also, it is not as efficient as it could be, since it opens the JAR file for each bundle twice when starting up. We should refactor the bundle cache to try to consolidate its management as much as possible. Since bundles already hold a reference to their archive, we don't actually need a separate bundle cache object to do this. Instead, we should try to make the operations on bundle responsible for cache management.

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


[jira] Commented: (FELIX-1625) Refactor bundle cache to simplify management

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

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

I committed a patch for this. Currently, this breaks the feature we added to allow you to pass in a BundleCache instance, since the BundleCache is now only static methods. We will have to investigate an alternative approach for replacing the cache or if it is even necessary. I will leave this issue open for now as a result.

> Refactor bundle cache to simplify management
> --------------------------------------------
>
>                 Key: FELIX-1625
>                 URL: https://issues.apache.org/jira/browse/FELIX-1625
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: felix-2.0.0
>            Reporter: Richard S. Hall
>            Assignee: Richard S. Hall
>             Fix For: felix-2.2.0
>
>
> Currently, bundle cache management is a little clumsy since it spreads responsibility for managing the class across different layers. Also, it is not as efficient as it could be, since it opens the JAR file for each bundle twice when starting up. We should refactor the bundle cache to try to consolidate its management as much as possible. Since bundles already hold a reference to their archive, we don't actually need a separate bundle cache object to do this. Instead, we should try to make the operations on bundle responsible for cache management.

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