@Service(value="oSGiManagement") public class OSGiManagement extends Object implements org.osgi.framework.BundleListener, InitializationCompleteListener
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_KEY_SYMBOLIC_NAME
A property key for symbolic name, which could be used accross the whole application.
|
Constructor and Description |
---|
OSGiManagement() |
Modifier and Type | Method and Description |
---|---|
void |
addFrameworkPropertiesLocation(String location)
Add a location to look for an properties file which defines additional settings that should
be passed to OSGi framework when it is created.
|
void |
addListener(CommunoteBundleListener listener) |
void |
addListeners(Collection<CommunoteBundleListener> listeners) |
void |
bundleChanged(org.osgi.framework.BundleEvent event)
Listens to bundle changes.
|
org.osgi.framework.launch.Framework |
getFramework() |
Collection<CommunoteBundleListener> |
getListeners() |
void |
initializationComplete() |
boolean |
isBundleStarted(String symbolicName) |
void |
start()
Starts the framework.
|
void |
stop()
Stops the Framework
|
public static final String PROPERTY_KEY_SYMBOLIC_NAME
public void addFrameworkPropertiesLocation(String location)
org.osgi.framework.system.packages.extra
. This property will be merged by
appending the value after a comma. Adding locations after the framework was started has no
effect.location
- a location of a properties file on the classpath or filesystem. The former has to
start with classpath: and the latter with file:public void addListener(CommunoteBundleListener listener)
listener
- Listener.@Autowired(required=false) public void addListeners(Collection<CommunoteBundleListener> listeners)
listeners
- List of listeners.public void bundleChanged(org.osgi.framework.BundleEvent event)
bundleChanged
in interface org.osgi.framework.BundleListener
event
- The event.public org.osgi.framework.launch.Framework getFramework()
public Collection<CommunoteBundleListener> getListeners()
public void initializationComplete()
initializationComplete
in interface InitializationCompleteListener
public boolean isBundleStarted(String symbolicName)
symbolicName
- The symbolic name of the bundle.true
, when the bundle is started, else false
.public void start() throws org.osgi.framework.BundleException
initializationComplete()
callback.org.osgi.framework.BundleException
- Exception.public void stop()
Copyright © 2019 Communote team. All rights reserved.