[
https://issues.apache.org/jira/browse/FELIX-2117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848701#action_12848701
]
Valentin Valchev commented on FELIX-2117:
-----------------------------------------
No ClassCasts. If you have the service, then you will have the required API.
The difference compared to optional import, is that optional imports are
resolved once. If package imported optional becomes available, the bundle that
imports it optionally must be resolved again, in order to get access to that
package.
The DynamicImport-Package dependency is resolved run-time, when class-loading
occurs. So if you try to access functionality that requires some API, it will
either fail with NoClassDefFound, or will work correctly.
> Use DynamicImport instead of Optional Packages
> ----------------------------------------------
>
> Key: FELIX-2117
> URL: https://issues.apache.org/jira/browse/FELIX-2117
> Project: Felix
> Issue Type: Improvement
> Components: Web Console
> Reporter: Valentin Valchev
>
> Currently the web console uses optional packages for some plugins.
> Unfortunately an 'optional' import is wired when the bundle is resolved.
> DynamicImport however is wired when the package is accessed.
> This means, that currently, you
> - install webconsole
> - install scr
> = scr plugin is not available
> - resolve webconsole (again)
> = scr plugin is available after 1 additional step
> However if DynamicImport is used, the SCR plugin will become available
> immediately after it is being installed.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.