当前位置: 首页>>代码示例>>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;未经允许,请勿转载。