[
https://issues.apache.org/jira/browse/FELIX-3411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13573401#comment-13573401
]
Yasuhiro Kawame commented on FELIX-3411:
----------------------------------------
I watched behavior in detail.
When change the framework start level,though there is m_activeStartLevel
outside a range, there is a possibility that BundleActivator#start() is called.
I did a test in the following steps:
=====
step 1
set the Framework Start Level = 1
BundleA : Bundle Start Level = 3 <-- INSTALLED(This bundle's
BundleActivator#start() throws an exception. )
BundleB : Bundle Start Level = 5 <-- INSTALLED
step 2
Call the BundleA#start().
Call the BundleB#start().
PersistentState is ACTIVE.
step 3
Set the Framework Start Level = 3.
BundleA throws Exception. <-- RESOLVED
step 4
Set the Framework Start Level = 5.
m_activeStartLevel = 3
low = 4
high = 5
< loop process >
step 4-1
StartLevelTuple <-- BundleA
((tuple.m_level >= low) && (tuple.m_level <= high)) is false.
m_activeStartLevel is still 3.
(((tuple.m_bundle.getPersistentState() == Bundle.ACTIVE)
|| (tuple.m_bundle.getPersistentState() == Bundle.STARTING))
&& (tuple.m_level == m_activeStartLevel)) is true.
Call startBundle().
the BundleA throws Exception. <-- I do not want to call this bundle's
BundleActivator#start().
step 4-2
StartLevelTuple <-- BundleB
((tuple.m_level >= low) && (tuple.m_level <= high)) is true.
m_activeStartLevel is changed 5.
(((tuple.m_bundle.getPersistentState() == Bundle.ACTIVE)
|| (tuple.m_bundle.getPersistentState() == Bundle.STARTING))
&& (tuple.m_level == m_activeStartLevel)) is true.
Call startBundle().
the BundleB is ACTIVE.
======
Best regards.
> The implementation of
> org.osgi.service.startlevel.StartLevel#setStartLevel(int) does not follow the
> spec
> --------------------------------------------------------------------------------------------------------
>
> Key: FELIX-3411
> URL: https://issues.apache.org/jira/browse/FELIX-3411
> Project: Felix
> Issue Type: Bug
> Components: Framework
> Affects Versions: framework-4.0.2
> Reporter: Yasuhiro Kawame
> Assignee: Richard S. Hall
> Fix For: framework-4.2.0
>
>
> I think that the implementation of Changing the Active Start Level is
> different from Spec.
> see:
> OSGi Service Platform Core Specification Release 4, Version 4.3, Figure 8.2
> page154
> Move to requested start level R, active level is A, B is a bundle's start
> level
> Spec:
> if (A < R)
> while (A < R) {
> A = A + 1
> Start All bundles where B = A
> }
> Implementation:
> if (A < R)
> Start All bundles where B <= R
> A = R
> Similarly, if A > R.
> Javadoc:
> http://www.osgi.org/javadoc/r4v43/org/osgi/service/startlevel/StartLevel.html#setStartLevel%28int%29
> http://www.osgi.org/javadoc/r4v43/org/osgi/framework/startlevel/FrameworkStartLevel.html#setStartLevel(int,
> org.osgi.framework.FrameworkListener...)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira