javax.cache.Cache.keys()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中javax.cache.Cache.keys()方法的一些代码示例,展示了Cache.keys()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cache.keys()方法的具体详情如下:
包路径:javax.cache.Cache
类名称:Cache
方法名:keys

Cache.keys介绍

暂无

代码示例

代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.event.core

public List<Subscription> getMatchingSubscriptions(String topicName) {
  topicName = getTopicName(topicName);
  List<Subscription> subscriptions = new ArrayList<Subscription>();
  List<String> matchingTopicNames = getTopicMatchingNames(topicName);
  for (String matchingTopicName : matchingTopicNames){
    if (getTopicSubscriptionCache().get(matchingTopicName) != null){
      SubscriptionContainer matchingContainer = getTopicSubscriptionCache().get(matchingTopicName);
      Iterator<String> keysOfSubscription = matchingContainer.getSubscriptionsCache().keys();
      
      while(keysOfSubscription.hasNext()) {
        String key = keysOfSubscription.next();
        subscriptions.add(matchingContainer.getSubscriptionsCache().get(key));
      }
    }
  }
  return subscriptions;
}

代码示例来源:origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.gateway

PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true);
Iterator iterator = Caching.getCacheManager("API_MANAGER_CACHE").getCache("keyCache").keys();
while (iterator.hasNext()) {
  String cacheKey = iterator.next().toString();

相关文章