public interface

OsgiContainerManager

com.atlassian.plugin.osgi.container.OsgiContainerManager
Known Indirect Subclasses

Class Overview

Manages the OSGi container and handles any interactions with it

Summary

Public Methods
abstract Bundle[] getBundles()
Gets a list of installed bundles
abstract List<HostComponentRegistration> getHostComponentRegistrations()
Gets a list of host component registrations
abstract ServiceReference[] getRegisteredServices()
Gets a list of service references
abstract ServiceTracker getServiceTracker(String interfaceClassName)
Gets a service tracker to follow a service registered under a certain interface.
abstract Bundle installBundle(File file)
Installs a bundle into a running OSGI container
abstract boolean isRunning()
abstract void start()
Starts the OSGi container
abstract void stop()
Stops the OSGi container

Public Methods

public abstract Bundle[] getBundles ()

Gets a list of installed bundles

Returns
  • An array of bundles

public abstract List<HostComponentRegistration> getHostComponentRegistrations ()

Gets a list of host component registrations

Returns
  • A list of host component registrations

public abstract ServiceReference[] getRegisteredServices ()

Gets a list of service references

Returns
  • An array of service references

public abstract ServiceTracker getServiceTracker (String interfaceClassName)

Gets a service tracker to follow a service registered under a certain interface. 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.

Parameters
interfaceClassName The interface class as a String
Returns
  • A service tracker to follow all instances of that interface
Throws
IllegalStateException If the OSGi container is not running

public abstract Bundle installBundle (File file)

Installs a bundle into a running OSGI container

Parameters
file The bundle file to install
Returns
  • The created bundle
Throws
OsgiContainerException If the bundle cannot be loaded

public abstract boolean isRunning ()

Returns
  • If the container is running or not

public abstract void start ()

Starts the OSGi container

Throws
OsgiContainerException If the container cannot be started

public abstract void stop ()

Stops the OSGi container

Throws
OsgiContainerException If the container cannot be stopped