public class FelixOsgiContainerManager extends Object implements OsgiContainerManager
| Modifier and Type | Field and Description |
|---|---|
static String |
ATLASSIAN_BOOTDELEGATION |
static String |
ATLASSIAN_BOOTDELEGATION_EXTRA |
static String |
ATLASSIAN_DISABLE_REFERENCE_PROTOCOL |
static int |
REFRESH_TIMEOUT |
| Constructor and Description |
|---|
FelixOsgiContainerManager(File frameworkBundlesDirectory,
OsgiPersistentCache persistentCache,
PackageScannerConfiguration packageScannerConfig,
HostComponentProvider provider,
PluginEventManager eventManager)
Constructs the container manager.
|
FelixOsgiContainerManager(URL frameworkBundlesZip,
OsgiPersistentCache persistentCache,
PackageScannerConfiguration packageScannerConfig,
HostComponentProvider provider,
PluginEventManager eventManager)
Constructs the container manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBundleListener(org.osgi.framework.BundleListener listener)
That is shortcut to access SystemBundle.
|
void |
clearExportCache()
Clears export cache.
|
org.osgi.framework.Bundle[] |
getBundles()
Gets a list of installed bundles
|
List<HostComponentRegistration> |
getHostComponentRegistrations()
Gets a list of host component registrations
|
org.osgi.framework.ServiceReference[] |
getRegisteredServices()
Gets a list of service references
|
org.osgi.util.tracker.ServiceTracker |
getServiceTracker(String interfaceClassName)
Gets a service tracker to follow a service registered under a certain interface.
|
org.osgi.util.tracker.ServiceTracker |
getServiceTracker(String interfaceClassName,
org.osgi.util.tracker.ServiceTrackerCustomizer serviceTrackerCustomizer)
Gets a service tracker to follow a service registered under a certain interface with a
ServiceTrackerCustomizer attached for customizing tracked service objects. |
org.osgi.framework.Bundle |
installBundle(File file,
ReferenceMode referenceMode)
Installs a bundle into a running OSGI container.
|
boolean |
isRunning() |
void |
onPluginFrameworkWarmRestarting(PluginFrameworkWarmRestartingEvent event) |
void |
onPluginUninstallation(PluginUninstalledEvent event) |
void |
onPluginUpgrade(PluginUpgradedEvent event) |
void |
onShutdown(PluginFrameworkShutdownEvent event) |
void |
onStart(PluginFrameworkStartingEvent event) |
void |
removeBundleListener(org.osgi.framework.BundleListener listener)
That is shortcut to access SystemBundle.
|
void |
setDisableMultipleBundleVersions(boolean val) |
void |
setFelixLogger(org.apache.felix.framework.Logger logger) |
void |
start()
Starts the OSGi container
|
void |
stop()
Stops the OSGi container
|
public static final int REFRESH_TIMEOUT
public static final String ATLASSIAN_BOOTDELEGATION
public static final String ATLASSIAN_BOOTDELEGATION_EXTRA
public static final String ATLASSIAN_DISABLE_REFERENCE_PROTOCOL
public FelixOsgiContainerManager(URL frameworkBundlesZip, OsgiPersistentCache persistentCache, PackageScannerConfiguration packageScannerConfig, HostComponentProvider provider, PluginEventManager eventManager) throws OsgiContainerException
frameworkBundlesZip - The location of the zip file containing framework bundlespersistentCache - The persistent cache to use for the framework and framework bundlespackageScannerConfig - The configuration for package scanningprovider - The host component provider. May be null.eventManager - The plugin event manager to register for init and shutdown eventsOsgiContainerException - If the host version isn't supplied and the cache directory cannot be cleaned.public FelixOsgiContainerManager(File frameworkBundlesDirectory, OsgiPersistentCache persistentCache, PackageScannerConfiguration packageScannerConfig, HostComponentProvider provider, PluginEventManager eventManager) throws OsgiContainerException
This constructor is used when frameworkBundlesDirectory has already been populated with the framework bundles. It
ignores OsgiPersistentCache.getFrameworkBundleCache().
frameworkBundlesDirectory - The directory containing framework bundlespersistentCache - The persistent cache to use for the frameworkpackageScannerConfig - The configuration for package scanningprovider - The host component provider. May be null.eventManager - The plugin event manager to register for init and shutdown eventsOsgiContainerException - If the host version isn't supplied and the cache directory cannot be cleaned.public void setFelixLogger(org.apache.felix.framework.Logger logger)
public void setDisableMultipleBundleVersions(boolean val)
public void clearExportCache()
public void onStart(PluginFrameworkStartingEvent event)
public void onShutdown(PluginFrameworkShutdownEvent event)
public void onPluginUpgrade(PluginUpgradedEvent event)
public void onPluginUninstallation(PluginUninstalledEvent event)
public void onPluginFrameworkWarmRestarting(PluginFrameworkWarmRestartingEvent event)
public void start()
throws OsgiContainerException
OsgiContainerManagerstart in interface OsgiContainerManagerOsgiContainerException - If the container cannot be startedpublic void stop()
throws OsgiContainerException
OsgiContainerManagerstop in interface OsgiContainerManagerOsgiContainerException - If the container cannot be stoppedpublic org.osgi.framework.Bundle[] getBundles()
OsgiContainerManagergetBundles in interface OsgiContainerManagerpublic org.osgi.framework.ServiceReference[] getRegisteredServices()
OsgiContainerManagergetRegisteredServices in interface OsgiContainerManagerpublic org.osgi.util.tracker.ServiceTracker getServiceTracker(String interfaceClassName)
OsgiContainerManagerServiceTracker instance for every call, so don't call more than necessary. Any provided
ServiceTracker instances will be opened before returning and automatically closed on shutdown.getServiceTracker in interface OsgiContainerManagerinterfaceClassName - The interface class as a Stringpublic org.osgi.util.tracker.ServiceTracker getServiceTracker(String interfaceClassName, org.osgi.util.tracker.ServiceTrackerCustomizer serviceTrackerCustomizer)
OsgiContainerManagerServiceTrackerCustomizer attached for customizing tracked service objects. Will return a new
ServiceTracker instance for every call, so don't call more than necessary. Any provided
ServiceTracker instances will be opened before returning and automatically closed on shutdown.getServiceTracker in interface OsgiContainerManagerinterfaceClassName - The interface class as a StringserviceTrackerCustomizer - service tracker customizer for the created service trackerpublic void addBundleListener(org.osgi.framework.BundleListener listener)
OsgiContainerManageraddBundleListener in interface OsgiContainerManagerpublic void removeBundleListener(org.osgi.framework.BundleListener listener)
OsgiContainerManagerremoveBundleListener in interface OsgiContainerManagerpublic org.osgi.framework.Bundle installBundle(File file, ReferenceMode referenceMode) throws OsgiContainerException
OsgiContainerManagerinstallBundle in interface OsgiContainerManagerfile - The bundle file to install.referenceMode - specifies whether the container may install a reference to, rather than copy, the bundle file.OsgiContainerException - If the bundle cannot be loadedpublic boolean isRunning()
isRunning in interface OsgiContainerManagerpublic List<HostComponentRegistration> getHostComponentRegistrations()
OsgiContainerManagergetHostComponentRegistrations in interface OsgiContainerManagerCopyright © 2019 Atlassian. All rights reserved.