Browse Source
Merge in DESIGN/design from ~DESTINY.LIN/design:fbp/release to fbp/release * commit '3b7def91a0b5c8be1fb85948f0b5e1284524fb2c': REPORT-137327 - 远程设计下切换目录卡顿优化 自动启动 REPORT-137327 - 远程设计下切换目录卡顿优化 修改缓存机制 REPORT-137327 - 远程设计下切换目录卡顿优化 REPORT-137327 - 远程设计下切换目录卡顿优化fbp/merge
Destiny.Lin-林锦龙
2 months ago
13 changed files with 23 additions and 126 deletions
@ -1,62 +0,0 @@
|
||||
package com.fr.design.cache; |
||||
|
||||
import com.fr.base.TableData; |
||||
import com.fr.design.data.tabledata.wrapper.TableDataFactory; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 设计器缓存管理 |
||||
* |
||||
* @author Destiny.Lin |
||||
* @since 11.0 |
||||
* Created on 2024/8/11 |
||||
*/ |
||||
public class DesignCacheManager { |
||||
|
||||
public static ThreadLocal<Map<String, TableData>> cacheTableData = new ThreadLocal<>(); |
||||
|
||||
/** |
||||
* 处理任务(使用数据集缓存) |
||||
*/ |
||||
public static void processByCacheTableData(Task task) { |
||||
try { |
||||
cacheTableData.set(TableDataFactory.getTableDatas()); |
||||
task.process(); |
||||
} finally { |
||||
cacheTableData.remove(); |
||||
} |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 是否使用数据集的缓存 |
||||
*/ |
||||
public static boolean useDataCache() { |
||||
return cacheTableData.get() != null; |
||||
} |
||||
|
||||
/** |
||||
* 获取数据集缓存 |
||||
*/ |
||||
public static ThreadLocal<Map<String, TableData>> getCacheTableData() { |
||||
return cacheTableData; |
||||
} |
||||
|
||||
/** |
||||
* 设置数据集缓存 |
||||
*/ |
||||
public static void setCacheTableData(ThreadLocal<Map<String, TableData>> cacheTableData) { |
||||
DesignCacheManager.cacheTableData = cacheTableData; |
||||
} |
||||
|
||||
/** |
||||
* 任务 |
||||
*/ |
||||
public interface Task { |
||||
/** |
||||
* 处理 |
||||
*/ |
||||
void process(); |
||||
} |
||||
} |
Loading…
Reference in new issue