• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java StateRepository类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.togglz.core.repository.StateRepository的典型用法代码示例。如果您正苦于以下问题:Java StateRepository类的具体用法?Java StateRepository怎么用?Java StateRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StateRepository类属于org.togglz.core.repository包,在下文中一共展示了StateRepository类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createInMemoryStateRepository

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
private StateRepository createInMemoryStateRepository() {
    return new StateRepository() {

        Logger LOG = getLogger(TogglzConfiguration.class);

        private Map<String, FeatureState> featureStore = new ConcurrentHashMap<>();

        @Autowired
        UserProvider userProvider;

        @Override
        public FeatureState getFeatureState(final Feature feature) {
            if (featureStore.containsKey(feature.name())) {
                return featureStore.get(feature.name());
            }
            return new FeatureState(feature, false);
        }

        @Override
        public void setFeatureState(final FeatureState featureState) {
            featureStore.put(featureState.getFeature().name(), featureState);
            LOG.info((!StringUtils.isEmpty(userProvider.getCurrentUser().getName()) ? "User '" + userProvider.getCurrentUser().getName() + "'" : "Unknown user")
                    + (featureState.isEnabled() ? " enabled " : " disabled ") + "feature " + featureState.getFeature().name());
        }
    };
}
 
开发者ID:otto-de,项目名称:edison-microservice,代码行数:27,代码来源:InMemoryFeatureStateRepositoryConfiguration.java


示例2: DummyTogglzConfigForTest

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
/**
 * Create a simple dummy Togglz config for test
 * @param featureClass
 * @return
 */
private TogglzConfig DummyTogglzConfigForTest(final Class<? extends Feature> featureClass) {
	return new TogglzConfig() {
		
		@Override
		public UserProvider getUserProvider() {
			return new NoOpUserProvider();
		}
		
		@Override
		public StateRepository getStateRepository() {
			return new InMemoryStateRepository();
		}
		
		@Override
		public Class<? extends Feature> getFeatureClass() {
			return featureClass;
		}
	};
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:25,代码来源:PaasFeaturesTest.java


示例3: DefaultTogglzConfig

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
public DefaultTogglzConfig(final TogglzProperties properties,
                           final StateRepository stateRepository,
                           final UserProvider userProvider,
                           final FeatureClassProvider featureClassProvider) {
    if (properties.getCacheTtl() > 0) {
        this.stateRepository = new CachingStateRepository(stateRepository, properties.getCacheTtl());
    } else {
        this.stateRepository = stateRepository;
    }
    this.userProvider = userProvider;
    this.featureClassProvider = featureClassProvider;
}
 
开发者ID:otto-de,项目名称:edison-microservice,代码行数:13,代码来源:DefaultTogglzConfig.java


示例4: stateRepository

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(StateRepository.class)
public StateRepository stateRepository() {
    LOG.warn("===============================");
    LOG.warn("Using in-memory StateRepository for feature toggles");
    LOG.warn("===============================");
    return createInMemoryStateRepository();
}
 
开发者ID:otto-de,项目名称:edison-microservice,代码行数:9,代码来源:InMemoryFeatureStateRepositoryConfiguration.java


示例5: togglzConfig

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
@Bean
@Autowired
public TogglzConfig togglzConfig(final StateRepository stateRepository,
                                 final FeatureClassProvider featureClassProvider,
                                 final TogglzProperties togglzProperties) {
    return new DefaultTogglzConfig(togglzProperties, stateRepository, userProvider(), featureClassProvider);
}
 
开发者ID:otto-de,项目名称:edison-microservice,代码行数:8,代码来源:TogglzConfiguration.java


示例6: stateRepository

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
@Bean
StateRepository stateRepository(final MongoDatabase mongoDatabase, final FeatureClassProvider featureClassProvider,
                                final UserProvider userProvider, final MongoProperties mongoProperties) {
    LOG.info("===============================");
    LOG.info("Using MongoTogglzRepository with " + mongoDatabase.getClass().getSimpleName() + " MongoDatabase impl.");
    LOG.info("===============================");
    return new MongoTogglzRepository(mongoDatabase, featureClassProvider, userProvider, mongoProperties);
}
 
开发者ID:otto-de,项目名称:edison-microservice,代码行数:9,代码来源:MongoTogglzConfiguration.java


示例7: getStateRepository

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
public StateRepository getStateRepository() throws NamingException {

        InitialContext c = new InitialContext();
        DataSource dataSource = (DataSource) c.lookup(dataSourceJndi);

        JDBCStateRepository jdbcStateRepository = new JDBCStateRepository(dataSource, tableName, true, DefaultMapSerializer.singleline(), noCommit);

        if (cacheSeconds >= 0) {
            return new CachingStateRepository(jdbcStateRepository, cacheSeconds, TimeUnit.SECONDS);
        } else {
            return jdbcStateRepository;
        }
    }
 
开发者ID:lightblue-platform,项目名称:lightblue-migrator,代码行数:14,代码来源:LightblueMigrationStateRepositoryProvider.java


示例8: getStateRepository

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
@Override
public StateRepository getStateRepository() {
    try {
        return stateRepositoryProvider.getStateRepository();
    } catch (NamingException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:lightblue-platform,项目名称:lightblue-migrator,代码行数:9,代码来源:LightblueMigrationTogglzConfig.java


示例9: getStateRepository

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
@Override
public StateRepository getStateRepository() {
    return stateRepository;
}
 
开发者ID:otto-de,项目名称:edison-microservice,代码行数:5,代码来源:DefaultTogglzConfig.java


示例10: getStateRepository

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
public StateRepository getStateRepository() {
return stateRepository;
  }
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:4,代码来源:PaasTogglesConfiguration.java


示例11: setStateRepository

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
public void setStateRepository(StateRepository stateRepository) {
	this.stateRepository = stateRepository;
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:4,代码来源:PaasTogglesConfiguration.java


示例12: getStateRepository

import org.togglz.core.repository.StateRepository; //导入依赖的package包/类
public StateRepository getStateRepository() {
    return new FileBasedStateRepository(new File("/tmp/features.properties"));
}
 
开发者ID:fhopf,项目名称:togglz-jsp-example,代码行数:4,代码来源:ToggledFeatureConfiguration.java



注:本文中的org.togglz.core.repository.StateRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EnumSetSerializer类代码示例发布时间:2022-05-23
下一篇:
Java MKAddrInfo类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap