Package org.togglz.core.context
Class FeatureContext
java.lang.Object
org.togglz.core.context.FeatureContext
This class is typically used to obtain the
FeatureManager from application code. It uses the
FeatureManagerProvider to find the correct FeatureManager and caches it for each context class loader.- Author:
- Christian Kaltepoth
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic FeatureManagerReturns theFeatureManagerfor the current application (context class loader).static FeatureManagerReturns theFeatureManagerfor the current application (context class loader).
-
Constructor Details
-
FeatureContext
public FeatureContext()
-
-
Method Details
-
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
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()
-