Class BundleModule

  • All Implemented Interfaces:
    com.google.inject.Module

    public class BundleModule
    extends java.lang.Object
    implements com.google.inject.Module
    Guice module that uses classpath-scanning and auto-wiring to bind JSR330 components from OSGi bundles.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configure​(com.google.inject.Binder binder)  
      protected com.google.inject.Module contextModule()
      Returns a module containing common context bindings for the bundle.
      protected com.google.inject.Module extensionsModule()
      Returns a module that installs modules from META-INF/services/com.google.inject.Module.
      protected java.util.Map<?,​?> getProperties()
      Returns the properties associated with the current context.
      protected java.util.List<com.google.inject.Module> modules()
      Returns the list of configured binding modules for this bundle.
      protected com.google.inject.Module spaceModule()
      Returns a module that scans the bundle classpath for components.
      • Methods inherited from class java.lang.Object

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

      • space

        protected final BundleClassSpace space
        Local bundle classes and resources.
      • extensions

        protected final SisuExtensions extensions
        Local bundle extensions to Sisu.
    • Constructor Detail

      • BundleModule

        public BundleModule​(org.osgi.framework.Bundle bundle,
                            MutableBeanLocator locator)
    • Method Detail

      • configure

        public void configure​(com.google.inject.Binder binder)
        Specified by:
        configure in interface com.google.inject.Module
      • getProperties

        protected java.util.Map<?,​?> getProperties()
        Returns the properties associated with the current context.
        Returns:
        The properties
      • modules

        protected java.util.List<com.google.inject.Module> modules()
        Returns the list of configured binding modules for this bundle.
        Returns:
        The bundle's modules
      • extensionsModule

        protected com.google.inject.Module extensionsModule()
        Returns a module that installs modules from META-INF/services/com.google.inject.Module.
        Returns:
        Local extensions module
      • contextModule

        protected com.google.inject.Module contextModule()
        Returns a module containing common context bindings for the bundle.
        Returns:
        Common context module
      • spaceModule

        protected com.google.inject.Module spaceModule()
        Returns a module that scans the bundle classpath for components.
        Returns:
        Classpath scanning module