Package org.togglz.core.context
Class FeatureContext
- java.lang.Object
-
- org.togglz.core.context.FeatureContext
-
public class FeatureContext extends Object
This class is typically used to obtain theFeatureManagerfrom application code. It uses theFeatureManagerProviderto find the correct FeatureManager and caches it for each context class loader.- Author:
- Christian Kaltepoth
-
-
Constructor Summary
Constructors Constructor Description FeatureContext()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearCache()static FeatureManagergetFeatureManager()Returns theFeatureManagerfor the current application (context class loader).static FeatureManagergetFeatureManagerOrNull()Returns theFeatureManagerfor the current application (context class loader).
-
-
-
Method Detail
-
getFeatureManager
public static FeatureManager getFeatureManager()
Returns theFeatureManagerfor the current application (context class loader). The method uses theFeatureManagerProviderSPI to find the correctFeatureManagerinstance. It will throw a runtime exception if noFeatureManagercan be found.- Returns:
- The
FeatureManagerfor the application, nevernull
-
getFeatureManagerOrNull
public static FeatureManager getFeatureManagerOrNull()
Returns theFeatureManagerfor the current application (context class loader). The method uses theFeatureManagerProviderSPI to find the correctFeatureManagerinstance. If not manager could be found,nullis returned.- Returns:
- The
FeatureManagerfor the application ornull
-
clearCache
public static void clearCache()
-
-