public class StartLevelRuntimeHandler extends Object implements Closeable
This class is not threadsafe!
| Modifier and Type | Field and Description |
|---|---|
static String |
LAUNCH_RUNBUNDLES_ATTRS |
static String |
LAUNCH_STARTLEVEL_DEFAULT
If this property is set we take on start levels, if this property is not
set we ignore the startlevels completely.
|
| Constructor and Description |
|---|
StartLevelRuntimeHandler() |
| Modifier and Type | Method and Description |
|---|---|
static StartLevelRuntimeHandler |
absent() |
void |
afterStart()
Called after the framework is started and the launcher is ready
|
void |
beforeStart(org.osgi.framework.launch.Framework systemBundle)
Must be called before the framework is started.
|
void |
close()
Close this object
|
static StartLevelRuntimeHandler |
create(Trace logger,
Map<String,String> outerConfiguration)
Create a start level handler.
|
static StartLevelRuntimeHandler |
create(Trace reporter,
Properties properties) |
int |
getBundleStartLevel(org.osgi.framework.Bundle bundle)
Get a bundle's start level
|
int |
getFrameworkStartLevel(org.osgi.framework.launch.Framework framework)
Answer the current framework start level
|
boolean |
hasStartLevels()
Indicate if this class supports start levels or not.
|
void |
setBundleStartLevel(org.osgi.framework.Bundle bundle,
int startlevel)
Set a bundle's start level
|
void |
setDefaultStartlevel(org.osgi.framework.launch.Framework framework,
int level)
Set the default start level of newly installed bundles
|
int |
setFrameworkStartLevel(org.osgi.framework.launch.Framework framework,
int startlevel,
org.osgi.framework.FrameworkListener... ls)
Set the framework start level and return previous
|
void |
setStartLevel(org.osgi.framework.Bundle b)
Set the start level of a bundle
|
void |
sync()
Wait for the framework to reach its start level.
|
void |
updateConfiguration(Map<String,?> configuration)
When the configuration properties have been updated
|
public static String LAUNCH_STARTLEVEL_DEFAULT
public static String LAUNCH_RUNBUNDLES_ATTRS
public boolean hasStartLevels()
public void setStartLevel(org.osgi.framework.Bundle b)
b - the bundlepublic int getFrameworkStartLevel(org.osgi.framework.launch.Framework framework)
framework - the frameworkpublic void setDefaultStartlevel(org.osgi.framework.launch.Framework framework,
int level)
framework - the frameworklevel - the default start levelpublic int setFrameworkStartLevel(org.osgi.framework.launch.Framework framework,
int startlevel,
org.osgi.framework.FrameworkListener... ls)
framework - the frameworkstartlevel - the start level to setls - listenerspublic int getBundleStartLevel(org.osgi.framework.Bundle bundle)
bundle - the bundle to querypublic void setBundleStartLevel(org.osgi.framework.Bundle bundle,
int startlevel)
bundle - the bundle to querystartlevel - start level to set, > 0public void beforeStart(org.osgi.framework.launch.Framework systemBundle)
ensure systemBundle.getState() == INIT and startlevel systemBundle == 0
systemBundle - the frameworkpublic void updateConfiguration(Map<String,?> configuration)
configuration - the configuration propertiespublic void afterStart()
public void sync()
afterStart() method. Will return when the framework has
traversed all start levels.public void close()
close in interface Closeableclose in interface AutoCloseablepublic static StartLevelRuntimeHandler create(Trace logger, Map<String,String> outerConfiguration)
LAUNCH_STARTLEVEL_DEFAULT
property is set we create an active handler that will direct the
framework properly according to the settings in Project Launcher. If not
set, a dummy is returned that does not do anythingouterConfiguration - the properties as set by the Project LauncherStartLevelRuntimeHandlerpublic static StartLevelRuntimeHandler absent()
public static StartLevelRuntimeHandler create(Trace reporter, Properties properties)
Copyright © 2021. All rights reserved.