當前位置: 首頁>>代碼示例>>Java>>正文


Java CacheAdapter類代碼示例

本文整理匯總了Java中org.eclipse.uml2.common.util.CacheAdapter的典型用法代碼示例。如果您正苦於以下問題:Java CacheAdapter類的具體用法?Java CacheAdapter怎麽用?Java CacheAdapter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CacheAdapter類屬於org.eclipse.uml2.common.util包,在下文中一共展示了CacheAdapter類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: releaseResourceSet

import org.eclipse.uml2.common.util.CacheAdapter; //導入依賴的package包/類
private void releaseResourceSet(ResourceSet resourceSet) {
	for (Iterator<Resource> i = resourceSet.getResources().iterator(); i.hasNext();) {
		Resource resource = i.next();
		resource.unload();

		// Use the UML2 modified API
		CacheAdapter.getInstance().getProxyMap().clear();
		// Use the UML2 modified API
		CacheAdapter.getInstance().clear(resource);
		i.remove();
	}
	resourceSet.eAdapters().clear();
}
 
開發者ID:ZhengshuaiPENG,項目名稱:org.lovian.eaxmireader,代碼行數:14,代碼來源:Executor.java

示例2: ExplorerSaveablesProvider

import org.eclipse.uml2.common.util.CacheAdapter; //導入依賴的package包/類
/**
 * ExplorerSaveablesProvider
 */
public ExplorerSaveablesProvider() {
    saveablesMap = new Hashtable<String, ExplorerSaveable>();
    
    UMLLoginController.addLoginListener(new UMLNexcoreLoginListener() {

        @Override
        public void changed(UMLNexcoreLoginEvent event) {
            synchronized (this) {
                if (event.getType() == UMLNexcoreLoginEvent.LOG_IN) {
                    // do nothing
                } else if (event.getType() == UMLNexcoreLoginEvent.LOG_OUT) {
                    if (saveablesMap != null) {
                        saveablesMap.clear();
                    }
                    fireSaveablesClosed(getSaveables());
                }
            }
        }
    });
    
    EList<Adapter> cacheAdapters = DomainRegistry.getUMLDomain().getResourceSet().eAdapters();

    cacheAdapters.add(new CacheAdapter(){
        @Override
        public void notifyChanged(Notification msg) {
            super.notifyChanged(msg);

            final Object notifier = msg.getNotifier();               
            
            if (notifier instanceof Resource) {
                Resource r = (Resource) notifier;
                switch (msg.getFeatureID(Resource.class)) {
                    // resourceset.getResources().remove(r) 될 때 실행됨.
                    case Resource.RESOURCE__RESOURCE_SET: {
                        if (saveablesMap != null) {
                            if (saveablesMap.containsKey(r.getURI().toString())) {
                                ExplorerSaveable saveable = saveablesMap.get(r.getURI().toString());
                                fireSaveablesClosed(new Saveable[] { saveable });
                                saveablesMap.remove(r.getURI().toString());
                            }
                        }
                        break;
                    }
                }
            }
        }
    });
}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:52,代碼來源:ExplorerSaveablesProvider.java

示例3: isEnabled

import org.eclipse.uml2.common.util.CacheAdapter; //導入依賴的package包/類
public static boolean isEnabled() {
    return CacheAdapter.THREAD_LOCAL != null;
}
 
開發者ID:abstratt,項目名稱:textuml,代碼行數:4,代碼來源:CacheAdapterManager.java

示例4: setAdapter

import org.eclipse.uml2.common.util.CacheAdapter; //導入依賴的package包/類
private static void setAdapter(CacheHolder toRestore) {
    if (!isEnabled())
        return;
    CustomCacheAdapter newAdapter = toRestore != null ? toRestore.getAdapter() : null;
    CacheAdapter.THREAD_LOCAL.set(newAdapter);
}
 
開發者ID:abstratt,項目名稱:textuml,代碼行數:7,代碼來源:CacheAdapterManager.java


注:本文中的org.eclipse.uml2.common.util.CacheAdapter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。