# HG changeset patch # User stechong # Date 1282255016 18000 # Node ID e3bac873e5c885dcce850564ff8ce401a76e6b9f # Parent b068cf1b44ee3d5841631ac569729908b106d617 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated. diff -r b068cf1b44ee -r e3bac873e5c8 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Thu Aug 19 10:49:50 2010 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Thu Aug 19 16:56:56 2010 -0500 @@ -343,6 +343,7 @@ entry.setEnabled(currSDK.isEnabled()); setSDKCacheEntry(entry); } + flushSDKCache(); } } @@ -648,6 +649,14 @@ SDKCacheUtils.getCache().removeCache(SDK_MANAGER_CACHE_KEY, false); } + protected void flushSDKCache() { + try { + SDKCacheUtils.getCache().flushCache(SDK_MANAGER_CACHE_KEY); + } catch (Exception e) { + e.printStackTrace(); + } + } + @SuppressWarnings("unchecked") protected List getSDKCacheIdList() { Map cacheMap = SDKCacheUtils.getCache().getCachedData(SDK_MANAGER_CACHE_KEY, Map.class, 0); diff -r b068cf1b44ee -r e3bac873e5c8 core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/CacheUtils.java --- a/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/CacheUtils.java Thu Aug 19 10:49:50 2010 -0500 +++ b/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/CacheUtils.java Thu Aug 19 16:56:56 2010 -0500 @@ -177,6 +177,13 @@ caches.clear(); } + public void flushCache(String identifier) throws Exception { + CacheEntry entry = caches.get(identifier); + if (entry != null) { + entry.flush(); + } + } + public IPath getDefaultLocation() { return defaultLocation; }