public class

BundleScanner

extends BundleTracker
java.lang.Object
   ↳ org.osgi.util.tracker.BundleTracker
     ↳ org.eclipse.sisu.launch.BundleScanner

Class Overview

OSGi BundleTracker that tracks JSR330 bundles and uses BundleModule to bind components.

Summary

Fields
protected final MutableBeanLocator locator Shared locator of bound components.
protected final int stateMask Mask of bundle states being tracked.
[Expand]
Inherited Fields
From class org.osgi.util.tracker.BundleTracker
Public Constructors
BundleScanner(BundleContext context, int stateMask, MutableBeanLocator locator)
Public Methods
final Object addingBundle(Bundle bundle, BundleEvent event)
final void open()
final void purgeBundles()
Purges any bundles that are no longer valid.
final void removedBundle(Bundle bundle, BundleEvent event, Object object)
Protected Methods
Injector createInjector(Bundle bundle)
Creates a new Injector for the given bundle.
void destroyInjector(Bundle bundle, Injector injector)
Destroys the old Injector for the given bundle.
boolean evictBundle(Bundle bundle, Injector injector)
Determines whether we should destroy the Injector of the given bundle.
boolean injectBundle(Bundle bundle)
Determines whether we should create an Injector for the given bundle.
[Expand]
Inherited Methods
From class org.osgi.util.tracker.BundleTracker
From class java.lang.Object
From interface org.osgi.util.tracker.BundleTrackerCustomizer

Fields

protected final MutableBeanLocator locator

Shared locator of bound components.

protected final int stateMask

Mask of bundle states being tracked.

Public Constructors

public BundleScanner (BundleContext context, int stateMask, MutableBeanLocator locator)

Public Methods

public final Object addingBundle (Bundle bundle, BundleEvent event)

public final void open ()

public final void purgeBundles ()

Purges any bundles that are no longer valid.

public final void removedBundle (Bundle bundle, BundleEvent event, Object object)

Protected Methods

protected Injector createInjector (Bundle bundle)

Creates a new Injector for the given bundle.

Parameters
bundle The bundle
Returns
  • New injector

protected void destroyInjector (Bundle bundle, Injector injector)

Destroys the old Injector for the given bundle.

Parameters
bundle The bundle
injector Old injector

protected boolean evictBundle (Bundle bundle, Injector injector)

Determines whether we should destroy the Injector of the given bundle.

Parameters
bundle The bundle
injector The injector
Returns
  • true if the injector should be destroyed; otherwise false

protected boolean injectBundle (Bundle bundle)

Determines whether we should create an Injector for the given bundle.

Parameters
bundle The bundle
Returns
  • true if an injector should be created; otherwise false