Class SisuExtender

  • All Implemented Interfaces:
    org.osgi.framework.BundleActivator

    public class SisuExtender
    extends java.lang.Object
    implements org.osgi.framework.BundleActivator
    OSGi extender that uses Sisu and Guice to wire up applications from one or more component bundles.
    To enable it install org.eclipse.sisu.inject.extender, or adapt the class for your own extender.
    • Constructor Summary

      Constructors 
      Constructor Description
      SisuExtender()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int bundleStateMask()
      Returns the mask of bundle states this extender is interested in.
      protected MutableBeanLocator createLocator​(org.osgi.framework.BundleContext context)
      Returns a new locator of bound components for this extender.
      protected SisuTracker createTracker​(org.osgi.framework.BundleContext context)
      Creates a new tracker of component bundles for this extender.
      protected MutableBeanLocator findLocator​(org.osgi.framework.BundleContext context)
      Finds the locator associated with this extender; creates one if none exist.
      void start​(org.osgi.framework.BundleContext context)  
      void stop​(org.osgi.framework.BundleContext context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • locators

        private static final java.util.Map<java.lang.Long,​MutableBeanLocator> locators
      • tracker

        protected SisuTracker tracker
        Tracker of component bundles.
    • Constructor Detail

      • SisuExtender

        public SisuExtender()
    • Method Detail

      • start

        public void start​(org.osgi.framework.BundleContext context)
        Specified by:
        start in interface org.osgi.framework.BundleActivator
      • stop

        public void stop​(org.osgi.framework.BundleContext context)
        Specified by:
        stop in interface org.osgi.framework.BundleActivator
      • bundleStateMask

        protected int bundleStateMask()
        Returns the mask of bundle states this extender is interested in.
        Returns:
        State mask
      • createTracker

        protected SisuTracker createTracker​(org.osgi.framework.BundleContext context)
        Creates a new tracker of component bundles for this extender.
        Parameters:
        context - The extender context
        Returns:
        New bundle tracker
      • createLocator

        protected MutableBeanLocator createLocator​(org.osgi.framework.BundleContext context)
        Returns a new locator of bound components for this extender.
        Parameters:
        context - The extender context
        Returns:
        New bean locator
      • findLocator

        protected final MutableBeanLocator findLocator​(org.osgi.framework.BundleContext context)
        Finds the locator associated with this extender; creates one if none exist.
        Parameters:
        context - The extender context
        Returns:
        Associated bean locator