UIServiceTrackers

public class UIServiceTrackers

The registry that handles UIServiceTracker instances created for bundles with Blueprint-Enabled header in their manifest.

See also: UIServiceTracker

Constructors

UIServiceTrackers

public UIServiceTrackers(BundleContext bundleContext)

Constructs the registry and registers a bundle listener that will remove trackers for bundles that are stopping.

Parameters:
  • bundleContext – the bundle context used to register the bundle listener

Methods

addTrackerFor

public UIServiceTracker addTrackerFor(Bundle bundle, ApplicationContext applicationContext)

Creates a UIServiceTracker for the given bundle. The org.motechproject.osgi.web.ModuleRegistrationData from the provided Spring context of the bundle will be used for registering the UI.

Parameters:
  • bundle – the bundle to create the tracker for
  • applicationContext – the Spring context of the bundle
Returns:

the newly created UIServiceTracker instance

isBeingTracked

public boolean isBeingTracked(Bundle bundle)

Checks whether this registry already has a tracker for the given bundle.

Parameters:
  • bundle – the bundle to check
Returns:

true if the registry has a tracker for the bundle, false otherwise

removeTrackerFor

public UIServiceTracker removeTrackerFor(Bundle bundle)

Closes and removes the UIServiceTracker for the bundle.

Parameters:
  • bundle – the bundle to remove the tracker for
Returns:

the closed and removed tracker