Togglz is an implementation of the Feature Toggles pattern for Java. Feature Toggles are a very common agile development practices in the context of continuous deployment and delivery. The basic idea is to associate a toggle with each new feature you are working on. This allows you to enable or disable these features at application runtime, even for individual users. Togglz is free and open source, licensed under the Apache License!
Want to learn more? Have a look at an usage example or check the quickstart guide.
Features are declared using a regular Java enum type:
public enum MyFeatures implements Feature { @Label("First Feature") FEATURE_ONE, @Label("Second Feature") FEATURE_TWO; public boolean isActive() { return FeatureContext.getFeatureManager().isActive(this); } }
Checking whether a specific feature is enabled for the current user is very simple. Just call the isActive()
method on the feature.
public void someBusinessMethod() { if( MyFeatures.FEATURE_ONE.isActive() ) { // do new exciting stuff here } [...] }
You can find more details in the quickstart guide.