Class StartLevelImpl
- All Implemented Interfaces:
StartLevel
- Author:
- Felix Project Team
-
Method Summary
Modifier and TypeMethodDescriptionintgetBundleStartLevel(Bundle bundle) Return the assigned start level value for the specified Bundle.intReturn the initial start level value that is assigned to a Bundle when it is first installed.intReturn the active start level value of the Framework.booleanisBundleActivationPolicyUsed(Bundle bundle) Returns whether the specified bundle's autostart setting indicates that the activation policy declared in the bundle's manifest must be used.booleanisBundlePersistentlyStarted(Bundle bundle) Returns whether the specified bundle's autostart setting indicates the bundle must be started.voidsetBundleStartLevel(Bundle bundle, int startlevel) Assign a start level value to the specified Bundle.voidsetInitialBundleStartLevel(int startlevel) Set the initial start level value that is assigned to a Bundle when it is first installed.voidsetStartLevel(int startlevel) Modify the active start level of the Framework.
-
Method Details
-
getStartLevel
public int getStartLevel()Description copied from interface:StartLevelReturn the active start level value of the Framework. If the Framework is in the process of changing the start level this method must return the active start level if this differs from the requested start level.- Specified by:
getStartLevelin interfaceStartLevel- Returns:
- The active start level value of the Framework.
-
setStartLevel
public void setStartLevel(int startlevel) Description copied from interface:StartLevelModify the active start level of the Framework.The Framework will move to the requested start level. This method will return immediately to the caller and the start level change will occur asynchronously on another thread.
If the specified start level is higher than the active start level, the Framework will continue to increase the start level until the Framework has reached the specified start level. At each intermediate start level value on the way to and including the target start level, the Framework must:
- Change the active start level to the intermediate start level value.
- Start bundles at the intermediate start level whose autostart setting
indicate they must be started. They are started as described in the
Bundle.start(int)method using theBundle.START_TRANSIENToption. TheBundle.START_ACTIVATION_POLICYoption must also be used ifStartLevel.isBundleActivationPolicyUsed(Bundle)returnstruefor the bundle.
FrameworkEvent.STARTLEVEL_CHANGEDto announce it has moved to the specified start level.If the specified start level is lower than the active start level, the Framework will continue to decrease the start level until the Framework has reached the specified start level. At each intermediate start level value on the way to and including the specified start level, the framework must:
- Stop bundles at the intermediate start level as described in the
Bundle.stop(int)method using theBundle.STOP_TRANSIENToption. - Change the active start level to the intermediate start level value.
FrameworkEvent.STARTLEVEL_CHANGEDto announce it has moved to the specified start level.If the specified start level is equal to the active start level, then no bundles are started or stopped, however, the Framework must fire a Framework event of type
FrameworkEvent.STARTLEVEL_CHANGEDto announce it has finished moving to the specified start level. This event may arrive before this method return.- Specified by:
setStartLevelin interfaceStartLevel- Parameters:
startlevel- The requested start level for the Framework.
-
getBundleStartLevel
Description copied from interface:StartLevelReturn the assigned start level value for the specified Bundle.- Specified by:
getBundleStartLevelin interfaceStartLevel- Parameters:
bundle- The target bundle.- Returns:
- The start level value of the specified Bundle.
-
setBundleStartLevel
Description copied from interface:StartLevelAssign a start level value to the specified Bundle.The specified bundle will be assigned the specified start level. The start level value assigned to the bundle will be persistently recorded by the Framework.
If the new start level for the bundle is lower than or equal to the active start level of the Framework and the bundle's autostart setting indicates the bundle must be started, the Framework will start the specified bundle as described in the
Bundle.start(int)method using theBundle.START_TRANSIENToption. TheBundle.START_ACTIVATION_POLICYoption must also be used ifStartLevel.isBundleActivationPolicyUsed(Bundle)returnstruefor the bundle. The actual starting of this bundle must occur asynchronously.If the new start level for the bundle is higher than the active start level of the Framework, the Framework will stop the specified bundle as described in the
Bundle.stop(int)method using theBundle.STOP_TRANSIENToption. The actual stopping of this bundle must occur asynchronously.- Specified by:
setBundleStartLevelin interfaceStartLevel- Parameters:
bundle- The target bundle.startlevel- The new start level for the specified Bundle.
-
getInitialBundleStartLevel
public int getInitialBundleStartLevel()Description copied from interface:StartLevelReturn the initial start level value that is assigned to a Bundle when it is first installed.- Specified by:
getInitialBundleStartLevelin interfaceStartLevel- Returns:
- The initial start level value for Bundles.
- See Also:
-
setInitialBundleStartLevel
public void setInitialBundleStartLevel(int startlevel) Description copied from interface:StartLevelSet the initial start level value that is assigned to a Bundle when it is first installed.The initial bundle start level will be set to the specified start level. The initial bundle start level value will be persistently recorded by the Framework.
When a Bundle is installed via
BundleContext.installBundle, it is assigned the initial bundle start level value.The default initial bundle start level value is 1 unless this method has been called to assign a different initial bundle start level value.
This method does not change the start level values of installed bundles.
- Specified by:
setInitialBundleStartLevelin interfaceStartLevel- Parameters:
startlevel- The initial start level for newly installed bundles.
-
isBundlePersistentlyStarted
Description copied from interface:StartLevelReturns whether the specified bundle's autostart setting indicates the bundle must be started.The autostart setting of a bundle indicates whether the bundle is to be started when its start level is reached.
- Specified by:
isBundlePersistentlyStartedin interfaceStartLevel- Parameters:
bundle- The bundle whose autostart setting is to be examined.- Returns:
trueif the autostart setting of the bundle indicates the bundle is to be started.falseotherwise.- See Also:
-
isBundleActivationPolicyUsed
Description copied from interface:StartLevelReturns whether the specified bundle's autostart setting indicates that the activation policy declared in the bundle's manifest must be used.The autostart setting of a bundle indicates whether the bundle's declared activation policy is to be used when the bundle is started.
- Specified by:
isBundleActivationPolicyUsedin interfaceStartLevel- Parameters:
bundle- The bundle whose autostart setting is to be examined.- Returns:
trueif the bundle's autostart setting indicates the activation policy declared in the manifest must be used.falseif the bundle must be eagerly activated.- See Also:
-