Class Extender

    • Constructor Detail

      • Extender

        public Extender()
    • Method Detail

      • start

        public abstract void start​(ExtensionBundle bundle)
        Start life-cycle phase trigger method.
        Upon successful execution the bundle will have all its extension points registered using register(ExtensionPoint, ExtensionFactory) and ready to be.
        Parameters:
        bundle - to be started
      • stop

        public abstract void stop​(ExtensionBundle bundle)
        Start life-cycle phase trigger method.
        Upon successful execution the bundle will have all its extension points unregistered using unregister(ExtensionPoint).
        Parameters:
        bundle - to be stopped
      • stopAll

        public abstract void stopAll()
        Stops all previously registered ExtensionBundles.
      • getExtension

        public abstract <E,​M extends Trait> E getExtension​(Extensible anExtensible,
                                                                 ExtensionPoint<E,​M> point)
        Creates and returns a unique per ExtensibleTrait object or null if no extension-point factory is registered for the given ExtensionPoint.
        Given that Extensible.getTrait(Class) is used to obtain the ExtendedTrait that the returned extension is uniquely associated with, the uniqueness and garbage collection of the returned extension is dependent on how the given Extensible handles its ExtendedTraits.
        Parameters:
        anExtensible -
        point -
        Returns:
        a unique per ExtensibleTrait extension object or null if no extension-point factory is registered for the given ExtensionPoint
      • register

        public abstract void register​(ExtensionPoint<?,​?> point,
                                      ExtensionFactory<?> factory)
        Registers an extension-point to factory association to be used in extension creation. The presence of an association for a given extension point guarantees that, when requested, a unique extension object per ExtensibleTrait extension is returned by getExtension(Extensible, ExtensionPoint).
        Parameters:
        point - the extension point to be associated with the given extension factory during extension retrieval using getExtension(Extensible, ExtensionPoint)
        factory -
      • unregister

        public abstract void unregister​(ExtensionPoint<?,​?> point)
        Unregisters an extension-point to factory association of the given extension point. The absence of an association for a given extension point guarantees that, when requested, a null is returned by getExtension(Extensible, ExtensionPoint).
        Unregistering extension points does not force the garbage collection of the already created extensions.
        Parameters:
        point -