Package org.togglz.core.bootstrap
Class FeatureManagerBootstrapper
- java.lang.Object
-
- org.togglz.core.bootstrap.FeatureManagerBootstrapper
-
public class FeatureManagerBootstrapper extends Object
This class is used to automatically bootstrap a
FeatureManagerfor Togglz which is the default behavior for simple web applications. The bootstrap process heavily relies on theBeanFinderSPI.The bootstrapping process consists of the following steps:
- First try to locate an implementation of the
TogglzBootstrapinterface. If this lookup is successful, aFeatureManageris created from it and returned. - If the first step fails, the class will try to locate an implementation of the
TogglzConfiginterface. If an implementation is found, it is used to build aFeatureManagerusingFeatureManagerBuilder.togglzConfig(TogglzConfig)which will be returned to the caller.
- Author:
- Christian Kaltepoth
- First try to locate an implementation of the
-
-
Constructor Summary
Constructors Constructor Description FeatureManagerBootstrapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FeatureManagercreateFeatureManager(Object context)Tries to automatically build and configure aFeatureManagerlike described above.
-
-
-
Method Detail
-
createFeatureManager
public FeatureManager createFeatureManager(Object context)
Tries to automatically build and configure aFeatureManagerlike described above.- Parameters:
context- An optional context object which is provided to theBeanFinderimplementations. 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
-
-