Class FeatureManagerBootstrapper


  • public class FeatureManagerBootstrapper
    extends Object

    This class is used to automatically bootstrap a FeatureManager for Togglz which is the default behavior for simple web applications. The bootstrap process heavily relies on the BeanFinder SPI.

    The bootstrapping process consists of the following steps:

    1. First try to locate an implementation of the TogglzBootstrap interface. If this lookup is successful, a FeatureManager is created from it and returned.
    2. If the first step fails, the class will try to locate an implementation of the TogglzConfig interface. If an implementation is found, it is used to build a FeatureManager using FeatureManagerBuilder.togglzConfig(TogglzConfig) which will be returned to the caller.
    Author:
    Christian Kaltepoth
    • Constructor Detail

      • FeatureManagerBootstrapper

        public FeatureManagerBootstrapper()
    • Method Detail

      • createFeatureManager

        public FeatureManager createFeatureManager​(Object context)
        Tries to automatically build and configure a FeatureManager like described above.
        Parameters:
        context - An optional context object which is provided to the BeanFinder implementations. This parameter is for example used in web application to supply the ServletContext.
        Returns:
        A newly created FeatureManager
        Throws:
        IllegalStateException - if the bootstrapping process failed