Class SisuExtensions

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SisuExtensions​(ClassSpace space, boolean global)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> java.util.List<T> create​(java.lang.Class<T> spi)
      Creates instances of extensions listed under META-INF/services/ fully-qualified-SPI-name ; implementations must have a public no-arg constructor.
      <T,​C>
      java.util.List<T>
      create​(java.lang.Class<T> spi, java.lang.Class<C> contextType, C context)
      Creates instances of extensions listed under META-INF/services/ fully-qualified-SPI-name ; implementations must either have a public no-arg constructor or one with the declared context type.
      static SisuExtensions global​(ClassSpace space)
      Returns global SisuExtensions from the surrounding class space.
      void install​(com.google.inject.Binder binder)
      Installs modules listed under META-INF/services/com.google.inject.Module; modules must have a public no-arg constructor.
      <C> void install​(com.google.inject.Binder binder, java.lang.Class<C> contextType, C context)
      Installs modules listed under META-INF/services/com.google.inject.Module; modules must either have a public no-arg constructor or one with the declared context type.
      <T> java.util.List<java.lang.Class<? extends T>> load​(java.lang.Class<T> spi)
      Loads extension types listed under META-INF/services/ fully-qualified-SPI-name.
      static SisuExtensions local​(ClassSpace space)
      Returns local SisuExtensions from the containing class space.
      SpaceVisitor visitor​(com.google.inject.Binder binder)
      SpaceModule strategy that lets META-INF/services/org.eclipse.sisu.space.SpaceVisitor extensions override the default scanning.
      Wiring wiring​(com.google.inject.Binder binder)
      WireModule strategy that lets META-INF/services/org.eclipse.sisu.wire.Wiring extensions override the default wiring.
      • Methods inherited from class java.lang.Object

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

      • global

        private final boolean global
    • Constructor Detail

      • SisuExtensions

        private SisuExtensions​(ClassSpace space,
                               boolean global)
    • Method Detail

      • local

        public static SisuExtensions local​(ClassSpace space)
        Returns local SisuExtensions from the containing class space.
        Parameters:
        space - The class space
        Returns:
        Local extensions
      • global

        public static SisuExtensions global​(ClassSpace space)
        Returns global SisuExtensions from the surrounding class space.
        Parameters:
        space - The class space
        Returns:
        Global extensions
      • install

        public void install​(com.google.inject.Binder binder)
        Installs modules listed under META-INF/services/com.google.inject.Module; modules must have a public no-arg constructor.
        Parameters:
        binder - The current binder
      • install

        public <C> void install​(com.google.inject.Binder binder,
                                java.lang.Class<C> contextType,
                                C context)
        Installs modules listed under META-INF/services/com.google.inject.Module; modules must either have a public no-arg constructor or one with the declared context type.
        Parameters:
        binder - The current binder
        contextType - Optional context type
        context - Optional context instance
      • wiring

        public Wiring wiring​(com.google.inject.Binder binder)
        WireModule strategy that lets META-INF/services/org.eclipse.sisu.wire.Wiring extensions override the default wiring.
        Specified by:
        wiring in interface WireModule.Strategy
        Parameters:
        binder - The binder
        Returns:
        Extended wiring
      • visitor

        public SpaceVisitor visitor​(com.google.inject.Binder binder)
        SpaceModule strategy that lets META-INF/services/org.eclipse.sisu.space.SpaceVisitor extensions override the default scanning.
        Specified by:
        visitor in interface SpaceModule.Strategy
        Parameters:
        binder - The binder
        Returns:
        Extended visitor
      • create

        public <T> java.util.List<T> create​(java.lang.Class<T> spi)
        Creates instances of extensions listed under META-INF/services/ fully-qualified-SPI-name ; implementations must have a public no-arg constructor.
        Parameters:
        spi - The extension SPI
        Returns:
        List of extensions
      • create

        public <T,​C> java.util.List<T> create​(java.lang.Class<T> spi,
                                                    java.lang.Class<C> contextType,
                                                    C context)
        Creates instances of extensions listed under META-INF/services/ fully-qualified-SPI-name ; implementations must either have a public no-arg constructor or one with the declared context type.
        Parameters:
        spi - The extension SPI
        contextType - Optional context type
        context - Optional context instance
        Returns:
        List of extensions
      • load

        public <T> java.util.List<java.lang.Class<? extends T>> load​(java.lang.Class<T> spi)
        Loads extension types listed under META-INF/services/ fully-qualified-SPI-name.
        Parameters:
        spi - The extension SPI
        Returns:
        List of extension types