コード例 #1
0
 protected Cache getGatewayKeyCache() {
   String apimGWCacheExpiry =
       ServiceReferenceHolder.getInstance()
           .getAPIManagerConfiguration()
           .getFirstProperty(APIConstants.TOKEN_CACHE_EXPIRY);
   if (!gatewayKeyCacheInit) {
     gatewayKeyCacheInit = true;
     if (apimGWCacheExpiry != null) {
       return APIUtil.getCache(
           APIConstants.API_MANAGER_CACHE_MANAGER,
           APIConstants.GATEWAY_KEY_CACHE_NAME,
           Long.parseLong(apimGWCacheExpiry),
           Long.parseLong(apimGWCacheExpiry));
     } else {
       long defaultCacheTimeout =
           Long.valueOf(
                   ServerConfiguration.getInstance()
                       .getFirstProperty(APIConstants.DEFAULT_CACHE_TIMEOUT))
               * 60;
       return APIUtil.getCache(
           APIConstants.API_MANAGER_CACHE_MANAGER,
           APIConstants.GATEWAY_KEY_CACHE_NAME,
           defaultCacheTimeout,
           defaultCacheTimeout);
     }
   }
   return Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER)
       .getCache(APIConstants.GATEWAY_KEY_CACHE_NAME);
 }
コード例 #2
0
 private void clearConfigCache() {
   Cache workflowCache =
       Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER)
           .getCache(APIConstants.WORKFLOW_CACHE_NAME);
   String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
   String cacheName = tenantDomain + "_" + APIConstants.WORKFLOW_CACHE_NAME;
   if (workflowCache.containsKey(cacheName)) {
     workflowCache.remove(cacheName);
   }
 }
コード例 #3
0
  protected Cache getResourceCache() {

    if (!resourceCacheInit) {
      resourceCacheInit = true;
      long defaultCacheTimeout =
          Long.valueOf(
                  ServerConfiguration.getInstance()
                      .getFirstProperty(APIConstants.DEFAULT_CACHE_TIMEOUT))
              * 60;
      return APIUtil.getCache(
          APIConstants.API_MANAGER_CACHE_MANAGER,
          APIConstants.RESOURCE_CACHE_NAME,
          defaultCacheTimeout,
          defaultCacheTimeout);
    }
    return Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER)
        .getCache(APIConstants.RESOURCE_CACHE_NAME);
  }
コード例 #4
0
ファイル: APIKeyValidator.java プロジェクト: Johanes/platform
 protected Cache initResourceCache() {
   return Caching.getCacheManager(APIConstants.API_MANAGER_CACHE_MANAGER)
       .getCache(APIConstants.RESOURCE_CACHE_NAME);
   // return PrivilegedCarbonContext.getCurrentContext(axisConfig).getCache("resourceCache");
 }
コード例 #5
0
ファイル: APIKeyValidator.java プロジェクト: Johanes/platform
 protected Cache initCache() {
   return Caching.getCacheManager("API_MANAGER_CACHE").getCache("keyCache");
   // return PrivilegedCarbonContext.getCurrentContext(axisConfig).getCache("keyCache");
 }